public boolean findSource(SourceLineAnnotation srcLine) { if (srcLine == null) { return false; } String cName = srcLine.getClassName(); if (sourceFound.contains(cName)) { return true; } if (sourceNotFound.contains(cName)) { return false; } boolean result = sourceFinder.hasSourceFile(srcLine); return result; }
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 boolean findSource(SourceLineAnnotation srcLine) { if (srcLine == null) { return false; } String cName = srcLine.getClassName(); if (sourceFound.contains(cName)) { return true; } if (sourceNotFound.contains(cName)) { return false; } boolean result = sourceFinder.hasSourceFile(srcLine); return result; }
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 + "..."); }
continue; if (!sourceFinder.hasSourceFile(s)) { continue;