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

Introduce TypeMemberOrder bug checker #636

Open
wants to merge 51 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
4487ec0
Naive impl
benhalasi May 3, 2023
07c19c8
Consider comments
benhalasi May 16, 2023
f962899
Prepare the code for others to see
benhalasi May 17, 2023
4140da3
Test if error message contains crucial information
benhalasi May 18, 2023
5b522ae
Code clean-up, formatting, docs, TEMPORARY supress warnings
benhalasi May 18, 2023
d887fdc
Cannot verify whitespace related requirements as `TestMode.TEXT_MATCH…
benhalasi May 18, 2023
1330a2f
Apply my suggestions
benhalasi May 18, 2023
fb76a55
Suggestions
rickie May 25, 2023
2e29731
Drop `replaceIncludingComments`
rickie May 25, 2023
d10a9ed
Revert "Drop `replaceIncludingComments`"
rickie May 25, 2023
7a5e504
Suggestions
benhalasi Jul 9, 2023
dc79300
Checkstyle
benhalasi Jul 10, 2023
76ee961
suggestions
oxkitsune Jul 24, 2023
62823ff
Remove stray unused import
oxkitsune Jul 24, 2023
7fcb987
Simplifing logic, killing mutants
benhalasi Jul 25, 2023
d01a959
"Fix" previous token detection
benhalasi Jul 28, 2023
c12e2e0
Assume that only generated members' end position is unavailable.
benhalasi Jul 28, 2023
381b063
Suggestions on naming, minor organizational changes, rewordings
benhalasi Jul 29, 2023
a47b718
Reproduce error-prone token start - end position overlap
benhalasi Jul 29, 2023
156c2ba
Suggestions
Stephan202 Aug 12, 2023
197eeba
List all remarks as TODOs, or address them
benhalasi Jan 14, 2024
4bbb603
Rename `*class*` to `*type*`
benhalasi Jan 14, 2024
909449d
Add identification test for an empty class, sync identifaction test w…
benhalasi Jan 14, 2024
1a306a6
Verify that SupressWarnings("all" or "TypeMemberOrdering") are not or…
benhalasi Jan 14, 2024
4d772d6
Suggestions
benhalasi Jan 14, 2024
819596b
Test initializer block ordering
benhalasi Jan 14, 2024
9d436b9
Implement initializer block ordering
benhalasi Jan 14, 2024
b922cf0
Test inner type ordering
benhalasi Jan 14, 2024
ed5efe3
Implement inner type ordering
benhalasi Jan 14, 2024
f63971e
Test not-ordering unordered members annotated w/ SuppressWarnings
benhalasi Jan 14, 2024
d93e8a1
Stop sorting unsorted members annotated w/ SuppressWarnings - all or …
benhalasi Jan 14, 2024
738dcf2
Rename `TypeMemberWithComments` to `TypeMember`
benhalasi Jan 14, 2024
e5d1aa2
Support classes, interfaces and enums
benhalasi Jan 21, 2024
4e33c52
Post rebase fix
rickie Feb 22, 2024
fb14933
Pair programming session
rickie Feb 22, 2024
d444106
Test abstract and default methods
benhalasi Mar 3, 2024
ecd91d1
Tweaks
benhalasi Mar 4, 2024
00bd247
Suggestions
rickie Mar 23, 2024
8f171a5
Improve more tests
rickie Apr 8, 2024
d0b9479
Reproduce syntactically wrong replacement with annotations containing…
benhalasi May 4, 2024
5652cb6
Fix syntactically wrong replecement with annotations containing `LBRACE`
benhalasi May 4, 2024
173aebf
Suggestions
rickie May 27, 2024
2ae6f20
Suggestions part 1
rickie May 30, 2024
c521778
Try to implement new thing
rickie May 30, 2024
167e321
Final suggestions, but three failing tests
rickie May 30, 2024
1306bc0
Move `TypeMemberOrder` BugChecker into `experimental` module
benhalasi Jun 2, 2024
59a0616
Fix & enable `TypeMemberOrderEnumTest`
benhalasi Jun 2, 2024
284a153
Cleanup
rickie May 30, 2024
070e065
Pair programming
rickie Jun 12, 2024
47e27eb
Merge fixes of inner type decls, enable sorting nested types in one-go
benhalasi Jun 14, 2024
0bc5f94
fixup! Merge fixes of inner type decls, enable sorting nested types i…
benhalasi Dec 7, 2024
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
Reproduce syntactically wrong replacement with annotations containing…
… `LBRACE`
  • Loading branch information
benhalasi committed Dec 4, 2024
commit d0b94795cf00a33dd0a912ffbed3b1342c39620f
Original file line number Diff line number Diff line change
Expand Up @@ -315,4 +315,38 @@ void replacementDanglingComments() {
"}")
.doTest(TestMode.TEXT_MATCH);
}

@Test
void replacementComplexAnnotation() {
BugCheckerRefactoringTestHelper.newInstance(TypeMemberOrder.class, getClass())
.addInputLines(
"A.java",
"final class A {",
"",
" @interface AnnotationWithClassReferences {",
" Class<?>[] value() default {};",
" }",
"",
" @AnnotationWithClassReferences({Object.class})",
" class InnerClass {",
" String bar;",
" private static final int foo = 1;",
" }",
"}")
.addOutputLines(
"A.java",
"final class A {",
"",
" @interface AnnotationWithClassReferences {",
" Class<?>[] value() default {};",
" }",
"",
" @AnnotationWithClassReferences({Object.class})",
" class InnerClass {",
" private static final int foo = 1;",
" String bar;",
" }",
"}")
.doTest(TestMode.TEXT_MATCH);
}
}