private static String sourceFileName(AbstractClassFile classFile) { if (classFile instanceof ModularClassFile) return TypeConstants.MODULE_INFO_FILE_NAME_STRING; else return ((BinaryType) ((ClassFile) classFile).getType()).getSourceFileName(null/*no info available*/); }
private static String sourceFileName(AbstractClassFile classFile) { if (classFile instanceof ModularClassFile) return TypeConstants.MODULE_INFO_FILE_NAME_STRING; else return ((BinaryType) ((ClassFile) classFile).getType()).getSourceFileName(null/*no info available*/); }
public ClassFileWorkingCopy(ClassFile classFile, WorkingCopyOwner owner) { super((PackageFragment) classFile.getParent(), ((BinaryType) classFile.getType()).getSourceFileName(null/*no info available*/), owner); this.classFile = classFile; }
/** * Locates and returns source code for the given (binary) type, in this * SourceMapper's ZIP file, or returns <code>null</code> if source * code cannot be found. */ public char[] findSource(IType type, IBinaryType info) { if (!type.isBinary()) { return null; } String simpleSourceFileName = ((BinaryType) type).getSourceFileName(info); if (simpleSourceFileName == null) { return null; } return findSource(type, simpleSourceFileName); }
public ClassFileWorkingCopy(ClassFile classFile, WorkingCopyOwner owner) { super((PackageFragment) classFile.getParent(), ((BinaryType) classFile.getType()).getSourceFileName(null/*no info available*/), owner); this.classFile = classFile; }
public ClassFileWorkingCopy(ClassFile classFile, WorkingCopyOwner owner) { super((PackageFragment) classFile.getParent(), ((BinaryType) classFile.getType()).getSourceFileName(null/*no info available*/), owner); this.classFile = classFile; }
public ClassFileWorkingCopy(ClassFile classFile, WorkingCopyOwner owner) { super((PackageFragment) classFile.getParent(), ((BinaryType) classFile.getType()).getSourceFileName(null/*no info available*/), owner); this.classFile = classFile; }
/** * Locates and returns source code for the given (binary) type, in this * SourceMapper's ZIP file, or returns <code>null</code> if source * code cannot be found. */ public char[] findSource(IType type, IBinaryType info) { if (!type.isBinary()) { return null; } String simpleSourceFileName = ((BinaryType) type).getSourceFileName(info); if (simpleSourceFileName == null) { return null; } return findSource(type, simpleSourceFileName); }
/** * Locates and returns source code for the given (binary) type, in this * SourceMapper's ZIP file, or returns <code>null</code> if source * code cannot be found. */ public char[] findSource(IType type, IBinaryType info) { if (!type.isBinary()) { return null; } String simpleSourceFileName = ((BinaryType) type).getSourceFileName(info); if (simpleSourceFileName == null) { return null; } return findSource(type, simpleSourceFileName); }
/** * Locates and returns source code for the given (binary) type, in this * SourceMapper's ZIP file, or returns <code>null</code> if source * code cannot be found. */ public char[] findSource(IType type, IBinaryType info) { if (!type.isBinary()) { return null; } String simpleSourceFileName = ((BinaryType) type).getSourceFileName(info); if (simpleSourceFileName == null) { return null; } return findSource(type, simpleSourceFileName); }
/** * Locates and returns source code for the given (binary) type, in this * SourceMapper's ZIP file, or returns <code>null</code> if source * code cannot be found. */ public char[] findSource(IType type, IBinaryType info) { if (!type.isBinary()) { return null; } String simpleSourceFileName = ((BinaryType) type).getSourceFileName(info); if (simpleSourceFileName == null) { return null; } return findSource(type, simpleSourceFileName); }
/** * Locates and returns source code for the given (binary) type, in this * SourceMapper's ZIP file, or returns <code>null</code> if source * code cannot be found. */ public char[] findSource(IType type, IBinaryType info) { if (!type.isBinary()) { return null; } String simpleSourceFileName = ((BinaryType) type).getSourceFileName(info); if (simpleSourceFileName == null) { return null; } return findSource(type, simpleSourceFileName); }
protected String getTraceSimpleFileName(final ITypeRoot derivedResource) { IType type = derivedResource.findPrimaryType(); if (type == null) return null; String sourceName = ((BinaryType) type).getSourceFileName(null); if (sourceName == null) return null; // the primary source in the .class file is .java (JSR-45 aka SMAP scenario) if (sourceName.endsWith(".java")) { return traceFileNameProvider.getTraceFromJava(sourceName); } // xtend-as-primary-source-scenario. if (sourceName.endsWith(".xtend")) { String name = type.getElementName(); int index = name.indexOf("$"); if (index > 0) name = name.substring(0, index); return traceFileNameProvider.getTraceFromJava(name + ".java"); } return null; }