diff --git a/annotations/build.xml b/annotations/build.xml index 4cfd0d52..543b32e9 100644 --- a/annotations/build.xml +++ b/annotations/build.xml @@ -17,7 +17,7 @@ - + diff --git a/concurrency/ExceptionThread.java b/concurrency/ExceptionThread.java index 386d6ed7..8d11c92f 100644 --- a/concurrency/ExceptionThread.java +++ b/concurrency/ExceptionThread.java @@ -1,4 +1,5 @@ //: concurrency/ExceptionThread.java +// {RunByHand} // {ThrowsException} import java.util.concurrent.*; diff --git a/concurrency/NaiveExceptionHandling.java b/concurrency/NaiveExceptionHandling.java index 4feb1ac3..1d560198 100644 --- a/concurrency/NaiveExceptionHandling.java +++ b/concurrency/NaiveExceptionHandling.java @@ -1,4 +1,5 @@ //: concurrency/NaiveExceptionHandling.java +// {RunByHand} // {ThrowsException} import java.util.concurrent.*; diff --git a/concurrency/build.xml b/concurrency/build.xml index 67f20c93..05f7d977 100644 --- a/concurrency/build.xml +++ b/concurrency/build.xml @@ -11,7 +11,7 @@ - + @@ -23,28 +23,26 @@ - + - - + - + - + - + - + - @@ -55,7 +53,7 @@ - + @@ -70,7 +68,7 @@ - + diff --git a/containers/build.xml b/containers/build.xml index cdb99b26..a28e03eb 100644 --- a/containers/build.xml +++ b/containers/build.xml @@ -19,17 +19,17 @@ - + - + - + - + diff --git a/gui/build.xml b/gui/build.xml index b30d1a39..bcdb87e9 100644 --- a/gui/build.xml +++ b/gui/build.xml @@ -28,7 +28,7 @@ - + diff --git a/innerclasses/build.xml b/innerclasses/build.xml index 9ab4a805..76d9d01c 100644 --- a/innerclasses/build.xml +++ b/innerclasses/build.xml @@ -15,7 +15,7 @@ - + diff --git a/io/DirList.java b/io/DirList.java index 2ccc559a..02589356 100644 --- a/io/DirList.java +++ b/io/DirList.java @@ -1,6 +1,6 @@ //: io/DirList.java // Display a directory listing using regular expressions. -// {Args: "D.*\.java"} +// {Args: 'D.*\.java'} import java.util.regex.*; import java.io.*; import java.util.*; diff --git a/io/DirList2.java b/io/DirList2.java index 4af27fb5..d646303e 100644 --- a/io/DirList2.java +++ b/io/DirList2.java @@ -1,6 +1,6 @@ //: io/DirList2.java // Uses anonymous inner classes. -// {Args: "D.*\.java"} +// {Args: 'D.*\.java'} import java.util.regex.*; import java.io.*; import java.util.*; diff --git a/io/DirList3.java b/io/DirList3.java index cb504a41..edef7170 100644 --- a/io/DirList3.java +++ b/io/DirList3.java @@ -1,6 +1,6 @@ //: io/DirList3.java // Building the anonymous inner class "in-place." -// {Args: "D.*\.java"} +// {Args: 'D.*\.java'} import java.util.regex.*; import java.io.*; import java.util.*; diff --git a/io/ZipCompress.java b/io/ZipCompress.java index a8d15861..ca13ed33 100644 --- a/io/ZipCompress.java +++ b/io/ZipCompress.java @@ -19,7 +19,7 @@ public class ZipCompress { // No corresponding getComment(), though. for (String arg : args) { print("Writing file " + arg); - try (InputStream in = new BufferedInputStream( + try(InputStream in = new BufferedInputStream( new FileInputStream(arg))) { zos.putNextEntry(new ZipEntry(arg)); int c; @@ -37,17 +37,18 @@ public class ZipCompress { CheckedInputStream csumi = new CheckedInputStream(fi, new Adler32()); ZipInputStream in2 = new ZipInputStream(csumi); - BufferedInputStream bis = new BufferedInputStream(in2); - ZipEntry ze; - while((ze = in2.getNextEntry()) != null) { - print("Reading file " + ze); - int x; - while((x = bis.read()) != -1) - System.out.write(x); + try(BufferedInputStream bis = + new BufferedInputStream(in2)) { + ZipEntry ze; + while((ze = in2.getNextEntry()) != null) { + print("Reading file " + ze); + int x; + while((x = bis.read()) != -1) + System.out.write(x); + } + if(args.length == 1) + print("Checksum: " + csumi.getChecksum().getValue()); } - if(args.length == 1) - print("Checksum: " + csumi.getChecksum().getValue()); - bis.close(); // Alternative way to open and read Zip files: ZipFile zf = new ZipFile("test.zip"); Enumeration e = zf.entries(); diff --git a/io/build.xml b/io/build.xml index 006e1298..d3255b84 100644 --- a/io/build.xml +++ b/io/build.xml @@ -14,11 +14,11 @@ - + - - - + + + @@ -27,12 +27,12 @@ - + - + @@ -43,12 +43,12 @@ - + - + diff --git a/net/build.xml b/net/build.xml index ca99e24c..5eb50f1c 100644 --- a/net/build.xml +++ b/net/build.xml @@ -7,7 +7,7 @@ - + diff --git a/network/build.xml b/network/build.xml index 47bbd754..5ed28d2f 100644 --- a/network/build.xml +++ b/network/build.xml @@ -12,7 +12,7 @@ - + diff --git a/strings/JGrep.java b/strings/JGrep.java index 74ed9501..00c1b86d 100644 --- a/strings/JGrep.java +++ b/strings/JGrep.java @@ -1,6 +1,6 @@ //: strings/JGrep.java // A very simple version of the "grep" program. -// {Args: JGrep.java "\\b[Ssct]\\w+"} +// {Args: JGrep.java '\\b[Ssct]\\w+'} import java.util.regex.*; import net.mindview.util.*; diff --git a/strings/TestRegularExpression.java b/strings/TestRegularExpression.java index 64623629..f9d27c15 100644 --- a/strings/TestRegularExpression.java +++ b/strings/TestRegularExpression.java @@ -1,6 +1,6 @@ //: strings/TestRegularExpression.java // Easily try out regular expressions. -// {Args: abcabcabcdefabc "abc+" "(abc)+" "(abc){2,}" } +// {Args: abcabcabcdefabc 'abc+' '(abc)+' '(abc){2,}' } import java.util.regex.*; import static net.mindview.util.Print.*; diff --git a/strings/build.xml b/strings/build.xml index 1d992076..ba1348a4 100644 --- a/strings/build.xml +++ b/strings/build.xml @@ -16,7 +16,7 @@ - + @@ -29,7 +29,7 @@ - + diff --git a/typeinfo/build.xml b/typeinfo/build.xml index 25452e3f..2c400f50 100644 --- a/typeinfo/build.xml +++ b/typeinfo/build.xml @@ -25,7 +25,7 @@ - +