use of org.eclipse.jdt.internal.corext.util.MethodsSourcePositionComparator in project che by eclipse.
the class IntroduceFactoryRefactoring method getUnimplementedMethods.
private IMethodBinding[] getUnimplementedMethods(ITypeBinding binding) {
IMethodBinding[] unimplementedMethods = StubUtility2.getUnimplementedMethods(binding, true);
Arrays.sort(unimplementedMethods, new MethodsSourcePositionComparator(binding));
return unimplementedMethods;
}
use of org.eclipse.jdt.internal.corext.util.MethodsSourcePositionComparator in project che by eclipse.
the class AddUnimplementedMethodsOperation method getUnimplementedMethods.
private IMethodBinding[] getUnimplementedMethods(ASTNode typeNode) {
ITypeBinding binding = null;
boolean implementAbstractsOfInput = false;
if (typeNode instanceof AnonymousClassDeclaration) {
AnonymousClassDeclaration decl = (AnonymousClassDeclaration) typeNode;
binding = decl.resolveBinding();
} else if (typeNode instanceof AbstractTypeDeclaration) {
AbstractTypeDeclaration decl = (AbstractTypeDeclaration) typeNode;
binding = decl.resolveBinding();
} else if (typeNode instanceof EnumConstantDeclaration) {
EnumConstantDeclaration enumConstantDeclaration = (EnumConstantDeclaration) typeNode;
if (enumConstantDeclaration.getAnonymousClassDeclaration() != null) {
binding = enumConstantDeclaration.getAnonymousClassDeclaration().resolveBinding();
} else {
IVariableBinding varBinding = enumConstantDeclaration.resolveVariable();
if (varBinding != null) {
binding = varBinding.getDeclaringClass();
implementAbstractsOfInput = true;
}
}
}
if (binding == null)
return new IMethodBinding[0];
IMethodBinding[] unimplementedMethods = StubUtility2.getUnimplementedMethods(binding, implementAbstractsOfInput);
Arrays.sort(unimplementedMethods, new MethodsSourcePositionComparator(binding));
return unimplementedMethods;
}
Aggregations