[jira] Created: (HARMONY-79) java.util.jar.Attributes.put(Object name, Object value) doesn't throw ClassCastException
java.util.jar.Attributes.put(Object name, Object value) doesn't throw ClassCastException Key: HARMONY-79 URL: http://issues.apache.org/jira/browse/HARMONY-79 Project: Harmony Type: Bug Components: Classlib Reporter: Svetlana Samoilenko According to the j2se 1.4 and 1.5 specification method java.util.jar.Attributes.put throws ClassCastException - if the name is not a Attributes.Name or the value is not a String. Harmony doesn't throw ClassCastException 1) if the name is not a Attributes.Name 2) if the value is not a String Code to reproduce: import java.util.jar.Attributes; public class test2 { public static void main(String[] args) { Attributes att=new Attributes(); try { att.put(new Object(), new String() ); } catch ( ClassCastException e) { System.out.println(ClassCastException if the name is not a Attributes.Name ); }; try { att.put(new Attributes.Name(IMPLEMENTATION_VENDOR), new Object()); } catch ( ClassCastException e) { System.out.println(ClassCastException if the value is not a String); return; }; System.out.println(Wrong. Must be ClassCastException); } } Steps to Reproduce: 1. Build Harmony (check-out on 2006-01-30) j2se subset as described in README.txt. 2. Compile test2.java using BEA 1.4 javac javac -d . test2.java 3. Run java using compatible VM (J9) java -showversion test2 Output: C:\tmpC:\jrockit-j2sdk1.4.2_04\bin\java.exe -showversion test2 java version 1.4.2_04 Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) BEA WebLogic JRockit(TM) 1.4.2_04 JVM (build ari-31788-20040616-1132-win-ia32, Native Threads, GC strategy: parallel) ClassCastException if the name is not a Attributes.Name ClassCastException if the value is not a String C:\tmpC:\harmony\trunk\deploy\jre\bin\java -showversion test2 (c) Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable. Wrong. Must be ClassCastException Siggested fix: to change the line 232 in archive/src/main/java/java/util/jar/Attributes.java as follows: 232 return map.put((Name) key, (String) value); Suggested junit test case: AttributesTest.java - import java.util.jar.*; import junit.framework.*; public class AttributesTest extends TestCase { public static void main(String[] args) { junit.textui.TestRunner.run(AttributesTest.class); } public void test_put () { Attributes att=new Attributes(); // ClassCastException if the name is not a Attributes.Name try { att.put(new Object(), new String() ); } catch ( ClassCastException e) { // expected }; //ClassCastException if the value is not a String try { att.put(new Attributes.Name(IMPLEMENTATION_VENDOR), new Object()); } catch ( ClassCastException e) { // expected }; } } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Created: (HARMONY-80) serialVersionUID is missed in org.ietf.jgss.GSSException
serialVersionUID is missed in org.ietf.jgss.GSSException Key: HARMONY-80 URL: http://issues.apache.org/jira/browse/HARMONY-80 Project: Harmony Type: Bug Components: Classlib Reporter: Stepan Mishura Priority: Trivial Attachments: fix.txt According to Java Spec 5.0 serialVersionUID for org.ietf.jgss.GSSException class is -2706218945227726672L. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (HARMONY-80) serialVersionUID is missed in org.ietf.jgss.GSSException
[ http://issues.apache.org/jira/browse/HARMONY-80?page=all ] Stepan Mishura updated HARMONY-80: -- Attachment: fix.txt serialVersionUID is missed in org.ietf.jgss.GSSException Key: HARMONY-80 URL: http://issues.apache.org/jira/browse/HARMONY-80 Project: Harmony Type: Bug Components: Classlib Reporter: Stepan Mishura Priority: Trivial Attachments: fix.txt According to Java Spec 5.0 serialVersionUID for org.ietf.jgss.GSSException class is -2706218945227726672L. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Assigned: (HARMONY-49) java.io.PushBackInputStream throws ArrayIndexOutOfBoundsException instead of IOException
[ http://issues.apache.org/jira/browse/HARMONY-49?page=all ] Tim Ellison reassigned HARMONY-49: -- Assign To: Tim Ellison java.io.PushBackInputStream throws ArrayIndexOutOfBoundsException instead of IOException Key: HARMONY-49 URL: http://issues.apache.org/jira/browse/HARMONY-49 Project: Harmony Type: Bug Components: Classlib Reporter: Vladimir Ivanov Assignee: Tim Ellison Priority: Minor java.io.PushBackInputStream throws ArrayIndexOutOfBoundsException if array length is not enough. Specification says it should be IOException. Code to reproduce: import java.io.*; public class test29 { public static void main(String args[]) { try { new PushbackInputStream( new ByteArrayInputStream(new byte[] { 0 }), 2).unread(new byte[1], 0, 5); } catch (IOException e) { System.out.println(PASSED: + e); } catch (Throwable e) { System.out.println(FAILED: + e); } } } Steps to Reproduce: 1. Build Harmony (check-out on 2006-01-25) j2se subset as described in README.txt. 2. Compile test29.java using BEA 1.4 javac javac -d . test29.java 3. Run java using compatible VM (J9) java -showversion test29 Output: C:\tmp\tmp17C:\jrockit-j2sdk1.4.2_04\bin\java.exe -showversion test29 java version 1.4.2_04 Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) BEA WebLogic JRockit(TM) 1.4.2_04 JVM (build ari-31788-20040616-1132-win-ia32, Native Threads, GC strategy: parallel) PASSED: java.io.IOException: Push back buffer is full C:\tmp\tmp17C:\harmony\trunk\deploy\jre\bin\java -showversion test29 java version 1.4.2 (subset) (c) Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable. FAILED: java.lang.ArrayIndexOutOfBoundsException C:\tmp\tmp17 junit test: PushBackInputStreamTest.java -- import java.io.*; import junit.framework.*; public class PushBackInputStreamTest extends TestCase { public void testUnread() { try { new PushbackInputStream( new ByteArrayInputStream(new byte[] { 0 }), 2).unread(new byte[1], 0, 5); } catch (IOException e) { } catch (Throwable e) { fail(unexpected exception: + e); } } public static void main(String[] args) { junit.textui.TestRunner.run(PushBackInputStreamTest.class); } } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Resolved: (HARMONY-49) java.io.PushBackInputStream throws ArrayIndexOutOfBoundsException instead of IOException
[ http://issues.apache.org/jira/browse/HARMONY-49?page=all ] Tim Ellison resolved HARMONY-49: Resolution: Fixed Vladimir, Fixed in LUNI at repo revision 375577 - java.io.PushbackInputStream - java.io.PushbackReader Please check that this fully resolves your problem. java.io.PushBackInputStream throws ArrayIndexOutOfBoundsException instead of IOException Key: HARMONY-49 URL: http://issues.apache.org/jira/browse/HARMONY-49 Project: Harmony Type: Bug Components: Classlib Reporter: Vladimir Ivanov Assignee: Tim Ellison Priority: Minor java.io.PushBackInputStream throws ArrayIndexOutOfBoundsException if array length is not enough. Specification says it should be IOException. Code to reproduce: import java.io.*; public class test29 { public static void main(String args[]) { try { new PushbackInputStream( new ByteArrayInputStream(new byte[] { 0 }), 2).unread(new byte[1], 0, 5); } catch (IOException e) { System.out.println(PASSED: + e); } catch (Throwable e) { System.out.println(FAILED: + e); } } } Steps to Reproduce: 1. Build Harmony (check-out on 2006-01-25) j2se subset as described in README.txt. 2. Compile test29.java using BEA 1.4 javac javac -d . test29.java 3. Run java using compatible VM (J9) java -showversion test29 Output: C:\tmp\tmp17C:\jrockit-j2sdk1.4.2_04\bin\java.exe -showversion test29 java version 1.4.2_04 Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) BEA WebLogic JRockit(TM) 1.4.2_04 JVM (build ari-31788-20040616-1132-win-ia32, Native Threads, GC strategy: parallel) PASSED: java.io.IOException: Push back buffer is full C:\tmp\tmp17C:\harmony\trunk\deploy\jre\bin\java -showversion test29 java version 1.4.2 (subset) (c) Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable. FAILED: java.lang.ArrayIndexOutOfBoundsException C:\tmp\tmp17 junit test: PushBackInputStreamTest.java -- import java.io.*; import junit.framework.*; public class PushBackInputStreamTest extends TestCase { public void testUnread() { try { new PushbackInputStream( new ByteArrayInputStream(new byte[] { 0 }), 2).unread(new byte[1], 0, 5); } catch (IOException e) { } catch (Throwable e) { fail(unexpected exception: + e); } } public static void main(String[] args) { junit.textui.TestRunner.run(PushBackInputStreamTest.class); } } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (HARMONY-61) java.net.InetAddress.getByAddress(null) throws NPE insread of UnknownHostException
[ http://issues.apache.org/jira/browse/HARMONY-61?page=comments#action_12365422 ] Svetlana Samoilenko commented on HARMONY-61: Tim, I used revision 375338 and the problem resolved as expected. Output is: ***OK. Expected UnknownHostException. java.net.UnknownHostException: Invalid IP Address is neither 4 or 16 bytes Thanks a lot for quick response. java.net.InetAddress.getByAddress(null) throws NPE insread of UnknownHostException -- Key: HARMONY-61 URL: http://issues.apache.org/jira/browse/HARMONY-61 Project: Harmony Type: Bug Components: Classlib Reporter: Svetlana Samoilenko Assignee: Tim Ellison According to j2se 1.4.2 specification for java.net.InetAddress.getByAddress(byte[] addr) the method must throw UnknownHostException if IP address is of illegal length. IPv4 address byte array must be 4 bytes long and IPv6 byte array must be 16 bytes long. There is no mention about NPE at all. Mentions about NPE in case of null argument were not found in java.net package specification. The test listed below shows that getByAddress (null) throws NPE. BEA throws UnknownHostException. Code to reproduce: import java.net.*; public class test2 { public static void main (String[] args) { try { InetAddress.getByAddress (null); } catch (UnknownHostException e) { System.out.println(***OK. Expected UnknownHostException. + e); } } } Steps to Reproduce: 1. Build Harmony (check-out on 2006-01-30) j2se subset as described in README.txt. 2. Compile test2.java using BEA 1.4 javac javac -d . test2.java 3. Run java using compatible VM (J9) java -showversion test2 Output: C:\tmpC:\jrockit-j2sdk1.4.2_04\bin\java.exe -showversion test2 java version 1.4.2_04 Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) BEA WebLogic JRockit(TM) 1.4.2_04 JVM (build ari-31788-20040616-1132-win-ia32, Native Threads, GC strategy: parallel) ***OK. UnknownHostException=:java.net.UnknownHostException: addr is of illegal length C:\tmpC:\harmony\trunk\deploy\jre\bin\java -showversion test2 (c) Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable. java.lang.NullPointerException at java.net.InetAddress.getByAddress(InetAddress.java:735) at java.net.InetAddress.getByAddress(InetAddress.java:713) at test2.main(test2.java:7) Suggested junit test case: InetAddressTest.java - import java.net.*; import junit.framework.*; public class InetAddressTest extends TestCase { public static void main(String[] args) { junit.textui.TestRunner.run(InetAddressTest.class); } public void test_getByAddress() { try { InetAddress.getByAddress (null); fail(Assert 0: UnknownHostException must be thrown); } catch (UnknownHostException e) { } } } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Assigned: (HARMONY-54) java.io.BufferedReader.read(null,int off,int len) does not throw NPE when len==0
[ http://issues.apache.org/jira/browse/HARMONY-54?page=all ] Tim Ellison reassigned HARMONY-54: -- Assign To: Tim Ellison java.io.BufferedReader.read(null,int off,int len) does not throw NPE when len==0 Key: HARMONY-54 URL: http://issues.apache.org/jira/browse/HARMONY-54 Project: Harmony Type: Bug Components: Classlib Reporter: Vladimir Ivanov Assignee: Tim Ellison Attachments: BufferedReaderTest.java In java.io package description j2se 1.4.2 specification says, that unless otherwise noted, passing a null argument to a constructor or method in any class or interface in this package will cause a NullPointerException to be thrown. But java.io.BufferedReader.read(null,int off,int len) does not throw NPE when len==0 Code to reproduce: import java.io.*; public class test29 { public static void main(String[] args) { char []ch = {}; char [] s = null; BufferedReader toRet = new BufferedReader(new CharArrayReader(ch)); try { System.out.println(read(s, 1, 0)= + toRet.read(s, 1, 0)); } catch (Exception t) { System.out.println(Exception: + t); } try { System.out.println(read(s, 1, 1)= + toRet.read(s, 1, 1)); } catch (Exception t) { System.out.println(Exception: + t); } } } Steps to Reproduce: 1. Build Harmony (check-out on 2006-01-30) j2se subset as described in README.txt. 2. Compile test29.java using BEA 1.4 javac javac -d . test29.java 3. Run java using compatible VM (J9) java -showversion test29 Output: C:\tmp\tmp17C:\jrockit-j2sdk1.4.2_04\bin\java.exe -showversion test29 java version 1.4.2_04 Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) BEA WebLogic JRockit(TM) 1.4.2_04 JVM (build ari-31788-20040616-1132-win-ia32, Native Threads, GC strategy: parallel) Exception: java.lang.NullPointerException Exception: java.lang.NullPointerException C:\tmp\tmp17C:\harmony\trunk\deploy\jre\bin\java -showversion test29 java version 1.4.2 (subset) (c) Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable. read(s, 1, 0)= 0 Exception: java.lang.NullPointerException C:\tmp\tmp17 junit test: BufferedReaderTest.java - import java.io.*; import junit.framework.*; public class BufferedReaderTest extends TestCase { public static void main(String[] args) { junit.textui.TestRunner.run(BufferedReaderTest.class); } public void testHashCode() { char []ch = {}; BufferedReader toRet = new BufferedReader(new CharArrayReader(ch)); try { toRet.read(null, 1, 0); fail(NullPointerException expected); } catch (NullPointerException e) { } catch (Exception e) { fail(Unexpected exception: + e); } } } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (HARMONY-60) java.net.URL.getHost() must return the IPv6 address enclosed in square brackets
[ http://issues.apache.org/jira/browse/HARMONY-60?page=comments#action_12365424 ] Svetlana Samoilenko commented on HARMONY-60: Tim, I used revision 375380 and the IP6 address in [ ] now. Test output is: **OK, host is in square brackets=[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210] Actually, it is BEA bug, they assume that, for example, http://google.com/; is a IPV6 address, presumably because it contains ':'. it is just incorrect host address, but URL should not complain unlike URI. It would be better to check that it is real correct IP6 address, but may be we should copy all BEA bugs for compatibility ;) ? java.net.URL.getHost() must return the IPv6 address enclosed in square brackets --- Key: HARMONY-60 URL: http://issues.apache.org/jira/browse/HARMONY-60 Project: Harmony Type: Bug Components: Classlib Reporter: Svetlana Samoilenko Assignee: Tim Ellison According to j2se 1.4.2 specification for java.net.URL.getHost() the method must return the IPv6 address enclosed in square brackets ('[' and ']'). The test listed below shows an absence of square brackets for the IPv6 address. Code to reproduce: import java.net.*; public class test2 { public static void main(String[] args) { URL url=null; String protocol = http; int port = -1; String host = FEDC:BA98:7654:3210:FEDC:BA98:7654:3210; String file = myFile; try { url = new URL(protocol,host,port,file); } catch (Exception e) { System.out.println(URL.URL(protocol,host,port,file) caused: + e); return; } if (url.getHost().equals([+host+])) { System.out.println(OK, host is in square brackets=+url.getHost()); } else { System.out.println(Incorrect, host is not in square brackets=+url.getHost()); } } } Steps to Reproduce: 1. Build Harmony (check-out on 2006-01-30) j2se subset as described in README.txt. 2. Compile test2.java using BEA 1.4 javac javac -d . test2.java 3. Run java using compatible VM (J9) java -showversion test2 Output: C:\tmpC:\jrockit-j2sdk1.4.2_04\bin\java.exe -showversion test2 java version 1.4.2_04 Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) BEA WebLogic JRockit(TM) 1.4.2_04 JVM (build ari-31788-20040616-1132-win-ia32, Native Threads, GC strategy: parallel) ***OK, host is in square brackets=[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210] C:\tmpC:\harmony\trunk\deploy\jre\bin\java -showversion test2 (c) Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable. ***Incorrect, host is not in square brackets=FEDC:BA98:7654:3210:FEDC:BA98:7654:3210 Suggested junit test case: URLTest.java - import java.net.*; import junit.framework.*; public class URLTest extends TestCase { public static void main(String[] args) { junit.textui.TestRunner.run(URLTest.class); } public void test_getHost() { URL url=null; String protocol = http; int port = -1; String host = FEDC:BA98:7654:3210:FEDC:BA98:7654:3210; String file = myFile; try { url = new URL(protocol,host,port,file); } catch (Exception e) { fail(Assert 0: URL.URL(protocol,host,port,file) caused: + e); } assertEquals (([+host+]), url.getHost()); } } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Resolved: (HARMONY-54) java.io.BufferedReader.read(null,int off,int len) does not throw NPE when len==0
[ http://issues.apache.org/jira/browse/HARMONY-54?page=all ] Tim Ellison resolved HARMONY-54: Resolution: Fixed Vladimir, Fixed in LUNI java.io.BufferedReader at repo revision 375584. Please check this fully resolves your problem. java.io.BufferedReader.read(null,int off,int len) does not throw NPE when len==0 Key: HARMONY-54 URL: http://issues.apache.org/jira/browse/HARMONY-54 Project: Harmony Type: Bug Components: Classlib Reporter: Vladimir Ivanov Assignee: Tim Ellison Attachments: BufferedReaderTest.java In java.io package description j2se 1.4.2 specification says, that unless otherwise noted, passing a null argument to a constructor or method in any class or interface in this package will cause a NullPointerException to be thrown. But java.io.BufferedReader.read(null,int off,int len) does not throw NPE when len==0 Code to reproduce: import java.io.*; public class test29 { public static void main(String[] args) { char []ch = {}; char [] s = null; BufferedReader toRet = new BufferedReader(new CharArrayReader(ch)); try { System.out.println(read(s, 1, 0)= + toRet.read(s, 1, 0)); } catch (Exception t) { System.out.println(Exception: + t); } try { System.out.println(read(s, 1, 1)= + toRet.read(s, 1, 1)); } catch (Exception t) { System.out.println(Exception: + t); } } } Steps to Reproduce: 1. Build Harmony (check-out on 2006-01-30) j2se subset as described in README.txt. 2. Compile test29.java using BEA 1.4 javac javac -d . test29.java 3. Run java using compatible VM (J9) java -showversion test29 Output: C:\tmp\tmp17C:\jrockit-j2sdk1.4.2_04\bin\java.exe -showversion test29 java version 1.4.2_04 Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) BEA WebLogic JRockit(TM) 1.4.2_04 JVM (build ari-31788-20040616-1132-win-ia32, Native Threads, GC strategy: parallel) Exception: java.lang.NullPointerException Exception: java.lang.NullPointerException C:\tmp\tmp17C:\harmony\trunk\deploy\jre\bin\java -showversion test29 java version 1.4.2 (subset) (c) Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable. read(s, 1, 0)= 0 Exception: java.lang.NullPointerException C:\tmp\tmp17 junit test: BufferedReaderTest.java - import java.io.*; import junit.framework.*; public class BufferedReaderTest extends TestCase { public static void main(String[] args) { junit.textui.TestRunner.run(BufferedReaderTest.class); } public void testHashCode() { char []ch = {}; BufferedReader toRet = new BufferedReader(new CharArrayReader(ch)); try { toRet.read(null, 1, 0); fail(NullPointerException expected); } catch (NullPointerException e) { } catch (Exception e) { fail(Unexpected exception: + e); } } } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Assigned: (HARMONY-46) Constructor java.io.File(String) creates object with incorrect name if one-letter name is followed by file separator char
[ http://issues.apache.org/jira/browse/HARMONY-46?page=all ] Tim Ellison reassigned HARMONY-46: -- Assign To: Tim Ellison Constructor java.io.File(String) creates object with incorrect name if one-letter name is followed by file separator char -- Key: HARMONY-46 URL: http://issues.apache.org/jira/browse/HARMONY-46 Project: Harmony Type: Bug Components: Classlib Reporter: Vladimir Ivanov Assignee: Tim Ellison Constructor java.io.File(String) creates object with incorrect name if one-letter name is followed by file separator char. Code to reproduce: import java.io.*; public class test29 { public static void main(String args[]) throws Exception { File f1 = new File(a); File f2 = new File(a/); File f3 = new File(a\\); File f4 = new File(aa/); System.out.println(f1 name: + f1.getName() + \nf2 name: + f2.getName() + \nf3 name: + f3.getName() + \nf4 name: + f4.getName()); System.out.println(f1.equals(f2) ? PASSED : FAILED); } } Steps to Reproduce: 1. Build Harmony (check-out on 2006-01-25) j2se subset as described in README.txt. 2. Compile test29.java using BEA 1.4 javac javac -d . test29.java 3. Run java using compatible VM (J9) java -showversion test29 Output: C:\tmp\tmp17C:\harmony\trunk\deploy\jre\bin\java -showversion test29 java version 1.4.2 (subset) (c) Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable. f1 name: a f2 name: f3 name: f4 name: aa FAILED C:\tmp\tmp17C:\jrockit-j2sdk1.4.2_04\bin\java.exe -showversion test29 java version 1.4.2_04 Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) BEA WebLogic JRockit(TM) 1.4.2_04 JVM (build ari-31788-20040616-1132-win-ia32, Native Threads, GC strategy: parallel) f1 name: a f2 name: a f3 name: a f4 name: aa PASSED C:\tmp\tmp17 junit test: FileTest.java - import java.io.*; import junit.framework.*; public class FileTest extends TestCase { public void testFile_String() { File f1 = new File(a); File f2 = new File(a/); assertTrue(File name is incorrect! + f1.getName() + != + f2.getName(), f1.equals(f2)); } public static void main(String[] args) { junit.textui.TestRunner.run(FileTest.class); } } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (HARMONY-56) java.net.InetAddress.getAllByName(null) throws UnknownHostException instead of valid InetAddress
[ http://issues.apache.org/jira/browse/HARMONY-56?page=comments#action_12365427 ] Svetlana Samoilenko commented on HARMONY-56: Tim, I used revision 375576 and all works fine. Test output is: ***InetAddress.getAllByName(null)[0] returned localhost/127.0.0.1 Thank you. java.net.InetAddress.getAllByName(null) throws UnknownHostException instead of valid InetAddress Key: HARMONY-56 URL: http://issues.apache.org/jira/browse/HARMONY-56 Project: Harmony Type: Bug Components: Classlib Reporter: Svetlana Samoilenko Assignee: Tim Ellison According to j2se 1.4.2 specification java.net.InetAddress.getAllByName(String host) method allows a host is null. In this case the InetAddress representing an address of the loopback interface is returned. But as we can see from the test listed below java.net.InetAddress.getAllByName(null) throws UnknownHostException instead of valid InetAddress. Code to reproduce: import java.net.*; public class test2 { public static void main (String[] args) { try { InetAddress[] ia = InetAddress.getAllByName(null); for (int i = 0; iia.length; i++) { System.out.println(***InetAddress.getAllByName(null)[+i+] returned + ia[i]); } } catch (Exception e) { System.out.println(***Unexpected exception: + e); } } } Steps to Reproduce: 1. Build Harmony (check-out on 2006-01-30) j2se subset as described in README.txt. 2. Compile test2.java using BEA 1.4 javac javac -d . test2.java 3. Run java using compatible VM (J9) java -showversion test2 Output: C:\tmpC:\jrockit-j2sdk1.4.2_04\bin\java.exe -showversion test2 java version 1.4.2_04 Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) BEA WebLogic JRockit(TM) 1.4.2_04 JVM (build ari-31788-20040616-1132-win-ia32, Native Threads, GC strategy: parallel) ***InetAddress.getAllByName(null)[0] returned localhost/127.0.0.1 C:\tmpC:\harmony\trunk\deploy\jre\bin\java -showversion test2 (c) Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable. ***Unexpected exception:java.net.UnknownHostException: No host name provided Suggested junit test case: InetAddressTest.java - import java.net.*; import junit.framework.*; public class InetAddressTest extends TestCase { public static void main(String[] args) { junit.textui.TestRunner.run(InetAddressTest.class); } public void test_getAllByName() { try { InetAddress[] ia = InetAddress.getAllByName(null); assertEquals (Assert 0: getAllByName() returns incorrect value + ia[0].toString(),localhost/127.0.0.1,ia[0].toString()); } catch (Exception e) { fail(Assert 1: Unexpected exception: + e); } } } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Resolved: (HARMONY-46) Constructor java.io.File(String) creates object with incorrect name if one-letter name is followed by file separator char
[ http://issues.apache.org/jira/browse/HARMONY-46?page=all ] Tim Ellison resolved HARMONY-46: Resolution: Fixed Vladimir, Fixed in LUNI java.io.File at repo revision 375590. Please check that this fully resolves your problem. Constructor java.io.File(String) creates object with incorrect name if one-letter name is followed by file separator char -- Key: HARMONY-46 URL: http://issues.apache.org/jira/browse/HARMONY-46 Project: Harmony Type: Bug Components: Classlib Reporter: Vladimir Ivanov Assignee: Tim Ellison Constructor java.io.File(String) creates object with incorrect name if one-letter name is followed by file separator char. Code to reproduce: import java.io.*; public class test29 { public static void main(String args[]) throws Exception { File f1 = new File(a); File f2 = new File(a/); File f3 = new File(a\\); File f4 = new File(aa/); System.out.println(f1 name: + f1.getName() + \nf2 name: + f2.getName() + \nf3 name: + f3.getName() + \nf4 name: + f4.getName()); System.out.println(f1.equals(f2) ? PASSED : FAILED); } } Steps to Reproduce: 1. Build Harmony (check-out on 2006-01-25) j2se subset as described in README.txt. 2. Compile test29.java using BEA 1.4 javac javac -d . test29.java 3. Run java using compatible VM (J9) java -showversion test29 Output: C:\tmp\tmp17C:\harmony\trunk\deploy\jre\bin\java -showversion test29 java version 1.4.2 (subset) (c) Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable. f1 name: a f2 name: f3 name: f4 name: aa FAILED C:\tmp\tmp17C:\jrockit-j2sdk1.4.2_04\bin\java.exe -showversion test29 java version 1.4.2_04 Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) BEA WebLogic JRockit(TM) 1.4.2_04 JVM (build ari-31788-20040616-1132-win-ia32, Native Threads, GC strategy: parallel) f1 name: a f2 name: a f3 name: a f4 name: aa PASSED C:\tmp\tmp17 junit test: FileTest.java - import java.io.*; import junit.framework.*; public class FileTest extends TestCase { public void testFile_String() { File f1 = new File(a); File f2 = new File(a/); assertTrue(File name is incorrect! + f1.getName() + != + f2.getName(), f1.equals(f2)); } public static void main(String[] args) { junit.textui.TestRunner.run(FileTest.class); } } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Closed: (HARMONY-60) java.net.URL.getHost() must return the IPv6 address enclosed in square brackets
[ http://issues.apache.org/jira/browse/HARMONY-60?page=all ] Tim Ellison closed HARMONY-60: -- Verified by Svetlana. I agree that behavior is likely unintentional -- but harmony now does the same thing (hopefully nobody would rely on that, and if it is fixed in the reference our regression test will find it now). java.net.URL.getHost() must return the IPv6 address enclosed in square brackets --- Key: HARMONY-60 URL: http://issues.apache.org/jira/browse/HARMONY-60 Project: Harmony Type: Bug Components: Classlib Reporter: Svetlana Samoilenko Assignee: Tim Ellison According to j2se 1.4.2 specification for java.net.URL.getHost() the method must return the IPv6 address enclosed in square brackets ('[' and ']'). The test listed below shows an absence of square brackets for the IPv6 address. Code to reproduce: import java.net.*; public class test2 { public static void main(String[] args) { URL url=null; String protocol = http; int port = -1; String host = FEDC:BA98:7654:3210:FEDC:BA98:7654:3210; String file = myFile; try { url = new URL(protocol,host,port,file); } catch (Exception e) { System.out.println(URL.URL(protocol,host,port,file) caused: + e); return; } if (url.getHost().equals([+host+])) { System.out.println(OK, host is in square brackets=+url.getHost()); } else { System.out.println(Incorrect, host is not in square brackets=+url.getHost()); } } } Steps to Reproduce: 1. Build Harmony (check-out on 2006-01-30) j2se subset as described in README.txt. 2. Compile test2.java using BEA 1.4 javac javac -d . test2.java 3. Run java using compatible VM (J9) java -showversion test2 Output: C:\tmpC:\jrockit-j2sdk1.4.2_04\bin\java.exe -showversion test2 java version 1.4.2_04 Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) BEA WebLogic JRockit(TM) 1.4.2_04 JVM (build ari-31788-20040616-1132-win-ia32, Native Threads, GC strategy: parallel) ***OK, host is in square brackets=[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210] C:\tmpC:\harmony\trunk\deploy\jre\bin\java -showversion test2 (c) Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable. ***Incorrect, host is not in square brackets=FEDC:BA98:7654:3210:FEDC:BA98:7654:3210 Suggested junit test case: URLTest.java - import java.net.*; import junit.framework.*; public class URLTest extends TestCase { public static void main(String[] args) { junit.textui.TestRunner.run(URLTest.class); } public void test_getHost() { URL url=null; String protocol = http; int port = -1; String host = FEDC:BA98:7654:3210:FEDC:BA98:7654:3210; String file = myFile; try { url = new URL(protocol,host,port,file); } catch (Exception e) { fail(Assert 0: URL.URL(protocol,host,port,file) caused: + e); } assertEquals (([+host+]), url.getHost()); } } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (HARMONY-42) com.ibm.io.nio.FileChannel is not fully implemented
[ http://issues.apache.org/jira/browse/HARMONY-42?page=all ] Richard Liang updated HARMONY-42: - Attachment: FileChannel_patch.zip Hello Tim, Finally, The refactor of FileChannel and related classes are completed :-), as well as some modification about some native code (OS File system and OS Memory system). Would you please help to verify my patches? Thanks a lot. Hopefully, I will post my test cases soon :-) com.ibm.io.nio.FileChannel is not fully implemented --- Key: HARMONY-42 URL: http://issues.apache.org/jira/browse/HARMONY-42 Project: Harmony Type: Bug Components: Classlib Reporter: Paulex Yang Assignee: Tim Ellison Attachments: FileChannel_patch.zip, Harmony42-IFileSystem-patch.txt, Harmony42-IMemorySystem-patch.txt, Harmony42-java_io_FileChannelFactory-patch.txt, Harmony42-java_io_FileOutputStream-patch.txt, IFileSystem.java Many functions of FileChannel, such as memory map, transfer, gathering/scattering I/O are not implemented. Further, three classes in java.io, FileInputStream FileOutputStream, and RandomAccessFile, are related to java.nio.FileChannel, so that they can be refactored to base on same JNI interface, just like the network channels and sockets. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
Re: [vote] Acceptance of HARMONY-39 : Contribution of beans, regex and math class library code
Well, I was using zip included with the cygwin distribution, this could be the issue. It seems like it produces zip file which has a difference in one byte compared to the similar file produced by zip at my Linux machine (it was SuSE9 i586). BTW: is there any way to replace a file at JIRA issue? What will happen if I just upload the file with the same name? What software are you using? Have you tried using 'jar'? That should be pretty cross-platform... I wouldn't speculate on that, but... I have a strong feeling that both zip and jar utilities are likely to have the same core - zlib library, hence the luck of creating equal zip files is likely to depend on it's portability anyways :). Thank you, Andrey Chernyshev Intel Middleware Products Division On 2/6/06, Geir Magnusson Jr [EMAIL PROTECTED] wrote: We're trying... Leo Simons wrote: On Mon, Feb 06, 2006 at 04:39:27PM +0300, Andrey Chernyshev wrote: I'm sorry about the broken archive, but... it looks to me strange - I can download and unpack it successfully both on my Windows and Linux boxes (sorry, I have no Mac in my hands at the moment to check). What software are you using? Have you tried using 'jar'? That should be pretty cross-platform... Anyways, I have attached the gtar-ed archive (see https://issues.apache.org/jira/secure/attachment/12322666/regex_beans_math_src_20060120_1845-Harmony.tgz), hopefully either one or another bundle will work for the everyone. Please let me know if there are still difficulties extracting the contents. Well I'm getting 503 service temporarily unavailable but there's hardly anything you can do about that. Lets gope infra@ gets jira back up soon :-) cheers, Leo
Re: [vote] Acceptance of HARMONY-39 : Contribution of beans, regex and math class library code
+1. Thanks for the tarball! Leo On Thu, Feb 02, 2006 at 06:36:48AM -0800, Geir Magnusson Jr wrote: I have received the ACQs and the BCC for Harmony-39, so I can assert that the critical provenance paperwork is in order (although not in SVN yet). Please vote to accept or reject this codebase into the Apache Harmony class library : [ ] + 1 Accept [ ] -1 Reject (provide reason below Lets let this run 3 days unless a) someone states they need more time or b) we get all committer votes before then. Go... geir