public InputStream openSource(SourceLineAnnotation source) throws IOException { SourceFile sourceFile = findSourceFile(source); return sourceFile.getInputStream(); }
/** * Open an input stream on a source file in given package. * * @param packageName * the name of the package containing the class whose source file * is given * @param fileName * the unqualified name of the source file * @return an InputStream on the source file * @throws IOException * if a matching source file cannot be found */ public InputStream openSource(String packageName, String fileName) throws IOException { SourceFile sourceFile = findSourceFile(packageName, fileName); return sourceFile.getInputStream(); }
try { long lastModified = sourceFile.getLastModified(); in = sourceFile.getInputStream(); out = getOutputStream(fullName, 0); if (out == null) {
return false; r = UTF8.bufferedReader(sourceFile.getInputStream()); for (int i = 0; i < startLine; i++) { String line = r.readLine();
public InputStream openSource(SourceLineAnnotation source) throws IOException { SourceFile sourceFile = findSourceFile(source); return sourceFile.getInputStream(); }
/** * Open an input stream on a source file in given package. * * @param packageName * the name of the package containing the class whose source file * is given * @param fileName * the unqualified name of the source file * @return an InputStream on the source file * @throws IOException * if a matching source file cannot be found */ public InputStream openSource(String packageName, String fileName) throws IOException { SourceFile sourceFile = findSourceFile(packageName, fileName); return sourceFile.getInputStream(); }
try { long lastModified = sourceFile.getLastModified(); in = sourceFile.getInputStream(); out = getOutputStream(fullName, 0); if (out == null) {
SourceFinder sourceFinder = AnalysisContext.currentAnalysisContext().getSourceFinder(); SourceFile sourceFile = sourceFinder.findSourceFile(srcLineAnnotation.getPackageName(), srcLineAnnotation.getSourceFile()); try (BufferedReader sourceReader = new BufferedReader(new InputStreamReader(sourceFile.getInputStream(), StandardCharsets.UTF_8))) {
SourceFinder sourceFinder = AnalysisContext.currentAnalysisContext().getSourceFinder(); SourceFile sourceFile = sourceFinder.findSourceFile(srcLineAnnotation.getPackageName(), srcLineAnnotation.getSourceFile()); try (BufferedReader sourceReader = new BufferedReader(new InputStreamReader(sourceFile.getInputStream(), StandardCharsets.UTF_8))) {
@Nonnull private JavaSourceDocument getDocument(SourceLineAnnotation source) { try { SourceFile sourceFile = frame.getProject().getSourceFinder().findSourceFile(source); String fullFileName = sourceFile.getFullFileName(); SoftReference<JavaSourceDocument> resultReference = map.get(fullFileName); JavaSourceDocument result = null; if (resultReference != null) { result = resultReference.get(); } if (result != null) { return result; } try { InputStream in = sourceFile.getInputStream(); result = new JavaSourceDocument(source.getClassName(), SourceCharset.bufferedReader(in), sourceFile); } catch (Exception e) { result = JavaSourceDocument.UNKNOWNSOURCE; Debug.println(e); // e.printStackTrace(); } map.put(fullFileName, new SoftReference<JavaSourceDocument>(result)); return result; } catch (Exception e) { Debug.println(e); // e.printStackTrace(); return JavaSourceDocument.UNKNOWNSOURCE; } }
Project project = cloud.getBugCollection().getProject(); SourceFile sourceFile = project.getSourceFinder().findSourceFile(primarySource); in = UTF8.bufferedReader(sourceFile.getInputStream()); int lineNumber = 1; String commonWhiteSpace = null;
return false; r = UTF8.bufferedReader(sourceFile.getInputStream()); for (int i = 0; i < startLine; i++) { String line = r.readLine();