]> source.dussan.org Git - aspectj.git/commitdiff
Helens changes to ensure these tidy up after themselves and avoid synchronization...
authoraclement <aclement>
Mon, 7 Nov 2005 17:29:28 +0000 (17:29 +0000)
committeraclement <aclement>
Mon, 7 Nov 2005 17:29:28 +0000 (17:29 +0000)
ajdoc/src/org/aspectj/tools/ajdoc/HtmlDecorator.java
ajdoc/src/org/aspectj/tools/ajdoc/Main.java
ajdoc/testsrc/org/aspectj/tools/ajdoc/CoverageTestCase.java

index b43b2c3de9c229596578a12532b5a3557a218510..8752d2e24d57047703d98df9880aa4fce510acd6 100644 (file)
@@ -224,6 +224,9 @@ class HtmlDecorator {
         file.delete();
         FileOutputStream fos = new FileOutputStream( file );
         fos.write( fileContents.toString().getBytes() );
+        
+        reader.close();
+        fos.close();
     }
 
     static void addAspectDocumentation(IProgramElement node, StringBuffer fileBuffer, int index ) {
index ed5b0433977ba115e3f6be3511ac59f82c183760..6f72269660e64acdb06c3923aea1f7f8aa4b2f8d 100644 (file)
@@ -275,6 +275,9 @@ public class Main implements Config {
             }
             FileOutputStream fos = new FileOutputStream( indexFile );
             fos.write( indexFileBuffer.getBytes() );
+            
+            indexFileReader.close();
+            fos.close();
         }
         }
         catch (IOException ioe) {
index 316f032802990dd7b7cf0774e05a7b26e8e694cf..b6f03d3c71e3c4ecf7447c6abb9141da5c8d317b 100644 (file)
@@ -15,6 +15,8 @@ import java.io.File;
 
 import junit.framework.TestCase;
 
+import org.aspectj.util.FileUtil;
+
 /**
  * A long way to go until full coverage, but this is the place to add more.
  * 
@@ -34,8 +36,8 @@ public class CoverageTestCase extends TestCase {
        protected File file8 = new File("../ajdoc/testdata/coverage/fluffy/bunny/rocks/UseThisAspectForLinkCheckToo.java");
        protected File file9 = new File("../ajdoc/testdata/coverage/foo/PkgVisibleClass.java");
        protected File file10 = new File("../ajdoc/testdata/coverage/foo/NoMembers.java");
-    
-       protected File outdir = new File("testdata/coverage/doc");
+
+       protected File outdir;
        
        public void testOptions() {
                outdir.delete();
@@ -110,9 +112,17 @@ public class CoverageTestCase extends TestCase {
        
        protected void setUp() throws Exception {
                super.setUp();
+               outdir = new File("testdata/coverage/doc");
        }
        
        protected void tearDown() throws Exception {
                super.tearDown();
+               
+               FileUtil.deleteContents(new File("ajdocworkingdir"));
+               (new File("ajdocworkingdir")).delete();
+               
+               FileUtil.deleteContents(new File("testdata"));
+               (new File("testdata")).delete();
+
        }
 }