Skip to content

Commit 3c85270

Browse files
authored
Merge pull request #8423 from mbien/js-embedder-perf-scaling
Fix performance scaling problem in JS-embedder annotation scanner
2 parents 1d08f46 + ba7c010 commit 3c85270

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

Diff for: java/editor.htmlui/src/org/netbeans/modules/editor/htmlui/JSEmbeddingProvider.java

+1-7
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,9 @@ public static void colorizeJSB(final CompilationInfo ci) {
131131
}
132132

133133

134-
135-
136134
private static final class Finder extends TreePathScanner<Void, List<? super LiteralTree>> {
137135

138136
private final Trees trees;
139-
private CompilationUnitTree cu;
140137
private boolean inEmbedding;
141138

142139
Finder(final Trees trees) {
@@ -147,18 +144,15 @@ private static final class Finder extends TreePathScanner<Void, List<? super Lit
147144
public Void visitCompilationUnit(
148145
final CompilationUnitTree unit,
149146
final List<? super LiteralTree> p) {
150-
this.cu = unit;
151147
return super.visitCompilationUnit(unit, p);
152148
}
153149

154-
155-
156150
@Override
157151
public Void visitMethod(
158152
final MethodTree m,
159153
final List<? super LiteralTree> p) {
160154
for (AnnotationTree a : m.getModifiers().getAnnotations()) {
161-
final TypeElement ae = (TypeElement) trees.getElement(TreePath.getPath(cu, a.getAnnotationType()));
155+
TypeElement ae = (TypeElement) trees.getElement(new TreePath(getCurrentPath(), a.getAnnotationType()));
162156
if (ae != null && JS_ANNOTATION.contentEquals(ae.getQualifiedName())) {
163157
final List<? extends ExpressionTree> args = a.getArguments();
164158
for (ExpressionTree kvp : args) {

0 commit comments

Comments
 (0)