Skip to content

Commit

Permalink
minor fix-ups
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-milles committed Sep 23, 2019
1 parent c80b1f7 commit dc9f757
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ else if (existsOnlyInGroovyModel(node.getField(), name, declaringType, jdtDeclar
Parameter[] parameters = null;
if (declaration instanceof MethodNode) {
name = ((MethodNode) declaration).getName();
parameters = Optional.ofNullable(((MethodNode) declaration).getOriginal()).orElse((MethodNode) declaration).getParameters();
parameters = ((MethodNode) declaration).getOriginal().getParameters();
}
maybeRequested = findElement(jdtDeclaringType, name, parameters);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -17,7 +17,6 @@

import java.util.Comparator;
import java.util.Map;
import java.util.Optional;
import java.util.TreeMap;

import org.codehaus.groovy.ast.ASTNode;
Expand Down Expand Up @@ -110,8 +109,9 @@ private boolean isEquivalent(ASTNode maybeDeclaration) {
return maybeField.getName().equals(field.getName()) && maybeField.getDeclaringClass().equals(field.getDeclaringClass());
} else if (maybeDeclaration instanceof MethodNode && declaration instanceof MethodNode) {
MethodNode maybeMethod = (MethodNode) maybeDeclaration, method = (MethodNode) declaration;
return maybeMethod.getName().equals(method.getName()) && maybeMethod.getDeclaringClass().equals(method.getDeclaringClass()) &&
checkParams(Optional.ofNullable(maybeMethod.getOriginal()).orElse(maybeMethod).getParameters(), method.getParameters());
return maybeMethod.getName().equals(method.getName()) &&
maybeMethod.getDeclaringClass().equals(method.getDeclaringClass()) &&
checkParams(maybeMethod.getOriginal().getParameters(), method.getParameters());
}
// check for inner class nodes
if ((maybeDeclaration instanceof InnerClassNode && declaration instanceof JDTClassNode) ||
Expand Down

0 comments on commit dc9f757

Please sign in to comment.