Skip to content

Commit

Permalink
Using JDK7 features
Browse files Browse the repository at this point in the history
  • Loading branch information
gastaldi committed Feb 20, 2014
1 parent 9bae4e8 commit f27aa6f
Showing 1 changed file with 5 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,6 @@ DirectedGraph<AddonVertex, AddonDependencyEdge> toGraph(AddonInfo info)
return graph;
}

/**
* @param info
* @param graph
*/
private void populateGraph(AddonInfo info, DirectedGraph<AddonVertex, AddonDependencyEdge> graph)
{
addGraphDependencies(info, graph);
Expand Down Expand Up @@ -201,32 +197,18 @@ private void addGraphDependencies(AddonInfo info, DirectedGraph<AddonVertex, Add

void toDOT(File file, DirectedGraph<AddonVertex, AddonDependencyEdge> graph)
{
FileWriter fw = null;
try
DOTExporter<AddonVertex, AddonDependencyEdge> exporter = new DOTExporter<>(
new IntegerNameProvider<AddonVertex>(),
new AddonVertexNameProvider(),
new AddonDependencyEdgeNameProvider());
try (FileWriter fw = new FileWriter(file))
{
DOTExporter<AddonVertex, AddonDependencyEdge> exporter = new DOTExporter<AddonVertex, AddonDependencyEdge>(
new IntegerNameProvider<AddonVertex>(),
new AddonVertexNameProvider(),
new AddonDependencyEdgeNameProvider());

fw = new FileWriter(file);
exporter.export(fw, graph);
fw.flush();
}
catch (IOException e)
{
e.printStackTrace();
}
finally
{
if (fw != null)
try
{
fw.close();
}
catch (IOException ignored)
{
}
}
}
}

0 comments on commit f27aa6f

Please sign in to comment.