Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ To run LiquidJava, use the Maven command below, replacing `/path/to/your/project
```bash
mvn exec:java -pl liquidjava-verifier -Dexec.mainClass="liquidjava.api.CommandLineLauncher" -Dexec.args="/path/to/your/project"
```
*Warning: Any change to LiquidJava requires rebuilding the jar.*


If you're on Linux/macOS, you can use the `liquidjava` script (from the repository root) to simplify the process.

Expand All @@ -105,10 +103,14 @@ The starter test file is `TestExamples.java`, which runs the test suite under th

The test suite considers test cases:
1. Files that start with `Correct` or `Error` (e.g., `CorrectRecursion.java`)
2. Packages or folders that contain the word `correct` or `error` (e.g., `arraylist_correct`)
2. Directories that contain the word `correct` or `error` (e.g., `arraylist_correct`)

Therefore, the files and folders that do not follow this pattern are ignored.

For failing test cases, the expected error must be specified as follows:
1. In singular test files, the expected error (title) should be written in the first line of the file as a comment
2. In test directories, a `.expected` file should be included in that directory with the expected error (title)

## Project Structure

* **docs**: Contains documents used for the design of the language. This folder includes a [README](./docs/design/README.md) with the link to the full artifact used in the design process. It also contains initial documents used to prepare the design of the refinements language during its evaluation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Refinement Error
package testSuite;

import liquidjava.specification.Refinement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Refinement Error
package testSuite;

import liquidjava.specification.Refinement;
Expand Down
1 change: 1 addition & 0 deletions liquidjava-example/src/main/java/testSuite/ErrorAlias.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Refinement Error
package testSuite;

import liquidjava.specification.Refinement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Not Found Error
package testSuite;

import liquidjava.specification.Refinement;
Expand All @@ -8,7 +9,7 @@
public class ErrorAliasArgumentSize {

public static void main(String[] args) {
@Refinement("InRange( _, 10)")
@Refinement("InRange(j, 10)")
int j = 15;
Copy link
Collaborator Author

@rcosta358 rcosta358 Nov 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we are getting a not found error instead of an argument mismatch error.
Needs to be fixed in the future by checking if the provided arguments match the alias definition.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in #127.

}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Refinement Error
package testSuite;

import liquidjava.specification.Refinement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Refinement Error
package testSuite;

import liquidjava.specification.Refinement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Refinement Error
package testSuite;

import liquidjava.specification.Refinement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Refinement Error
package testSuite;

import liquidjava.specification.Refinement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Refinement Error
package testSuite;

import liquidjava.specification.Refinement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Refinement Error
package testSuite;

import liquidjava.specification.Refinement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Refinement Error
package testSuite;

import liquidjava.specification.Refinement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Refinement Error
package testSuite;

import liquidjava.specification.Refinement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Refinement Error
package testSuite;

import liquidjava.specification.Refinement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Refinement Error
package testSuite;

import liquidjava.specification.Refinement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Refinement Error
package testSuite;

import liquidjava.specification.Refinement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Refinement Error
package testSuite;

import liquidjava.specification.Refinement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Refinement Error
package testSuite;

import liquidjava.specification.Refinement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Refinement Error
package testSuite;

import liquidjava.specification.Refinement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Refinement Error
package testSuite;

import liquidjava.specification.Refinement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Error
package testSuite;

import liquidjava.specification.Refinement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Error
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as below

package testSuite;

import liquidjava.specification.Refinement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Refinement Error
package testSuite;

import liquidjava.specification.Refinement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Refinement Error
package testSuite;

import liquidjava.specification.Refinement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Refinement Error
package testSuite;

import liquidjava.specification.Refinement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Refinement Error
package testSuite;

import liquidjava.specification.Refinement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Refinement Error
package testSuite;

import liquidjava.specification.Refinement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Refinement Error
package testSuite;

import liquidjava.specification.Refinement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Syntax Error
package testSuite;

import liquidjava.specification.RefinementAlias;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Refinement Error
package testSuite;

import liquidjava.specification.Refinement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Refinement Error
package testSuite;

import liquidjava.specification.Refinement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Refinement Error
package testSuite;

import liquidjava.specification.Refinement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Refinement Error
package testSuite;

import liquidjava.specification.Refinement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Refinement Error
package testSuite;

import liquidjava.specification.Refinement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Refinement Error
package testSuite;

import liquidjava.specification.Refinement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Refinement Error
package testSuite;

import liquidjava.specification.Refinement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Refinement Error
package testSuite;

import liquidjava.specification.Refinement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Refinement Error
package testSuite;

import liquidjava.specification.Refinement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Refinement Error
package testSuite;

import liquidjava.specification.Refinement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Refinement Error
package testSuite;

import liquidjava.specification.Refinement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Syntax Error
package testSuite;

import liquidjava.specification.Refinement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Refinement Error
package testSuite;

import liquidjava.specification.Refinement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// State Refinement Error
package testSuite;

import liquidjava.specification.Refinement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Error
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why just error?

package testSuite;

import liquidjava.specification.Refinement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Refinement Error
package testSuite;

import liquidjava.specification.Refinement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Refinement Error
package testSuite;

import liquidjava.specification.Refinement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Error
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this just error? we don't have a more specific type?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the most general case, a.k.a. CustomError, but we can introduce more specific errors in the future.

package testSuite.classes;

import liquidjava.specification.Ghost;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
State Refinement Error
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
State Refinement Error
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Refinement Error
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
State Refinement Error
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
State Refinement Error
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
State Refinement Error
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Refinement Error
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
State Refinement Error
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Refinement Error
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Refinement Error
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
State Refinement Error
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
State Refinement Error
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
State Conflict Error
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// State Refinement Error
package testSuite.field_updates;

import liquidjava.specification.StateRefinement;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Refinement Error
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Refinement Error
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Refinement Error
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,16 @@ public <R> void visitCtMethod(CtMethod<R> method) {
String message = String.format("Could not find constructor '%s' for '%s'", method.getSignature(),
prefix);
String[] overloads = getOverloads(targetType, method);
diagnostics.add(
new ExternalMethodNotFoundWarning(method.getPosition(), message, method.getSignature(), prefix, overloads));
diagnostics.add(new ExternalMethodNotFoundWarning(method.getPosition(), message, method.getSignature(),
prefix, overloads));
}
} else {
if (!methodExists(targetType, method)) {
String message = String.format("Could not find method '%s %s' for '%s'",
method.getType().getSimpleName(), method.getSignature(), prefix);
String[] overloads = getOverloads(targetType, method);
diagnostics.add(
new ExternalMethodNotFoundWarning(method.getPosition(), message, method.getSignature(), prefix, overloads));
diagnostics.add(new ExternalMethodNotFoundWarning(method.getPosition(), message, method.getSignature(),
prefix, overloads));
return;
}
}
Expand Down
Loading