diff --git a/src/main/java/spoon/support/compiler/jdt/ContextBuilder.java b/src/main/java/spoon/support/compiler/jdt/ContextBuilder.java index 12d86fca5d0..896b59386df 100644 --- a/src/main/java/spoon/support/compiler/jdt/ContextBuilder.java +++ b/src/main/java/spoon/support/compiler/jdt/ContextBuilder.java @@ -195,8 +195,9 @@ CtVariable getVariableDeclaration(final String name) { final CtVariable variable = this.>getVariableDeclaration(name, null); if (variable == null) { // note: this happens when using the new try(vardelc) structure - this.jdtTreeBuilder.getLogger().error( - format("Could not find declaration for variable %s at %s", + // note: this can happen when identifier is not a variable name but e.g. a Type name. + this.jdtTreeBuilder.getLogger().debug( + format("Could not find declaration for variable %s at %s.", name, stack.peek().element.getPosition())); } return variable;