@Override public ILocalVariable[] getParameters() throws JavaModelException { ILocalVariable[] arguments = ((SourceMethodElementInfo) getElementInfo()).arguments; if (arguments == null) return LocalVariable.NO_LOCAL_VARIABLES; return arguments; } /**
/** * @see JavaElement#getHandleMemento(StringBuffer) */ protected void getHandleMemento(StringBuffer buff) { ((JavaElement) getParent()).getHandleMemento(buff); char delimiter = getHandleMementoDelimiter(); buff.append(delimiter); escapeMementoName(buff, getElementName()); for (int i = 0; i < this.parameterTypes.length; i++) { buff.append(delimiter); escapeMementoName(buff, this.parameterTypes[i]); } if (this.occurrenceCount > 1) { buff.append(JEM_COUNT); buff.append(this.occurrenceCount); } } /**
/** * @see IMethod#isSimilar(IMethod) */ @Override public boolean isSimilar(IMethod method) { return areSimilarMethods( getElementName(), getParameterTypes(), method.getElementName(), method.getParameterTypes(), null); }
/** * @see IMethod */ public boolean isConstructor() throws JavaModelException { if (!getElementName().equals(this.parent.getElementName())) { // faster than reaching the info return false; } SourceMethodElementInfo info = (SourceMethodElementInfo) getElementInfo(); return info.isConstructor(); } /**
method.selector = methodHandle.getElementName().toCharArray(); boolean isVarargs = (modifiers & ClassFileConstants.AccVarargs) != 0; method.modifiers = modifiers & ~ClassFileConstants.AccVarargs; String[] argumentTypeSignatures = methodHandle.getParameterTypes(); char[][] argumentNames = methodInfo.getArgumentNames(); int argumentCount = argumentTypeSignatures == null ? 0 : argumentTypeSignatures.length; if (argumentCount > 0) { ILocalVariable[] parameters = methodHandle.getParameters(); long position = ((long) start << 32) + end; method.arguments = new Argument[argumentCount];
protected void toStringName(StringBuffer buffer, int flags) { buffer.append(getElementName()); buffer.append('('); String[] parameters = getParameterTypes(); int length; if (parameters != null && (length = parameters.length) > 0) {
extraConstructor = needConstructor ? 1 : 0; for (int i = 0; i < sourceMethodCount; i++) { if (sourceMethods[i].isConstructor()) { if (needConstructor) { extraConstructor = 0; // Does not need the extra constructor since one constructor already exists. for (int i = 0; i < sourceMethodCount; i++) { SourceMethod sourceMethod = sourceMethods[i]; SourceMethodElementInfo methodInfo = (SourceMethodElementInfo)sourceMethod.getElementInfo(); boolean isConstructor = methodInfo.isConstructor(); if ((methodInfo.getModifiers() & ClassFileConstants.AccAbstract) != 0) {
/** * @see IType#getMethod */ public IMethod getMethod(String selector, String[] parameterTypeSignatures) { return new SourceMethod(this, selector, parameterTypeSignatures); } /**
public String getKey() { try { return getKey(this, false/*don't open*/); } catch (JavaModelException e) { // happen only if force open is true return null; } } /**
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 {
method.selector = methodHandle.getElementName().toCharArray(); boolean isVarargs = (modifiers & ClassFileConstants.AccVarargs) != 0; method.modifiers = modifiers & ~ClassFileConstants.AccVarargs; String[] argumentTypeSignatures = methodHandle.getParameterTypes(); char[][] argumentNames = methodInfo.getArgumentNames(); int argumentCount = argumentTypeSignatures == null ? 0 : argumentTypeSignatures.length; if (argumentCount > 0) { ILocalVariable[] parameters = methodHandle.getParameters(); long position = ((long) start << 32) + end; method.arguments = new Argument[argumentCount];
protected void toStringName(StringBuffer buffer, int flags) { buffer.append(getElementName()); buffer.append('('); String[] parameters = getParameterTypes(); int length; if (parameters != null && (length = parameters.length) > 0) {
extraConstructor = needConstructor ? 1 : 0; for (int i = 0; i < sourceMethodCount; i++) { if (sourceMethods[i].isConstructor()) { if (needConstructor) { extraConstructor = 0; // Does not need the extra constructor since one constructor already exists. for (int i = 0; i < sourceMethodCount; i++) { SourceMethod sourceMethod = sourceMethods[i]; SourceMethodElementInfo methodInfo = (SourceMethodElementInfo)sourceMethod.getElementInfo(); boolean isConstructor = methodInfo.isConstructor(); if ((methodInfo.getModifiers() & ClassFileConstants.AccAbstract) != 0) {
/** * @see IMethod */ public boolean isConstructor() throws JavaModelException { if (!getElementName().equals(this.parent.getElementName())) { // faster than reaching the info return false; } SourceMethodElementInfo info = (SourceMethodElementInfo) getElementInfo(); return info.isConstructor(); } /**
/** * @see IType#getMethod */ @Override public IMethod getMethod(String selector, String[] parameterTypeSignatures) { return new SourceMethod(this, selector, parameterTypeSignatures); } /**
@Override public String getKey() { try { return getKey(this, false/*don't open*/); } catch (JavaModelException e) { // happen only if force open is true return null; } } /**
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 JavaElement#getHandleMemento(StringBuffer) */ @Override protected void getHandleMemento(StringBuffer buff) { ((JavaElement) getParent()).getHandleMemento(buff); char delimiter = getHandleMementoDelimiter(); buff.append(delimiter); escapeMementoName(buff, getElementName()); for (int i = 0; i < this.parameterTypes.length; i++) { buff.append(delimiter); escapeMementoName(buff, this.parameterTypes[i]); } if (this.occurrenceCount > 1) { buff.append(JEM_COUNT); buff.append(this.occurrenceCount); } } /**
/** * @see IMethod#isSimilar(IMethod) */ public boolean isSimilar(IMethod method) { return areSimilarMethods( getElementName(), getParameterTypes(), method.getElementName(), method.getParameterTypes(), null); }
method.selector = methodHandle.getElementName().toCharArray(); boolean isVarargs = (modifiers & ClassFileConstants.AccVarargs) != 0; method.modifiers = modifiers & ~ClassFileConstants.AccVarargs; String[] argumentTypeSignatures = methodHandle.getParameterTypes(); char[][] argumentNames = methodInfo.getArgumentNames(); int argumentCount = argumentTypeSignatures == null ? 0 : argumentTypeSignatures.length; if (argumentCount > 0) { ILocalVariable[] parameters = methodHandle.getParameters(); long position = ((long) start << 32) + end; method.arguments = new Argument[argumentCount];