public ReturnTypeVariable2(TType type, IMethodBinding binding) { super(type); fKey= binding.getKey(); }
@Override public ReturnTypeVariable makeReturnTypeVariable(IMethodBinding methodBinding) { String key= methodBinding.getKey(); if (!fReturnVariableMap.containsKey(key)){ fReturnVariableMap.put(key, new ReturnTypeVariable(methodBinding)); if (REPORT) nrCreated++; } else { if (REPORT) nrRetrieved++; } if (REPORT) dumpConstraintStats(); return fReturnVariableMap.get(key); }
public ParameterTypeVariable2(TType type, int index, IMethodBinding binding) { super(type); Assert.isNotNull(binding); Assert.isTrue(0 <= index); fParameterIndex= index; fKey= binding.getKey(); }
ReturnAnnotationRewriteOperation(CompilationUnit unit, MethodDeclaration method, String annotationToAdd, String annotationToRemove, boolean allowRemove, String message) { fUnit= unit; fKey= method.resolveBinding().getKey() + "<return>"; //$NON-NLS-1$ fBodyDeclaration= method; fAnnotationToAdd= annotationToAdd; fAnnotationToRemove= annotationToRemove; fAllowRemove= allowRemove; fMessage= message; }
@Override public ReturnTypeVariable makeReturnTypeVariable(IMethodBinding methodBinding) { String key= methodBinding.getKey(); if (!fReturnVariableMap.containsKey(key)){ fReturnVariableMap.put(key, new ReturnTypeVariable(methodBinding)); if (REPORT) nrCreated++; } else { if (REPORT) nrRetrieved++; } if (REPORT) dumpConstraintStats(); return fReturnVariableMap.get(key); }
ReturnAnnotationRewriteOperation(MethodDeclaration method, String message, Builder builder) { super(builder); fKey= method.resolveBinding().getKey() + "<return>"; //$NON-NLS-1$ fBodyDeclaration= method; fMessage= message; }
public ParameterTypeVariable makeParameterTypeVariable(IMethodBinding methodBinding, int parameterIndex) { String key= methodBinding.getKey() + parameterIndex; if (! fParameterMap.containsKey(key)){ fParameterMap.put(key, new ParameterTypeVariable(methodBinding, parameterIndex)); if (REPORT) nrCreated++; } else { if (REPORT) nrRetrieved++; } if (REPORT) dumpConstraintStats(); return (ParameterTypeVariable)fParameterMap.get(key); }
public ReturnTypeVariable makeReturnTypeVariable(IMethodBinding methodBinding) { String key= methodBinding.getKey(); if (!fReturnVariableMap.containsKey(key)){ fReturnVariableMap.put(key, new ReturnTypeVariable(methodBinding)); if (REPORT) nrCreated++; } else { if (REPORT) nrRetrieved++; } if (REPORT) dumpConstraintStats(); return (ReturnTypeVariable)fReturnVariableMap.get(key); }
public ParameterTypeVariable2(TType type, int index, IMethodBinding binding) { super(type); Assert.isNotNull(binding); Assert.isTrue(0 <= index); fParameterIndex= index; fKey= binding.getKey(); }
@Override public DeclaringTypeVariable makeDeclaringTypeVariable(IMethodBinding methodBinding) { String key= methodBinding.getKey(); if (! fDeclaringTypeVariableMap.containsKey(key)){ fDeclaringTypeVariableMap.put(key, new DeclaringTypeVariable(methodBinding)); if (REPORT) nrCreated++; } else { if (REPORT) nrRetrieved++; } if (REPORT) dumpConstraintStats(); return fDeclaringTypeVariableMap.get(key); }
public ParameterTypeVariable2(TType type, int index, IMethodBinding binding) { super(type); Assert.isNotNull(binding); Assert.isTrue(0 <= index); fParameterIndex= index; fKey= binding.getKey(); }
private ParameterAnnotationRewriteOperation(IMethodBinding methodBinding, List<?> parameters, int paramIdx, String message, Builder builder) { super(builder); fKey= methodBinding.getKey(); fArgument= (SingleVariableDeclaration) parameters.get(paramIdx); fParameterRank= paramIdx; fKey+= fArgument.getName().getIdentifier(); fMessage= message; }
public MethodReference getMethodRef(IMethodBinding met) { if (!fMethodMap.containsKey(met.getKey())) { // create one TypeName ownerType = TypeName.string2TypeName(typeToTypeID(met.getDeclaringClass())); TypeReference ownerTypeRef = TypeReference.findOrCreate(fClassLoaderRef, ownerType); MethodReference ref = MethodReference.findOrCreate(ownerTypeRef, selectorForMethod(met)); fMethodMap.put(met.getKey(), ref); return ref; } return fMethodMap.get(met.getKey()); }
/** * Returns true iff the selected constructor can be protected. * @return return <code>true</code> if the constructor can be made protected */ public boolean canProtectConstructor() { return !fCtorBinding.isSynthetic() && fFactoryCU.findDeclaringNode(fCtorBinding.getKey()) != null; }
/** * Returns true iff the selected constructor can be protected. * @return return <code>true</code> if the constructor can be made protected */ public boolean canProtectConstructor() { return !fCtorBinding.isSynthetic() && fFactoryCU.findDeclaringNode(fCtorBinding.getKey()) != null; }
/** * Returns true iff the selected constructor can be protected. */ public boolean canProtectConstructor() { return !fCtorBinding.isSynthetic() && fFactoryCU.findDeclaringNode(fCtorBinding.getKey()) != null; }
/** * Answer the give method's signature in class file format. * @param methodBinding binding representing a method * @return a signature in class file format */ public static String extractGenericSignature(IMethodBinding methodBinding) { // Note that IMethodBinding.binding is not accessible, hence we need to recover the signature from the key: KeyToSignature parser = new KeyToSignature(methodBinding.getKey(), KeyToSignature.SIGNATURE, true); parser.parse(); return parser.toString(); }
/** * Answer the give method's signature in class file format. * @param methodBinding binding representing a method * @return a signature in class file format */ public static String extractGenericSignature(IMethodBinding methodBinding) { // Note that IMethodBinding.binding is not accessible, hence we need to recover the signature from the key: KeyToSignature parser = new KeyToSignature(methodBinding.getKey(), KeyToSignature.SIGNATURE, true); parser.parse(); return parser.toString(); }
/** * Answer the give method's signature in class file format. * @param methodBinding binding representing a method * @return a signature in class file format */ public static String extractGenericSignature(IMethodBinding methodBinding) { // Note that IMethodBinding.binding is not accessible, hence we need to recover the signature from the key: KeyToSignature parser = new KeyToSignature(methodBinding.getKey(), KeyToSignature.SIGNATURE, true); parser.parse(); return parser.toString(); }
/** * Creates and adds the necessary change to make the constructor method protected. * Returns false iff the constructor didn't exist (i.e. was implicit) */ private boolean protectConstructor(CompilationUnit unitAST, ASTRewrite unitRewriter, TextEditGroup declGD) { MethodDeclaration constructor= (MethodDeclaration) unitAST.findDeclaringNode(fCtorBinding.getKey()); // No need to rewrite the modifiers if the visibility is what we already want it to be. if (constructor == null || (JdtFlags.getVisibilityCode(constructor)) == fConstructorVisibility) return false; ModifierRewrite.create(unitRewriter, constructor).setVisibility(fConstructorVisibility, declGD); return true; }