Skip to content

Commit

Permalink
fix: avoid unnecessary downcast in ReferenceBuilder (#6162)
Browse files Browse the repository at this point in the history
  • Loading branch information
tdegueul authored Jan 30, 2025
1 parent 9bc5e7c commit 5053a54
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
package spoon.support.compiler.jdt;

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

0 comments on commit 5053a54

Please sign in to comment.