Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add @NullUnmarked on classes #134

Merged
merged 47 commits into from
Feb 17, 2023
Merged
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
d465eda
init
nimakarimipour Feb 10, 2023
2e8e65f
update
nimakarimipour Feb 10, 2023
46d84ac
undo unwanted change
nimakarimipour Feb 11, 2023
1fba197
update
nimakarimipour Feb 11, 2023
3e2e8b4
update
nimakarimipour Feb 11, 2023
2bf6459
update
nimakarimipour Feb 11, 2023
70bf1ef
move to proper position
nimakarimipour Feb 11, 2023
6046ebf
update
nimakarimipour Feb 11, 2023
f98fc55
update
nimakarimipour Feb 11, 2023
fc41c67
undo deleted comment
nimakarimipour Feb 11, 2023
c201245
Update annotator-core/src/main/java/edu/ucr/cs/riple/core/Annotator.java
nimakarimipour Feb 12, 2023
da8c98a
reformat
nimakarimipour Feb 12, 2023
64d8c57
keep file path info for class with no fields as well
nimakarimipour Feb 12, 2023
47998c0
update unit test
nimakarimipour Feb 12, 2023
01c679a
remove print statement
nimakarimipour Feb 13, 2023
8a517d0
prevent constructor @NullUnmarked for constructors
nimakarimipour Feb 13, 2023
8c2c3ae
Merge branch 'nimak/resolve-remaining' into nimak/nullunmarked-class
nimakarimipour Feb 13, 2023
6b49f66
merge with nimak/force-resolve
nimakarimipour Feb 13, 2023
fcd2fe6
add comment
nimakarimipour Feb 13, 2023
ab8d201
Merge branch 'nimak/resolve-remaining' into nimak/nullunmarked-class
nimakarimipour Feb 13, 2023
5f25f1b
update unit test
nimakarimipour Feb 13, 2023
27a2535
update nullaway test version
nimakarimipour Feb 14, 2023
0d630c6
Merge branch 'nimak/resolve-remaining' into nimak/update-nullaway
nimakarimipour Feb 14, 2023
b27c14a
Merge branch 'master' into nimak/resolve-remaining
nimakarimipour Feb 14, 2023
79b11b1
Merge branch 'nimak/resolve-remaining' into nimak/update-nullaway
nimakarimipour Feb 14, 2023
2b13142
Merge branch 'master' into nimak/update-nullaway
nimakarimipour Feb 15, 2023
4f18e80
fix bug
nimakarimipour Feb 15, 2023
9b729e8
bug fix
nimakarimipour Feb 15, 2023
dcf81b4
reformat
nimakarimipour Feb 15, 2023
0550bb5
update unit test expected values
nimakarimipour Feb 15, 2023
15fbbd4
Merge branch 'master' into nimak/nullunmarked-class
nimakarimipour Feb 15, 2023
9798ca4
Merge branch 'nimak/update-nullaway' into nimak/nullunmarked-class
nimakarimipour Feb 15, 2023
084e9e6
update
nimakarimipour Feb 15, 2023
cafef18
rename to init block
nimakarimipour Feb 15, 2023
139c19a
remove import from unit test input
nimakarimipour Feb 15, 2023
1f39e96
Merge branch 'master' into nimak/nullunmarked-class
nimakarimipour Feb 15, 2023
a811889
remove import from unit test input
nimakarimipour Feb 15, 2023
71b998b
add unit test for named inner classes
nimakarimipour Feb 15, 2023
4fb60f1
add unit test for named inner classes
nimakarimipour Feb 15, 2023
344007b
rename test
nimakarimipour Feb 15, 2023
45374b8
Merge branch 'master' into nimak/update-nullaway
nimakarimipour Feb 15, 2023
3e1bb7c
Update annotator-core/src/main/java/edu/ucr/cs/riple/core/metadata/tr…
nimakarimipour Feb 15, 2023
3a43655
Update annotator-core/src/main/java/edu/ucr/cs/riple/core/metadata/tr…
nimakarimipour Feb 15, 2023
ca510cc
Merge branch 'nimak/update-nullaway' into nimak/nullunmarked-class
nimakarimipour Feb 15, 2023
95429c8
merge master
nimakarimipour Feb 16, 2023
4eb1bbe
Merge branch 'master' into nimak/nullunmarked-class
nimakarimipour Feb 16, 2023
74e44b9
update comment
nimakarimipour Feb 17, 2023
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
Prev Previous commit
Next Next commit
update unit test
  • Loading branch information
nimakarimipour committed Feb 12, 2023
commit 47998c01f5b1f7148818a15f711ba424ae84b3d9
17 changes: 17 additions & 0 deletions annotator-core/src/test/java/edu/ucr/cs/riple/core/CoreTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import edu.ucr.cs.riple.injector.changes.AddAnnotation;
import edu.ucr.cs.riple.injector.changes.AddMarkerAnnotation;
import edu.ucr.cs.riple.injector.changes.AddSingleElementAnnotation;
import edu.ucr.cs.riple.injector.location.OnClass;
import edu.ucr.cs.riple.injector.location.OnField;
import edu.ucr.cs.riple.injector.location.OnMethod;
import edu.ucr.cs.riple.injector.location.OnParameter;
Expand Down Expand Up @@ -426,6 +427,9 @@ public void staticBlockLocalVariableInitializationTest() {
" }",
"}",
"class B {",
" {",
" foo().hashCode();",
" }",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we want to test static initializer block support and instance initializer block in the same test? (if so, the test case might need renaming). Or is it perhaps better to have two separate test cases for ease of reading/debugging?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think the decision for now is to have them in one test until #137 is finalized, therefore I renamed the test name 344007b

" @Nullable",
" public static Object foo() { return null; }",
" @Nullable",
Expand All @@ -435,5 +439,18 @@ public void staticBlockLocalVariableInitializationTest() {
.addExpectedReports(new TReport(new OnField("A.java", "test.A", singleton("f")), -3))
.enableForceResolve()
.start();
List<AddAnnotation> expectedAnnotations =
List.of(
new AddMarkerAnnotation(
new OnField(
coreTestHelper.getSourceRoot().resolve("A.java").toString(),
"test.A",
Set.of("f")),
"javax.annotation.Nullable"),
new AddMarkerAnnotation(
new OnClass(coreTestHelper.getSourceRoot().resolve("A.java").toString(), "test.B"),
"org.jspecify.nullness.NullUnmarked"));
Assert.assertEquals(
expectedAnnotations, coreTestHelper.getConfig().log.getInjectedAnnotations());
}
}