public static String getCanonicalName(SourceLineAnnotation source) { return getCanonicalName(source.getPackageName(), getOrGuessSourceFile(source)); }
public static String getPlatformName(SourceLineAnnotation source) { return getPlatformName(source.getPackageName(), getOrGuessSourceFile(source)); }
public SourceFile findSourceFile(SourceLineAnnotation source) throws IOException { return findSourceFile(source.getPackageName(), getOrGuessSourceFile(source)); }
public boolean hasSourceFile(String packageName, String fileName) { // On windows the fileName specification is different between a file in // a directory tree, and a // file in a zip file. In a directory tree the separator used is '\', // while in a zip it's '/' // Therefore for each repository figure out what kind it is and use the // appropriate separator. // In all practicality, this code could just use the hardcoded '/' char, // as windows can open // files with this separator, but to allow for the mythical 'other' // platform that uses an // alternate separator, make a distinction // Create a fully qualified source filename using the package name for // both directories and zips String platformName = getPlatformName(packageName, fileName); String canonicalName = getCanonicalName(packageName, fileName); // Is the file in the cache already? Always cache it with the canonical // name SourceFile sourceFile = cache.get(canonicalName); if (sourceFile != null) { return true; } // Find this source file, add its data to the cache if (DEBUG) { System.out.println("Trying " + fileName + " in package " + packageName + "..."); }
public SourceFile findSourceFile(SourceLineAnnotation source) throws IOException { return findSourceFile(source.getPackageName(), getOrGuessSourceFile(source)); }
public static String getPlatformName(SourceLineAnnotation source) { return getPlatformName(source.getPackageName(), getOrGuessSourceFile(source)); }
public static String getCanonicalName(SourceLineAnnotation source) { return getCanonicalName(source.getPackageName(), getOrGuessSourceFile(source)); }
public boolean hasSourceFile(String packageName, String fileName) { // On windows the fileName specification is different between a file in // a directory tree, and a // file in a zip file. In a directory tree the separator used is '\', // while in a zip it's '/' // Therefore for each repository figure out what kind it is and use the // appropriate separator. // In all practicality, this code could just use the hardcoded '/' char, // as windows can open // files with this separator, but to allow for the mythical 'other' // platform that uses an // alternate separator, make a distinction // Create a fully qualified source filename using the package name for // both directories and zips String platformName = getPlatformName(packageName, fileName); String canonicalName = getCanonicalName(packageName, fileName); // Is the file in the cache already? Always cache it with the canonical // name SourceFile sourceFile = cache.get(canonicalName); if (sourceFile != null) { return true; } // Find this source file, add its data to the cache if (DEBUG) { System.out.println("Trying " + fileName + " in package " + packageName + "..."); }