Browse code

fix GameGraphGenerator build

devnewton authored on 18/07/2014 at 08:03:28
Showing 2 changed files
... ...
@@ -57,7 +57,6 @@ THE SOFTWARE. -->
57 57
         <dependency>
58 58
             <groupId>com.google.inject.extensions</groupId>
59 59
             <artifactId>guice-grapher</artifactId>
60
-            <version>3.0</version>
61 60
         </dependency>
62 61
     </dependencies>
63 62
 </project>
... ...
@@ -21,7 +21,6 @@
21 21
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 22
  THE SOFTWARE.
23 23
  */
24
-
25 24
 package org.geekygoblin.nedetlesmaki.game;
26 25
 
27 26
 import com.google.inject.Guice;
... ...
@@ -40,30 +39,28 @@ import java.io.PrintWriter;
40 40
  * @author devnewton
41 41
  */
42 42
 public class GameGraphGenerator {
43
-    
43
+
44 44
     public static void main(String[] args) throws IOException {
45
-            NedModule module = new NedModule();
46
-            Injector injector = Guice.createInjector(module);
47
-            graph("ned.gv", injector);
48
-            Runtime.getRuntime().exec("dot -Tsvg ned.gv -o ned.svg");
45
+        NedModule module = new NedModule();
46
+        Injector injector = Guice.createInjector(module);
47
+        graph("ned.gv", injector);
48
+        Runtime.getRuntime().exec("dot -Tsvg ned.gv -o ned.svg");
49 49
     }
50
-        private static void graph(String filename, Injector nedInjector) throws IOException {
50
+
51
+    private static void graph(String filename, Injector nedInjector) throws IOException {
51 52
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
52
-        try (PrintWriter bout = new PrintWriter(baos)) {
53
-            Injector injector = Guice.createInjector(new GrapherModule(), new GraphvizModule());
54
-            GraphvizRenderer renderer = injector.getInstance(GraphvizRenderer.class);
55
-            renderer.setOut(bout);
56
-            injector.getInstance(InjectorGrapher.class)
57
-                    .of(nedInjector)
58
-                    .graph();
59
-        }
60
-        try (PrintWriter out = new PrintWriter(
61
-                new File(filename), "UTF-8")) {
53
+        PrintWriter bout = new PrintWriter(baos);
54
+        Injector injector = Guice.createInjector(new GrapherModule(), new GraphvizModule());
55
+        GraphvizRenderer renderer = injector.getInstance(GraphvizRenderer.class);
56
+        renderer.setOut(bout);
57
+        injector.getInstance(InjectorGrapher.class)
58
+                .of(nedInjector)
59
+                .graph();
60
+        PrintWriter out = new PrintWriter(new File(filename), "UTF-8");
62 61
             String s = baos.toString("UTF-8");
63
-            s = fixGrapherBug(s);
64
-            s = hideClassPaths(s);
65
-            out.write(s);
66
-        }
62
+        s = fixGrapherBug(s);
63
+        s = hideClassPaths(s);
64
+        out.write(s);
67 65
 
68 66
     }
69 67