From 988b15e1c4edc8545ba21a1e90945d647d497ce7 Mon Sep 17 00:00:00 2001 From: Pavel Vojtechovsky Date: Mon, 22 Oct 2018 20:26:10 +0200 Subject: [PATCH] fix: invalid error log message in ContextBuilder#getVariableDeclaration (#2677) --- src/main/java/spoon/support/compiler/jdt/ContextBuilder.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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;