Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ public static WhereUsedElement create(CompilationInfo compiler, TreePath tree, b
return create(compiler, tree, null, inTest, inPlatform, inDependency, inImport);
}

@SuppressWarnings({"NestedAssignment", "AssignmentToMethodParameter"})
public static WhereUsedElement create(CompilationInfo compiler, TreePath tree, JavaWhereUsedFilters.ReadWrite access, boolean inTest, boolean inPlatform, boolean inDependency, AtomicBoolean inImport) {
CompilationUnitTree unit = tree.getCompilationUnit();
CharSequence content = compiler.getSnapshot().getText();
Expand Down Expand Up @@ -195,9 +196,7 @@ public static WhereUsedElement create(CompilationInfo compiler, TreePath tree, J
if (TreeUtilities.CLASS_TREE_KINDS.contains(t.getKind())) {
int[] pos = treeUtils.findNameSpan((ClassTree)t);
if (pos == null) {
Tree tr = tree.getParentPath().getLeaf();
if (tr instanceof NewClassTree) {
NewClassTree newClass = (NewClassTree) tr;
if (tree.getParentPath().getLeaf() instanceof NewClassTree newClass) {
start = (int) sp.getStartPosition(unit, newClass.getIdentifier());
end = (int) sp.getEndPosition(unit, newClass.getIdentifier());
} else {
Expand All @@ -207,7 +206,7 @@ public static WhereUsedElement create(CompilationInfo compiler, TreePath tree, J
start = end = (int) sp.getStartPosition(unit, t);
}
// #213723 hotfix, happens for enum values
if(start < 0) {
if(start < 0 || end < 0) {
TreePath parentPath = tree.getParentPath();
if(parentPath != null && (parentPath = parentPath.getParentPath()) != null
&& parentPath.getLeaf().getKind() == Tree.Kind.VARIABLE) {
Expand Down
Loading