private static boolean isArgNumber(String paramName, IMethod method) { if (method.isBinary()) { // check param name is not arg0, arg1, etc if (paramName.length() > 3 && paramName.startsWith("arg")) { try { Integer.parseInt(paramName.substring(3, paramName.length())); return true; } catch (Exception e) { } } } return false; } }
private boolean checkOverriddenBinaryMethods() { if (fMethodBinding != null){ Set<ITypeBinding> declaringSupertypes= getDeclaringSuperTypes(fMethodBinding); for (Iterator<ITypeBinding> iter= declaringSupertypes.iterator(); iter.hasNext();) { ITypeBinding superType= iter.next(); IMethodBinding overriddenMethod= findMethod(fMethodBinding, superType); Assert.isNotNull(overriddenMethod);//because we asked for declaring types IMethod iMethod= (IMethod) overriddenMethod.getJavaElement(); if (iMethod.isBinary()){ return true; } } } return false; }
private boolean checkOverriddenBinaryMethods() throws JavaModelException { if (fMethodBinding != null){ Set declaringSupertypes= getDeclaringSuperTypes(fMethodBinding); for (Iterator iter= declaringSupertypes.iterator(); iter.hasNext();) { ITypeBinding superType= (ITypeBinding) iter.next(); IMethodBinding overriddenMethod= findMethod(fMethodBinding, superType); Assert.isNotNull(overriddenMethod);//because we asked for declaring types IMethod iMethod= (IMethod) overriddenMethod.getJavaElement(); if (iMethod.isBinary()){ return true; } } } return false; }
/** * Returns parameters names for the given method, or * null if no parameter names are known for the method. */ public char[][] getMethodParameterNames(IMethod method) { if (method.isBinary()) { IJavaElement[] el = getUnqualifiedMethodHandle(method, false); if(el[1] != null && this.parameterNames.get(el[0]) == null) { method = (IMethod) getUnqualifiedMethodHandle(method, true)[0]; } else { method = (IMethod) el[0]; } } char[][] parameters = (char[][]) this.parameterNames.get(method); if (parameters == null) { return null; } else { return parameters; } }
/** * Returns parameters names for the given method, or * null if no parameter names are known for the method. */ public char[][] getMethodParameterNames(IMethod method) { if (method.isBinary()) { IJavaElement[] el = getUnqualifiedMethodHandle(method, false); if(el[1] != null && this.parameterNames.get(el[0]) == null) { method = (IMethod) getUnqualifiedMethodHandle(method, true)[0]; } else { method = (IMethod) el[0]; } } char[][] parameters = (char[][]) this.parameterNames.get(method); if (parameters == null) { return null; } else { return parameters; } }
/** * Returns parameters names for the given method, or * null if no parameter names are known for the method. */ public char[][] getMethodParameterNames(IMethod method) { if (method.isBinary()) { IJavaElement[] el = getUnqualifiedMethodHandle(method, false); if(el[1] != null && this.parameterNames.get(el[0]) == null) { method = (IMethod) getUnqualifiedMethodHandle(method, true)[0]; } else { method = (IMethod) el[0]; } } char[][] parameters = (char[][]) this.parameterNames.get(method); if (parameters == null) { return null; } else { return parameters; } }
private boolean checkOverriddenBinaryMethods() { if (fMethodBinding != null){ Set<ITypeBinding> declaringSupertypes= getDeclaringSuperTypes(fMethodBinding); for (Iterator<ITypeBinding> iter= declaringSupertypes.iterator(); iter.hasNext();) { ITypeBinding superType= iter.next(); IMethodBinding overriddenMethod= findMethod(fMethodBinding, superType); Assert.isNotNull(overriddenMethod);//because we asked for declaring types IMethod iMethod= (IMethod) overriddenMethod.getJavaElement(); if (iMethod.isBinary()){ return true; } } } return false; }
public static boolean isInlineMethodAvailable(IMethod method) throws JavaModelException { if (method == null) return false; if (!method.exists()) return false; if (!method.isStructureKnown()) return false; if (!method.isBinary()) return true; if (method.isConstructor()) return false; return SourceRange.isAvailable(method.getNameRange()); }
@Override public final boolean isApplicable() throws CoreException { return fMethod.exists() && !fMethod.isConstructor() && !fMethod.isBinary() && !fMethod.isReadOnly() && fMethod.getCompilationUnit() != null && !JdtFlags.isStatic(fMethod); }
@Override public final boolean isApplicable() throws CoreException { return fMethod.exists() && !fMethod.isConstructor() && !fMethod.isBinary() && !fMethod.isReadOnly() && fMethod.getCompilationUnit() != null && !JdtFlags.isStatic(fMethod); }
public final boolean isApplicable() throws CoreException { return fMethod.exists() && !fMethod.isConstructor() && !fMethod.isBinary() && !fMethod.isReadOnly() && fMethod.getCompilationUnit() != null && !JdtFlags.isStatic(fMethod); }
public static boolean isInlineMethodAvailable(IMethod method) throws JavaModelException { if (method == null) return false; if (!method.exists()) return false; if (!method.isStructureKnown()) return false; if (!method.isBinary()) return true; if (method.isConstructor()) return false; return SourceRange.isAvailable(method.getNameRange()); }
public static boolean isInlineMethodAvailable(IMethod method) throws JavaModelException { if (method == null) return false; if (!method.exists()) return false; if (!method.isStructureKnown()) return false; if (!method.isBinary()) return true; if (method.isConstructor()) return false; return SourceRange.isAvailable(method.getNameRange()); }
public static boolean isInlineMethodAvailable(IMethod method) throws JavaModelException { if (method == null) { return false; } if (!method.exists()) { return false; } if (!method.isStructureKnown()) { return false; } if (!method.isBinary()) { return true; } if (method.isConstructor()) { return false; } return SourceRange.isAvailable(method.getNameRange()); }
public static boolean isMoveMethodAvailable(final IMethod method) throws JavaModelException { return method.exists() && !method.isConstructor() && !method.isBinary() && !method.isReadOnly() && !JdtFlags.isStatic(method) && (JdtFlags.isDefaultMethod(method) || !method.getDeclaringType().isInterface()); }
public static boolean isMoveMethodAvailable(final IMethod method) throws JavaModelException { return method.exists() && !method.isConstructor() && !method.isBinary() && !method.getDeclaringType().isAnnotation() && !method.isReadOnly() && !JdtFlags.isStatic(method); }
public static boolean isMoveMethodAvailable(final IMethod method) throws JavaModelException { return method.exists() && !method.isConstructor() && !method.isBinary() && !method.isReadOnly() && !JdtFlags.isStatic(method) && (JdtFlags.isDefaultMethod(method) || !method.getDeclaringType().isInterface()); }
public static boolean isMoveMethodAvailable(final IMethod method) throws JavaModelException { return method.exists() && !method.isConstructor() && !method.isBinary() && !method.isReadOnly() && !JdtFlags.isStatic(method) && (JdtFlags.isDefaultMethod(method) || !method.getDeclaringType().isInterface()); }
/** * Constructs a step handler to step into the given method in the given thread * starting from the given stack frame. */ public StepIntoSelectionHandler(IJavaThread thread, IJavaStackFrame frame, IMethod method) { fMethod = method; fThread = thread; try { fOriginalName = frame.getName(); fOriginalSignature = frame.getSignature(); fOriginalTypeName = frame.getDeclaringTypeName(); if (method.isBinary()) { fResolvedSignature = method.getSignature(); } else { fResolvedSignature = ToggleBreakpointAdapter.resolveMethodSignature(method.getDeclaringType(), method.getSignature()); } } catch (CoreException e) { JDIDebugUIPlugin.log(e); } }
private RefactoringStatus checkRelatedMethods() throws CoreException { RefactoringStatus result= new RefactoringStatus(); for (Iterator<IMethod> iter= fMethodsToRename.iterator(); iter.hasNext(); ) { IMethod method= iter.next(); result.merge(Checks.checkIfConstructorName(method, getNewElementName(), method.getDeclaringType().getElementName())); String[] msgData= new String[]{BasicElementLabels.getJavaElementName(method.getElementName()), BasicElementLabels.getJavaElementName(method.getDeclaringType().getFullyQualifiedName('.'))}; if (! method.exists()){ result.addFatalError(Messages.format(RefactoringCoreMessages.RenameMethodRefactoring_not_in_model, msgData)); continue; } if (method.isBinary()) result.addFatalError(Messages.format(RefactoringCoreMessages.RenameMethodRefactoring_no_binary, msgData)); if (method.isReadOnly()) result.addFatalError(Messages.format(RefactoringCoreMessages.RenameMethodRefactoring_no_read_only, msgData)); if (JdtFlags.isNative(method)) result.addError(Messages.format(RefactoringCoreMessages.RenameMethodRefactoring_no_native_1, msgData)); } return result; }