private boolean isAssignmentCompatible(final ITypeBinding targetBinding, final ITypeBinding sourceBinding) { return targetBinding != null && sourceBinding != null && targetBinding.isAssignmentCompatible(sourceBinding); } }
private boolean canAssign(ITypeBinding curr, ITypeBinding best) { return curr.isAssignmentCompatible(best); }
private static boolean canAssign(ITypeBinding returnType, ITypeBinding guessedType) { return returnType.isAssignmentCompatible(guessedType); }
/** * True if the type of the variable is compatible. * * @param targetType The type of the destination. * @param sourceType The type of the node. * * @return true if the type of the variable is compatible. */ protected boolean isTypeCompatible(final ITypeBinding targetType, final ITypeBinding sourceType) { return targetType != null && targetType.isAssignmentCompatible(sourceType); }
private boolean canAssign(ITypeBinding curr, ITypeBinding best) { return curr.isAssignmentCompatible(best); }
private boolean canAssign(ITypeBinding curr, ITypeBinding best) { return curr.isAssignmentCompatible(best); }
private static boolean canAssign(ITypeBinding returnType, ITypeBinding guessedType) { return returnType.isAssignmentCompatible(guessedType); }
private static boolean canAssign(ITypeBinding returnType, ITypeBinding guessedType) { return returnType.isAssignmentCompatible(guessedType); }
private static boolean canAssign(ITypeBinding returnType, ITypeBinding guessedType) { return returnType.isAssignmentCompatible(guessedType); }
private boolean canAssign(ITypeBinding curr, ITypeBinding best) { return curr.isAssignmentCompatible(best); }
private static void updateExceptionsList(List<ITypeBinding> exceptions, ITypeBinding thrownException) { for (Iterator<ITypeBinding> excep = exceptions.iterator(); excep.hasNext();) { ITypeBinding exception = excep.next(); if (exception.isAssignmentCompatible(thrownException)) { excep.remove(); } } }
private static void updateExceptionsList(List<ITypeBinding> exceptions, ITypeBinding thrownException) { for (Iterator<ITypeBinding> excep= exceptions.iterator(); excep.hasNext();) { ITypeBinding exception= excep.next(); if (exception.isAssignmentCompatible(thrownException)) excep.remove(); } }
private static void updateExceptionsList(List<ITypeBinding> exceptions, ITypeBinding thrownException) { for (Iterator<ITypeBinding> excep= exceptions.iterator(); excep.hasNext();) { ITypeBinding exception= excep.next(); if (exception.isAssignmentCompatible(thrownException)) excep.remove(); } }
/** * Return whether the specified type implements java.io.Serializable. */ private static boolean typeImplementsSerializable(ITypeBinding typeBinding, AST ast) { ITypeBinding serializableTypeBinding = ast.resolveWellKnownType(SERIALIZABLE_TYPE_NAME); return typeBinding.isAssignmentCompatible(serializableTypeBinding); }
protected Expression computeProposals(AST ast, ITypeBinding returnBinding, int returnOffset, CompilationUnit root, Expression result) { ScopeAnalyzer analyzer= new ScopeAnalyzer(root); IBinding[] bindings= analyzer.getDeclarationsInScope(returnOffset, ScopeAnalyzer.VARIABLES | ScopeAnalyzer.CHECK_VISIBILITY); for (int i= 0; i < bindings.length; i++) { IVariableBinding curr= (IVariableBinding) bindings[i]; ITypeBinding type= curr.getType(); if (type != null && type.isAssignmentCompatible(returnBinding) && testModifier(curr)) { if (result == null) { result= ast.newSimpleName(curr.getName()); } addLinkedPositionProposal(RETURN_EXPRESSION_KEY, curr.getName(), null); } } return result; }
protected Expression computeProposals(AST ast, ITypeBinding returnBinding, int returnOffset, CompilationUnit root, Expression result) { ScopeAnalyzer analyzer= new ScopeAnalyzer(root); IBinding[] bindings= analyzer.getDeclarationsInScope(returnOffset, ScopeAnalyzer.VARIABLES | ScopeAnalyzer.CHECK_VISIBILITY); for (int i= 0; i < bindings.length; i++) { IVariableBinding curr= (IVariableBinding) bindings[i]; ITypeBinding type= curr.getType(); if (type != null && type.isAssignmentCompatible(returnBinding) && testModifier(curr)) { if (result == null) { result= ast.newSimpleName(curr.getName()); } addLinkedPositionProposal(RETURN_EXPRESSION_KEY, curr.getName(), null); } } return result; }
private static IMethodBinding findGetter(ProposalParameter context) { ITypeBinding returnType= context.variableBinding.getType(); String getterName= GetterSetterUtil.getGetterName(context.variableBinding, context.compilationUnit.getJavaProject(), null, isBoolean(context)); ITypeBinding declaringType= context.variableBinding.getDeclaringClass(); if (declaringType == null) return null; IMethodBinding getter= Bindings.findMethodInHierarchy(declaringType, getterName, new ITypeBinding[0]); if (getter != null && getter.getReturnType().isAssignmentCompatible(returnType) && Modifier.isStatic(getter.getModifiers()) == Modifier.isStatic(context.variableBinding.getModifiers())) return getter; return null; }
private static IMethodBinding findGetter(ProposalParameter context) { ITypeBinding returnType= context.variableBinding.getType(); String getterName= GetterSetterUtil.getGetterName(context.variableBinding, context.compilationUnit.getJavaProject(), null, isBoolean(context)); ITypeBinding declaringType= context.variableBinding.getDeclaringClass(); IMethodBinding getter= Bindings.findMethodInHierarchy(declaringType, getterName, new ITypeBinding[0]); if (getter != null && getter.getReturnType().isAssignmentCompatible(returnType) && Modifier.isStatic(getter.getModifiers()) == Modifier.isStatic(context.variableBinding.getModifiers())) return getter; return null; }
private static IMethodBinding findGetter(ProposalParameter context) { ITypeBinding returnType = context.variableBinding.getType(); String getterName = GetterSetterUtil.getGetterName(context.variableBinding, context.compilationUnit.getJavaProject(), null, isBoolean(context)); ITypeBinding declaringType = context.variableBinding.getDeclaringClass(); if (declaringType == null) { return null; } IMethodBinding getter = Bindings.findMethodInHierarchy(declaringType, getterName, new ITypeBinding[0]); if (getter != null && getter.getReturnType().isAssignmentCompatible(returnType) && Modifier.isStatic(getter.getModifiers()) == Modifier.isStatic(context.variableBinding.getModifiers())) { return getter; } return null; }
private static IMethodBinding findGetter(ProposalParameter context) { ITypeBinding returnType= context.variableBinding.getType(); String getterName= GetterSetterUtil.getGetterName(context.variableBinding, context.compilationUnit.getJavaProject(), null, isBoolean(context)); ITypeBinding declaringType= context.variableBinding.getDeclaringClass(); if (declaringType == null) return null; IMethodBinding getter= Bindings.findMethodInHierarchy(declaringType, getterName, new ITypeBinding[0]); if (getter != null && getter.getReturnType().isAssignmentCompatible(returnType) && Modifier.isStatic(getter.getModifiers()) == Modifier.isStatic(context.variableBinding.getModifiers())) return getter; return null; }