private IJavaElement createMethodHandle(IType type, String methodName, String[] parameterTypeSignatures) { IMethod methodHandle = type.getMethod(methodName, parameterTypeSignatures); if (methodHandle instanceof SourceMethod) { while (this.methodHandles.contains(methodHandle)) { ((SourceMethod) methodHandle).occurrenceCount++; } } this.methodHandles.add(methodHandle); return methodHandle; } /**
private IJavaElement createMethodHandle(IType type, String methodName, String[] parameterTypeSignatures) { IMethod methodHandle = type.getMethod(methodName, parameterTypeSignatures); if (methodHandle instanceof SourceMethod) { while (this.methodHandles.contains(methodHandle)) { ((SourceMethod) methodHandle).occurrenceCount++; } } this.methodHandles.add(methodHandle); return methodHandle; } /**
private IJavaElement createMethodHandle(IType type, String methodName, String[] parameterTypeSignatures) { IMethod methodHandle = type.getMethod(methodName, parameterTypeSignatures); if (methodHandle instanceof SourceMethod) { while (this.methodHandles.contains(methodHandle)) { ((SourceMethod) methodHandle).occurrenceCount++; } } this.methodHandles.add(methodHandle); return methodHandle; } /**
private IMethod getMethodInWorkingCopy(IMethod method, String elementName, IType typeWc) { String[] paramTypeSignatures= method.getParameterTypes(); return typeWc.getMethod(elementName, paramTypeSignatures); }
public void consumeMethod(char[] selector, char[] signature) { if (!(this.element instanceof IType)) return; String[] parameterTypes = Signature.getParameterTypes(new String(signature)); IType type = (IType) this.element; IMethod method = type.getMethod(new String(selector), parameterTypes); IMethod[] methods = type.findMethods(method); if (methods.length > 0) this.element = methods[0]; }
@Override public void consumeMethod(char[] selector, char[] signature) { if (!(this.element instanceof IType)) return; String[] parameterTypes = Signature.getParameterTypes(new String(signature)); IType type = (IType) this.element; IMethod method = type.getMethod(new String(selector), parameterTypes); IMethod[] methods = type.findMethods(method); if (methods.length > 0) this.element = methods[0]; }
@Override protected IMethod transplantHandle(IType parent, IMethod element) { String[] parameterTypes= resolveParameterTypes(element); return parent.getMethod(element.getElementName(), parameterTypes); }
/** * @see CreateElementInCUOperation#generateResultHandle */ protected IJavaElement generateResultHandle() { String[] types = convertASTMethodTypesToSignatures(); String name = getASTNodeName(); return getType().getMethod(name, types); } private String getASTNodeName() {
@Override public IJavaElement getPrimaryElement(boolean checkOwner) { if (checkOwner) { CompilationUnit cu = (CompilationUnit)getAncestor(COMPILATION_UNIT); if (cu.isPrimary()) return this; } IJavaElement primaryParent = this.parent.getPrimaryElement(false); return ((IType)primaryParent).getMethod(this.name, this.parameterTypes); } @Override
/** * @see CreateElementInCUOperation#generateResultHandle */ @Override protected IJavaElement generateResultHandle() { String[] types = convertASTMethodTypesToSignatures(); String name = getASTNodeName(); return getType().getMethod(name, types); } private String getASTNodeName() {
public IJavaElement getPrimaryElement(boolean checkOwner) { if (checkOwner) { CompilationUnit cu = (CompilationUnit)getAncestor(COMPILATION_UNIT); if (cu.isPrimary()) return this; } IJavaElement primaryParent = this.parent.getPrimaryElement(false); return ((IType)primaryParent).getMethod(this.name, this.parameterTypes); } public String[] getRawParameterNames() throws JavaModelException {
public IJavaElement getPrimaryElement(boolean checkOwner) { if (checkOwner) { CompilationUnit cu = (CompilationUnit)getAncestor(COMPILATION_UNIT); if (cu.isPrimary()) return this; } IJavaElement primaryParent = this.parent.getPrimaryElement(false); return ((IType)primaryParent).getMethod(this.name, this.parameterTypes); } public String[] getRawParameterNames() throws JavaModelException {
public IJavaElement getPrimaryElement(boolean checkOwner) { if (checkOwner) { CompilationUnit cu = (CompilationUnit)getAncestor(COMPILATION_UNIT); if (cu.isPrimary()) return this; } IJavaElement primaryParent = this.parent.getPrimaryElement(false); return ((IType)primaryParent).getMethod(this.name, this.parameterTypes); } public String[] getRawParameterNames() throws JavaModelException {
public IJavaElement getPrimaryElement(boolean checkOwner) { if (checkOwner) { CompilationUnit cu = (CompilationUnit)getAncestor(COMPILATION_UNIT); if (cu.isPrimary()) return this; } IJavaElement primaryParent = this.parent.getPrimaryElement(false); return ((IType)primaryParent).getMethod(this.name, this.parameterTypes); } public String[] getRawParameterNames() throws JavaModelException {
/** * @see CreateElementInCUOperation#generateResultHandle */ protected IJavaElement generateResultHandle() { String[] types = convertASTMethodTypesToSignatures(); String name = getASTNodeName(); return getType().getMethod(name, types); } private String getASTNodeName() {
@Override public Object getNewElement() { return fMethod.getDeclaringType().getMethod(getNewElementName(), fMethod.getParameterTypes()); }
/** * @see CreateElementInCUOperation#generateResultHandle */ protected IJavaElement generateResultHandle() { String[] types = convertASTMethodTypesToSignatures(); String name = getASTNodeName(); return getType().getMethod(name, types); } private String getASTNodeName() {
/** * @see CreateElementInCUOperation#generateResultHandle */ protected IJavaElement generateResultHandle() { String[] types = convertASTMethodTypesToSignatures(); String name = getASTNodeName(); return getType().getMethod(name, types); } private String getASTNodeName() {
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; }
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; }