public static boolean isVarargs(IMethod method) throws JavaModelException{ return Flags.isVarargs(method.getFlags()); }
public static boolean isVarargs(IMethod method) throws JavaModelException{ return Flags.isVarargs(method.getFlags()); }
public static boolean isDefaultMethod(IMethod method) throws JavaModelException { return Flags.isDefaultMethod(method.getFlags()); }
public static boolean isVarargs(IMethod method) throws JavaModelException{ return Flags.isVarargs(method.getFlags()); }
private boolean isStaticTarget() throws JavaModelException { return Flags.isStatic(fTargetMethod.getFlags()); }
public static boolean isVarargs(IMethod method) throws JavaModelException{ return Flags.isVarargs(method.getFlags()); }
public static boolean isDefaultMethod(IMethod method) throws JavaModelException { return Flags.isDefaultMethod(method.getFlags()); }
private boolean isStaticTarget() throws JavaModelException { return Flags.isStatic(fTargetMethod.getFlags()); }
public static boolean isDefaultMethod(IMethod method) throws JavaModelException { return Flags.isDefaultMethod(method.getFlags()); }
private boolean isStaticTarget() throws JavaModelException { return Flags.isStatic(fTargetMethod.getFlags()); }
@Override public boolean isTestMethod(IMethod method) { try { final int flags = method.getFlags(); return Flags.isPublic(flags) && super.isTestMethod(method); } catch (final JavaModelException e) { // ignore return false; } } }
public void acceptSearchMatch(SearchMatch match) throws CoreException { Object enclosingElement= match.getElement(); if (!(enclosingElement instanceof IMethod)) return; IMethod method= (IMethod) enclosingElement; if (!Flags.isStatic(method.getFlags()) || !Flags.isPublic(method.getFlags())) { return; } IType declaringType= ((IMethod) enclosingElement).getDeclaringType(); if (!CoreTestSearchEngine.isAccessibleClass(declaringType)) { return; } fResult.add(declaringType); } }
private static boolean isValueAccessor(IMethod method) throws JavaModelException { if (!"getString".equals(method.getElementName())) //$NON-NLS-1$ return false; int flags= method.getFlags(); if (!Modifier.isStatic(flags) || !Modifier.isPublic(flags)) return false; String returnType= method.getReturnType(); if (!JAVA_LANG_STRING.equals(returnType)) return false; String[] parameters= method.getParameterTypes(); if (parameters.length != 1 || !JAVA_LANG_STRING.equals(parameters[0])) return false; return true; }
public static boolean hasSuiteMethod(IType type) throws JavaModelException { IMethod method= type.getMethod("suite", new String[0]); //$NON-NLS-1$ if (!method.exists()) return false; if (!Flags.isStatic(method.getFlags()) || !Flags.isPublic(method.getFlags())) { return false; } if (!Signature.getSimpleName(Signature.toString(method.getReturnType())).equals(JUnitCorePlugin.SIMPLE_TEST_INTERFACE_NAME)) { return false; } return true; }
@Override public boolean isMethodOK(IMethod method) throws JavaModelException { return Flags.isPublic(method.getFlags()) && method.getParameterTypes().length == 0 && "java.lang.String".equals(JavaModelUtil.getResolvedTypeName(method.getReturnType(), type)); //$NON-NLS-1$ } });
public static boolean hasSuiteMethod(IType type) throws JavaModelException { IMethod method= type.getMethod("suite", new String[0]); //$NON-NLS-1$ if (!method.exists()) return false; if (!Flags.isStatic(method.getFlags()) || !Flags.isPublic(method.getFlags())) { return false; } if (!Signature.getSimpleName(Signature.toString(method.getReturnType())).equals(JUnitCorePlugin.SIMPLE_TEST_INTERFACE_NAME)) { return false; } return true; }
@Override public boolean isMethodOK(IMethod method) throws JavaModelException { return Flags.isPublic(method.getFlags()) && method.getParameterTypes().length == 0 && "java.lang.String".equals(JavaModelUtil.getResolvedTypeName(method.getReturnType(), type)); //$NON-NLS-1$ } });
public static boolean isMethod(IMethod method, boolean onlyPublicMethod) { try { int flags = method.getFlags(); if (onlyPublicMethod && !Flags.isPublic(flags)) { return false; } // 'V' is void signature return !(method.isConstructor() || Flags.isAbstract(flags) || Flags.isStatic(flags) || !"V".equals(method.getReturnType())); } catch (JavaModelException e) { // ignore return false; } }
protected int getDescriptorFlags() { int flags= JavaRefactoringDescriptor.JAR_MIGRATION | JavaRefactoringDescriptor.JAR_REFACTORING | RefactoringDescriptor.STRUCTURAL_CHANGE; try { if (!Flags.isPrivate(fMethod.getFlags())) flags|= RefactoringDescriptor.MULTI_CHANGE; final IType declaring= fMethod.getDeclaringType(); if (declaring.isAnonymous() || declaring.isLocal()) flags|= JavaRefactoringDescriptor.JAR_SOURCE_ATTACHMENT; } catch (JavaModelException exception) { JavaPlugin.log(exception); } return flags; }
protected int getDescriptorFlags() { int flags= JavaRefactoringDescriptor.JAR_MIGRATION | JavaRefactoringDescriptor.JAR_REFACTORING | RefactoringDescriptor.STRUCTURAL_CHANGE; try { if (!Flags.isPrivate(fMethod.getFlags())) flags|= RefactoringDescriptor.MULTI_CHANGE; final IType declaring= fMethod.getDeclaringType(); if (declaring.isAnonymous() || declaring.isLocal()) flags|= JavaRefactoringDescriptor.JAR_SOURCE_ATTACHMENT; } catch (JavaModelException exception) { JavaPlugin.log(exception); } return flags; }