/** * Handle -analyzeFromFile command line option by reading jar file names * from a file and adding them to the project. * * @throws IOException */ private void handleAnalyzeFromFile(String filePath) throws IOException { try (BufferedReader in = new BufferedReader(UTF8.fileReader(filePath))) { while (true) { String s = in.readLine(); if (s == null) { break; } project.addFile(s); } } }
/** * Handle -xargs command line option by reading jar file names from standard * input and adding them to the project. * * @throws IOException */ public void handleXArgs() throws IOException { if (getXargs()) { try (BufferedReader in = UTF8.bufferedReader(System.in)) { while (true) { String s = in.readLine(); if (s == null) { break; } project.addFile(s); } } } }
@CheckReturnValue private Project createProject(Path[] files) { final Project project = new Project(); project.setProjectName(getClass().getSimpleName()); if (PLUGIN_JAR != null) { try { String pluginId = Plugin.addCustomPlugin(PLUGIN_JAR.toURI()).getPluginId(); project.setPluginStatusTrinary(pluginId, Boolean.TRUE); } catch (PluginException e) { throw new AssertionError("Failed to load plugin", e); } } for (Path file : files) { project.addFile(file.toAbsolutePath().toString()); } for (Path auxClasspathEntry : auxClasspathEntries) { project.addAuxClasspathEntry(auxClasspathEntry.toAbsolutePath().toString()); } return project; }
assert project != null; if ("Jar".equals(qName)) { project.addFile(makeAbsolute(getTextContents())); } else if ("SrcDir".equals(qName)) { sourceDirs.add(makeAbsolute(getTextContents()));
project.addFile(argv[i]);
project.addFile(getFindbugsTestCasesFile(s).getPath()); if(s.indexOf("Eclipse") >= 0){
project.setProjectName("automate-test-project"); for (String file : classFiles) { project.addFile(file);
project.addFile(tmpdir.getAbsolutePath());
/** * Handle -analyzeFromFile command line option by reading jar file names * from a file and adding them to the project. * * @throws IOException */ private void handleAnalyzeFromFile(String filePath) throws IOException { BufferedReader in = new BufferedReader(UTF8.fileReader(filePath)); try { while (true) { String s = in.readLine(); if (s == null) { break; } project.addFile(s); } } finally { Util.closeSilently(in); } }
/** * Create project. * @param basedir Base dir * @param outdir Output dir (with classes) * @param paths Paths of a classpath * @return The project */ private static Project project(final String basedir, final String outdir, final String... paths) { final Project project = new Project(); for (final String jar : paths) { if (!jar.equals(outdir)) { project.addAuxClasspathEntry(jar); } } project.addFile(outdir); project.addSourceDir(new File(basedir, "src/main/java").getPath()); return project; }
/** * Create project. * @param basedir Base dir * @param outdir Output dir (with classes) * @param paths Paths of a classpath * @return The project */ private static Project project(final String basedir, final String outdir, final String... paths) { final Project project = new Project(); for (final String jar : paths) { if (!jar.equals(outdir)) { project.addAuxClasspathEntry(jar); } } project.addFile(outdir); project.addSourceDir(new File(basedir, "src/main/java").getPath()); return project; }
private Project createProject() { final Project project = new Project(); PluginLoader.addPluginsTo(project); for (final AnalyzerConfig.Path clazz : config.getClassPaths()) { project.addFile(clazz.getPath()); } project.addSourceDirs(config.getSourcePaths().stream().map(AnalyzerConfig.Path::getPath).collect(toList())); final String pathSeparator = System.getProperty("path.separator"); final String classPath = System.getProperty("java.class.path"); for (final String entry : classPath.split(pathSeparator)) { project.addAuxClasspathEntry(entry); } return project; }
private Project createProject() { final Project project = new Project(); PluginLoader.addPluginsTo(project); for (final AnalyzerConfig.Path clazz : config.getClassPaths()) { project.addFile(clazz.getPath()); } project.addSourceDirs(config.getSourcePaths().stream().map(AnalyzerConfig.Path::getPath).collect(toList())); final String pathSeparator = System.getProperty("path.separator"); final String classPath = System.getProperty("java.class.path"); for (final String entry : classPath.split(pathSeparator)) { project.addAuxClasspathEntry(entry); } return project; }
/** * Handle -xargs command line option by reading jar file names from standard * input and adding them to the project. * * @throws IOException */ public void handleXArgs() throws IOException { if (getXargs()) { BufferedReader in = UTF8.bufferedReader(System.in); try { while (true) { String s = in.readLine(); if (s == null) { break; } project.addFile(s); } } finally { Util.closeSilently(in); } } }
findbugsProject.addFile(absolutePath);
assert project != null; if ("Jar".equals(qName)) { project.addFile(makeAbsolute(getTextContents())); } else if ("SrcDir".equals(qName)) { project.addSourceDir(makeAbsolute(getTextContents()));
@Override public void actionPerformed(ActionEvent evt) { final Project tempProject = new Project(); for (int i = 0; i < analyzeModel.getSize(); i++) { tempProject.addFile(analyzeModel.get(i)); } for (int i = 0; i < auxModel.getSize(); i++) { tempProject.addAuxClasspathEntry(auxModel.get(i)); } java.awt.EventQueue.invokeLater(new Runnable() { @Override public void run() { final SourceDirectoryWizard dialog = new SourceDirectoryWizard(new javax.swing.JFrame(), true, tempProject, thisGUI); dialog.addWindowListener(new java.awt.event.WindowAdapter() { @Override public void windowClosing(java.awt.event.WindowEvent e) { if (dialog.discover != null && dialog.discover.isAlive()) { dialog.discover.interrupt(); } } }); dialog.setVisible(true); } }); } });
project.addFile(argv[i]);
p.addFile(analyzeModel.get(i));