private String getSourceFileName() { if (this.sourceFileName != null) return this.sourceFileName; this.sourceFileName = NO_SOURCE_FILE_NAME; if (this.openable.getSourceMapper() != null) { BinaryType type = (BinaryType) ((ClassFile) this.openable).getType(); ClassFileReader reader = MatchLocator.classFileReader(type); if (reader != null) { String fileName = type.sourceFileName(reader); this.sourceFileName = fileName == null ? NO_SOURCE_FILE_NAME : fileName; } } return this.sourceFileName; } boolean hasSimilarMatch() {
private String getSourceFileName() { if (this.sourceFileName != null) return this.sourceFileName; this.sourceFileName = NO_SOURCE_FILE_NAME; if (this.openable.getSourceMapper() != null) { BinaryType type = (BinaryType) ((ClassFile) this.openable).getType(); ClassFileReader reader = MatchLocator.classFileReader(type); if (reader != null) { String fileName = type.sourceFileName(reader); this.sourceFileName = fileName == null ? NO_SOURCE_FILE_NAME : fileName; } } return this.sourceFileName; } boolean hasSimilarMatch() {
private String getSourceFileName() { if (this.sourceFileName != null) return this.sourceFileName; this.sourceFileName = NO_SOURCE_FILE_NAME; if (this.openable.getSourceMapper() != null) { BinaryType type = (BinaryType) ((ClassFile) this.openable).getType(); ClassFileReader reader = MatchLocator.classFileReader(type); if (reader != null) { String fileName = type.sourceFileName(reader); this.sourceFileName = fileName == null ? NO_SOURCE_FILE_NAME : fileName; } } return this.sourceFileName; } boolean hasSimilarMatch() {
private String getSourceFileName() { if (this.sourceFileName != null) return this.sourceFileName; this.sourceFileName = NO_SOURCE_FILE_NAME; if (this.openable.getSourceMapper() != null) { BinaryType type = (BinaryType) ((ClassFile) this.openable).getType(); ClassFileReader reader = MatchLocator.classFileReader(type); if (reader != null) { String fileName = type.sourceFileName(reader); this.sourceFileName = fileName == null ? NO_SOURCE_FILE_NAME : fileName; } } return this.sourceFileName; } boolean hasSimilarMatch() {
private String getSourceFileName() { if (this.sourceFileName != null) return this.sourceFileName; this.sourceFileName = NO_SOURCE_FILE_NAME; if (this.openable.getSourceMapper() != null) { if (this.openable instanceof ClassFile) { BinaryType type = (BinaryType) ((ClassFile) this.openable).getType(); IBinaryType reader = MatchLocator.classFileReader(type); if (reader != null) { String fileName = type.sourceFileName(reader); this.sourceFileName = fileName == null ? NO_SOURCE_FILE_NAME : fileName; } } else if (this.openable instanceof ModularClassFile) { // FIXME(SHMOD): premature https://bugs.eclipse.org/501162#c31 this.sourceFileName = TypeConstants.MODULE_INFO_FILE_NAME_STRING; } } return this.sourceFileName; } boolean hasSimilarMatch() {
private String getSourceFileName() { if (this.sourceFileName != null) return this.sourceFileName; this.sourceFileName = NO_SOURCE_FILE_NAME; if (this.openable.getSourceMapper() != null) { if (this.openable instanceof ClassFile) { BinaryType type = (BinaryType) ((ClassFile) this.openable).getType(); IBinaryType reader = MatchLocator.classFileReader(type); if (reader != null) { String fileName = type.sourceFileName(reader); this.sourceFileName = fileName == null ? NO_SOURCE_FILE_NAME : fileName; } } else if (this.openable instanceof ModularClassFile) { // FIXME(SHMOD): premature https://bugs.eclipse.org/501162#c31 this.sourceFileName = TypeConstants.MODULE_INFO_FILE_NAME_STRING; } } return this.sourceFileName; } boolean hasSimilarMatch() {
IMethod createBinaryMethodHandle(IType type, char[] methodSelector, char[][] argumentTypeNames) { IBinaryType reader = MatchLocator.classFileReader(type); if (reader != null) { IBinaryMethod[] methods = reader.getMethods(); if (methods != null) { int argCount = argumentTypeNames == null ? 0 : argumentTypeNames.length; nextMethod : for (int i = 0, methodsLength = methods.length; i < methodsLength; i++) { IBinaryMethod binaryMethod = methods[i]; char[] selector = binaryMethod.isConstructor() ? type.getElementName().toCharArray() : binaryMethod.getSelector(); if (CharOperation.equals(selector, methodSelector)) { char[] signature = binaryMethod.getGenericSignature(); if (signature == null) signature = binaryMethod.getMethodDescriptor(); char[][] parameterTypes = Signature.getParameterTypes(signature); if (argCount != parameterTypes.length) continue nextMethod; if (argumentTypeNames != null) { for (int j = 0; j < argCount; j++) { char[] parameterTypeName = ClassFileMatchLocator.convertClassFileFormat(parameterTypes[j]); if (!CharOperation.endsWith(Signature.toCharArray(Signature.getTypeErasure(parameterTypeName)), CharOperation.replaceOnCopy(argumentTypeNames[j], '$', '.'))) continue nextMethod; parameterTypes[j] = parameterTypeName; } } return (IMethod) createMethodHandle(type, new String(selector), CharOperation.toStrings(parameterTypes)); } } } } return null; } /*
IMethod createBinaryMethodHandle(IType type, char[] methodSelector, char[][] argumentTypeNames) { ClassFileReader reader = MatchLocator.classFileReader(type); if (reader != null) { IBinaryMethod[] methods = reader.getMethods(); if (methods != null) { int argCount = argumentTypeNames == null ? 0 : argumentTypeNames.length; nextMethod : for (int i = 0, methodsLength = methods.length; i < methodsLength; i++) { IBinaryMethod binaryMethod = methods[i]; char[] selector = binaryMethod.isConstructor() ? type.getElementName().toCharArray() : binaryMethod.getSelector(); if (CharOperation.equals(selector, methodSelector)) { char[] signature = binaryMethod.getGenericSignature(); if (signature == null) signature = binaryMethod.getMethodDescriptor(); char[][] parameterTypes = Signature.getParameterTypes(signature); if (argCount != parameterTypes.length) continue nextMethod; if (argumentTypeNames != null) { for (int j = 0; j < argCount; j++) { char[] parameterTypeName = ClassFileMatchLocator.convertClassFileFormat(parameterTypes[j]); if (!CharOperation.endsWith(Signature.toCharArray(Signature.getTypeErasure(parameterTypeName)), CharOperation.replaceOnCopy(argumentTypeNames[j], '$', '.'))) continue nextMethod; parameterTypes[j] = parameterTypeName; } } return (IMethod) createMethodHandle(type, new String(selector), CharOperation.toStrings(parameterTypes)); } } } } return null; } /*
IMethod createBinaryMethodHandle(IType type, char[] methodSelector, char[][] argumentTypeNames) { IBinaryType reader = MatchLocator.classFileReader(type); if (reader != null) { IBinaryMethod[] methods = reader.getMethods(); if (methods != null) { int argCount = argumentTypeNames == null ? 0 : argumentTypeNames.length; nextMethod : for (int i = 0, methodsLength = methods.length; i < methodsLength; i++) { IBinaryMethod binaryMethod = methods[i]; char[] selector = binaryMethod.isConstructor() ? type.getElementName().toCharArray() : binaryMethod.getSelector(); if (CharOperation.equals(selector, methodSelector)) { char[] signature = binaryMethod.getGenericSignature(); if (signature == null) signature = binaryMethod.getMethodDescriptor(); char[][] parameterTypes = Signature.getParameterTypes(signature); if (argCount != parameterTypes.length) continue nextMethod; if (argumentTypeNames != null) { for (int j = 0; j < argCount; j++) { char[] parameterTypeName = ClassFileMatchLocator.convertClassFileFormat(parameterTypes[j]); if (!CharOperation.endsWith(Signature.toCharArray(Signature.getTypeErasure(parameterTypeName)), CharOperation.replaceOnCopy(argumentTypeNames[j], '$', '.'))) continue nextMethod; parameterTypes[j] = parameterTypeName; } } return (IMethod) createMethodHandle(type, new String(selector), CharOperation.toStrings(parameterTypes)); } } } } return null; } /*
IMethod createBinaryMethodHandle(IType type, char[] methodSelector, char[][] argumentTypeNames) { ClassFileReader reader = MatchLocator.classFileReader(type); if (reader != null) { IBinaryMethod[] methods = reader.getMethods(); if (methods != null) { int argCount = argumentTypeNames == null ? 0 : argumentTypeNames.length; nextMethod : for (int i = 0, methodsLength = methods.length; i < methodsLength; i++) { IBinaryMethod binaryMethod = methods[i]; char[] selector = binaryMethod.isConstructor() ? type.getElementName().toCharArray() : binaryMethod.getSelector(); if (CharOperation.equals(selector, methodSelector)) { char[] signature = binaryMethod.getGenericSignature(); if (signature == null) signature = binaryMethod.getMethodDescriptor(); char[][] parameterTypes = Signature.getParameterTypes(signature); if (argCount != parameterTypes.length) continue nextMethod; if (argumentTypeNames != null) { for (int j = 0; j < argCount; j++) { char[] parameterTypeName = ClassFileMatchLocator.convertClassFileFormat(parameterTypes[j]); if (!CharOperation.endsWith(Signature.toCharArray(Signature.getTypeErasure(parameterTypeName)), CharOperation.replaceOnCopy(argumentTypeNames[j], '$', '.'))) continue nextMethod; parameterTypes[j] = parameterTypeName; } } return (IMethod) createMethodHandle(type, new String(selector), CharOperation.toStrings(parameterTypes)); } } } } return null; } /*
IMethod createBinaryMethodHandle(IType type, char[] methodSelector, char[][] argumentTypeNames) { ClassFileReader reader = MatchLocator.classFileReader(type); if (reader != null) { IBinaryMethod[] methods = reader.getMethods(); if (methods != null) { int argCount = argumentTypeNames == null ? 0 : argumentTypeNames.length; nextMethod : for (int i = 0, methodsLength = methods.length; i < methodsLength; i++) { IBinaryMethod binaryMethod = methods[i]; char[] selector = binaryMethod.isConstructor() ? type.getElementName().toCharArray() : binaryMethod.getSelector(); if (CharOperation.equals(selector, methodSelector)) { char[] signature = binaryMethod.getGenericSignature(); if (signature == null) signature = binaryMethod.getMethodDescriptor(); char[][] parameterTypes = Signature.getParameterTypes(signature); if (argCount != parameterTypes.length) continue nextMethod; if (argumentTypeNames != null) { for (int j = 0; j < argCount; j++) { char[] parameterTypeName = ClassFileMatchLocator.convertClassFileFormat(parameterTypes[j]); if (!CharOperation.endsWith(Signature.toCharArray(Signature.getTypeErasure(parameterTypeName)), CharOperation.replaceOnCopy(argumentTypeNames[j], '$', '.'))) continue nextMethod; parameterTypes[j] = parameterTypeName; } } return (IMethod) createMethodHandle(type, new String(selector), CharOperation.toStrings(parameterTypes)); } } } } return null; } /*
IMethod createBinaryMethodHandle(IType type, char[] methodSelector, char[][] argumentTypeNames) { ClassFileReader reader = MatchLocator.classFileReader(type); if (reader != null) { IBinaryMethod[] methods = reader.getMethods(); if (methods != null) { int argCount = argumentTypeNames == null ? 0 : argumentTypeNames.length; nextMethod : for (int i = 0, methodsLength = methods.length; i < methodsLength; i++) { IBinaryMethod binaryMethod = methods[i]; char[] selector = binaryMethod.isConstructor() ? type.getElementName().toCharArray() : binaryMethod.getSelector(); if (CharOperation.equals(selector, methodSelector)) { char[] signature = binaryMethod.getGenericSignature(); if (signature == null) signature = binaryMethod.getMethodDescriptor(); char[][] parameterTypes = Signature.getParameterTypes(signature); if (argCount != parameterTypes.length) continue nextMethod; if (argumentTypeNames != null) { for (int j = 0; j < argCount; j++) { char[] parameterTypeName = ClassFileMatchLocator.convertClassFileFormat(parameterTypes[j]); if (!CharOperation.endsWith(Signature.toCharArray(Signature.getTypeErasure(parameterTypeName)), CharOperation.replaceOnCopy(argumentTypeNames[j], '$', '.'))) continue nextMethod; parameterTypes[j] = parameterTypeName; } } return (IMethod) createMethodHandle(type, new String(selector), CharOperation.toStrings(parameterTypes)); } } } } return null; } /*
ClassFileReader reader = classFileReader(type); if (reader != null) {
ClassFileReader reader = classFileReader(type); if (reader != null) {
IBinaryType reader = classFileReader(type); if (reader != null) {
IBinaryType reader = classFileReader(type); if (reader != null) {
ClassFileReader reader = classFileReader(type); if (reader != null) {
ClassFileReader reader = classFileReader(type); if (reader != null) {