Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
luiscruz committed Nov 29, 2016
1 parent d8b2aa2 commit 52183d4
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,9 @@ public OnDrawTransformer(RefactoringContext ctx, MethodDeclaration onDrawDeclara
this.onDrawDeclaration = onDrawDeclaration;
}

public boolean isMethodBindingSubclassOf(ITypeBinding typeBinding, List<String> superClassStrings) {
public boolean isTypeBindingSubclassOf(ITypeBinding typeBinding, List<String> superClassStrings) {
ITypeBinding superClass = typeBinding;
ITypeBinding objectType = ctx.getAST().resolveWellKnownType("java.lang.Object");
while (superClass != null && !superClass.equals(objectType)) {
while (superClass != null) {
if (superClassStrings.contains(superClass.getErasure().getName())) {
return true;
}
Expand All @@ -108,7 +107,7 @@ public boolean visit(VariableDeclarationFragment node) {
final ASTBuilder b = this.ctx.getASTBuilder();
final Refactorings r = this.ctx.getRefactorings();
// Deal with collections
if (isMethodBindingSubclassOf(node.getName().resolveTypeBinding(),
if (isTypeBindingSubclassOf(node.getName().resolveTypeBinding(),
Arrays.asList("AbstractCollection", "Collection", "List", "AbstractMap", "Map"))) {
// It should only works with allocations of
// empty collections.
Expand Down

0 comments on commit 52183d4

Please sign in to comment.