File tree Expand file tree Collapse file tree
file-monitor/src/com/sandwich/util/io
koans-tests/test/com/sandwich Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33import java .io .File ;
44import java .io .FileInputStream ;
55import java .io .FileOutputStream ;
6+ import java .io .IOException ;
67import java .io .ObjectInputStream ;
78import java .io .ObjectOutputStream ;
89
@@ -48,6 +49,14 @@ public T read(){
4849 throw new RuntimeException (e2 );
4950 }
5051 throw new RuntimeException (e );
52+ } finally {
53+ if (objectInputStream != null ){
54+ try {
55+ objectInputStream .close ();
56+ } catch (IOException e ) {
57+ throw new RuntimeException (e );
58+ }
59+ }
5160 }
5261 }
5362
@@ -65,6 +74,14 @@ public void write(T state){
6574 throw new RuntimeException (e2 );
6675 }
6776 throw new RuntimeException (e );
77+ } finally {
78+ if (objectOutputStream != null ){
79+ try {
80+ objectOutputStream .close ();
81+ } catch (IOException e ) {
82+ throw new RuntimeException (e );
83+ }
84+ }
6885 }
6986 }
7087
Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ public class AnonymousInnerClassTest extends CommandLineTestCase{
1313 public void testAnonymousInnerClassIsCoolToUseAsKoan () throws Exception {
1414 final String definitelyAUniqueString = "meh1294120240912049" ;
1515 stubAllKoans (Arrays .asList (new Object (){
16- @ SuppressWarnings ("unused" )
1716 @ Koan public void printMsg (){
1817 System .out .println (definitelyAUniqueString );
1918 }
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ public class KoanComparatorTest extends CommandLineTestCase {
1818 @ Test
1919 public void testThatKomparatorBombsWhenNotFound () throws Exception {
2020 Method m = new Object (){
21- @ SuppressWarnings ( "unused" ) @ Koan public void someMethod (){}
21+ @ Koan public void someMethod (){}
2222 }.getClass ().getDeclaredMethod ("someMethod" );
2323 KoanComparator comparator = new KoanComparator ("meh" );
2424 try {
@@ -29,8 +29,8 @@ public void testThatKomparatorBombsWhenNotFound() throws Exception {
2929 @ Test
3030 public void testComparatorRanksByOrder () throws Exception {
3131 Class <? extends Object > clazz = new Object (){
32- @ SuppressWarnings ( "unused" ) @ Koan public void someMethodOne (){}
33- @ SuppressWarnings ( "unused" ) @ Koan public void someMethodTwo (){}
32+ @ Koan public void someMethodOne (){}
33+ @ Koan public void someMethodTwo (){}
3434 }.getClass ();
3535 KoanMethod m1 = KoanMethod .getInstance ("" ,clazz .getDeclaredMethod ("someMethodOne" ));
3636 KoanMethod m2 = KoanMethod .getInstance ("" ,clazz .getDeclaredMethod ("someMethodTwo" ));
You can’t perform that action at this time.
0 commit comments