Skip to content

Commit 5053a54

Browse files
authored
fix: avoid unnecessary downcast in ReferenceBuilder (#6162)
1 parent 9bc5e7c commit 5053a54

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/spoon/support/compiler/jdt/ReferenceBuilder.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
package spoon.support.compiler.jdt;
99

1010
import org.eclipse.jdt.core.compiler.CharOperation;
11+
import org.eclipse.jdt.internal.compiler.Compiler;
1112
import org.eclipse.jdt.internal.compiler.ast.ASTNode;
1213
import org.eclipse.jdt.internal.compiler.ast.AllocationExpression;
1314
import org.eclipse.jdt.internal.compiler.ast.Annotation;
@@ -285,7 +286,7 @@ <T> CtTypeReference<T> getQualifiedTypeReference(char[][] tokens, TypeBinding re
285286
if (enclosingType != null && Collections.disjoint(PUBLIC_PROTECTED, JDTTreeBuilderQuery.getModifiers(enclosingType.modifiers, false, ModifierTarget.NONE))) {
286287
String access = "";
287288
int i = 0;
288-
final CompilationUnitDeclaration[] units = ((TreeBuilderCompiler) this.jdtTreeBuilder.getContextBuilder().compilationunitdeclaration.scope.environment.typeRequestor).unitsToProcess;
289+
final CompilationUnitDeclaration[] units = ((Compiler) this.jdtTreeBuilder.getContextBuilder().compilationunitdeclaration.scope.environment.typeRequestor).unitsToProcess;
289290
for (; i < tokens.length; i++) {
290291
final char[][] qualified = Arrays.copyOfRange(tokens, 0, i + 1);
291292
if (searchPackage(qualified, units) == null) {

0 commit comments

Comments
 (0)