Author: peterreilly Date: Mon Sep 11 14:11:39 2006 New Revision: 442353 URL: http://svn.apache.org/viewvc?view=rev&rev=442353 Log: bugzilla report 38451: handling of html option of aantlr
Modified: ant/core/trunk/CONTRIBUTORS ant/core/trunk/WHATSNEW ant/core/trunk/contributors.xml ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ANTLR.java ant/core/trunk/src/testcases/org/apache/tools/ant/util/ReaderInputStreamTest.java Modified: ant/core/trunk/CONTRIBUTORS URL: http://svn.apache.org/viewvc/ant/core/trunk/CONTRIBUTORS?view=diff&rev=442353&r1=442352&r2=442353 ============================================================================== Binary files - no diff available. Modified: ant/core/trunk/WHATSNEW URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?view=diff&rev=442353&r1=442352&r2=442353 ============================================================================== --- ant/core/trunk/WHATSNEW (original) +++ ant/core/trunk/WHATSNEW Mon Sep 11 14:11:39 2006 @@ -19,6 +19,8 @@ * Handling of corrupt tar files, TarInputStream.read() never returns EOF. Bugzilla report 39924. * Some bugs in ReaderInputStream. Bugzilla report 39635. +* <antlr> did not recognise whether the target is up-to-date for html option. + Bugzilla report 38451. Other changes: -------------- Modified: ant/core/trunk/contributors.xml URL: http://svn.apache.org/viewvc/ant/core/trunk/contributors.xml?view=diff&rev=442353&r1=442352&r2=442353 ============================================================================== --- ant/core/trunk/contributors.xml (original) +++ ant/core/trunk/contributors.xml Mon Sep 11 14:11:39 2006 @@ -296,12 +296,20 @@ <last>de Haan</last> </name> <name> - <first>Frederic</first> - <last>Lavigne</last> + <first>Frank</first> + <last>Harnack</last> </name> <name> <first>Frank</first> <last>Somers</last> + </name> + <name> + <first>Frank</first> + <last>Zeyda</last> + </name> + <name> + <first>Frederic</first> + <last>Lavigne</last> </name> <name> <first>Gary</first> Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ANTLR.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ANTLR.java?view=diff&rev=442353&r1=442352&r2=442353 ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ANTLR.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ANTLR.java Mon Sep 11 14:11:39 2006 @@ -385,7 +385,8 @@ if (generatedFileName == null) { throw new BuildException("Unable to determine generated class"); } - return new File(outputDirectory, generatedFileName + ".java"); + return new File(outputDirectory, generatedFileName + + (html ? ".html" : ".java")); } /** execute in a forked VM */ Modified: ant/core/trunk/src/testcases/org/apache/tools/ant/util/ReaderInputStreamTest.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/testcases/org/apache/tools/ant/util/ReaderInputStreamTest.java?view=diff&rev=442353&r1=442352&r2=442353 ============================================================================== --- ant/core/trunk/src/testcases/org/apache/tools/ant/util/ReaderInputStreamTest.java (original) +++ ant/core/trunk/src/testcases/org/apache/tools/ant/util/ReaderInputStreamTest.java Mon Sep 11 14:11:39 2006 @@ -37,21 +37,41 @@ compareBytes("a", "utf-16"); } - public void notAtestSimple16() throws Exception { + public void testSimpleAbc16() throws Exception { // THIS WILL FAIL. - compareBytes("abc", "utf-16"); + //compareBytes("abc", "utf-16"); + byte[] bytes = new byte[40]; + int pos = 0; + ReaderInputStream r = new ReaderInputStream( + new StringReader("abc"), "utf-16"); + for (int i = 0; true; ++i) { + int res = r.read(); + if (res == -1) { + break; + } + bytes[pos++] = (byte) res; + } + bytes = "abc".getBytes("utf-16"); + // String n = new String(bytes, 0, pos, "utf-16"); + String n = new String(bytes, 0, bytes.length, "utf-16"); + System.out.println(n); } public void testReadZero() throws Exception { ReaderInputStream r = new ReaderInputStream( new StringReader("abc")); - byte[] bytes = new byte[10]; + byte[] bytes = new byte[30]; // First read in zero bytes r.read(bytes, 0, 0); // Now read in the string int readin = r.read(bytes, 0, 10); // Make sure that the counts are the same assertEquals("abc".getBytes().length, readin); + } + + public void testPreample() throws Exception { + byte[] bytes = "".getBytes("utf-16"); + System.out.println("Preample len is " + bytes.length); } private void compareBytes(String s, String encoding) throws Exception { --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]