compile problem fix

This commit is contained in:
shautvast 2013-12-07 12:57:50 +01:00
parent 766da3d665
commit 54a7da07bb
3 changed files with 12 additions and 7 deletions

View file

@ -40,6 +40,14 @@ public class GraphBuilder {
});
}
public Graph build(File archive, String className) throws IOException {
return buildClassDepencyGraph(archive, className, new IncludeDecision() {
public boolean shouldIncludeClass(String name, String startingpointname) {
return name.equals(startingpointname);
}
});
}
/**
* Builds a graph for all classes (all included via package patterns and not excluded)
*
@ -56,7 +64,7 @@ public class GraphBuilder {
});
}
Graph buildClassDepencyGraph(File archiveFile, String className, IncludeDecision e) throws IOException {
private Graph buildClassDepencyGraph(File archiveFile, String className, IncludeDecision e) throws IOException {
List<InspectableClasspath> cpList = scanner.scanArchive(archiveFile);
ClassPool pool = ClassPool.getDefault();

View file

@ -25,10 +25,8 @@ public class LargePackageTest {
GraphBuilder earBuilder = GraphBuilderFactory.getEarBuilder();
earBuilder.setPackageIncludePatterns("");
earBuilder.setPackageExcludePatterns("java.*");
Graph graph = earBuilder.buildClassDepencyGraph(config.getEarFile(),
"java.lang.String");
DotPrinter dotPrinter = new DotPrinter(new FileOutputStream(
"/tmp/example.dot"));
Graph graph = earBuilder.build(config.getEarFile(), "java.lang.String");
DotPrinter dotPrinter = new DotPrinter(new FileOutputStream("/tmp/example.dot"));
dotPrinter.print(graph);
dotPrinter.close();
}

View file

@ -27,8 +27,7 @@ public class TgzBuilderTest {
GraphBuilder tgzBuilder = GraphBuilderFactory.getDefaultTgzBuilder();
tgzBuilder.setPackageIncludePatterns("nl.*");
tgzBuilder.setPackageExcludePatterns("");
Graph graph = tgzBuilder.buildClassDepencyGraph(config.getTgzFile(),
"nl.jssl.jas.Main");
Graph graph = tgzBuilder.build(config.getTgzFile(), "nl.jssl.jas.Main");
ArrayList<String> names = new ArrayList<String>();