harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vladimir Ivanov (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-667) [classlib][io]java.io.BufferedInputStream.skip(int n) unexpected NPE
Date Wed, 28 Jun 2006 05:55:30 GMT
    [ http://issues.apache.org/jira/browse/HARMONY-667?page=comments#action_12418178 ] 

Vladimir Ivanov commented on HARMONY-667:
-----------------------------------------

my patch of BufferedInputStream fix this issue but lead to failure of 50+ unit tests in other
areas with the similar diagnostic:
java.util.MissingResourceException: Stream is closed
        at com.ibm.icu.lang.UCharacter.<clinit>(UCharacter.java:5720)

The affected packages are:
org.apache.harmony.security.tests.asn1.der / 8 tests
org.apache.harmony.security.tests.java.security.cert /4
org.apache.harmony.sql.tests.java.sql  /4
org.apache.harmony.text.tests.java.text  /41
tests.api.java.io  /1

I can't find sources for this class and need a help to investigate this issue.

The failed test, for example, org.apache.harmony.text.tests.java.text.DateFormatTest. 
Output for BEA and Harmony (with patched class j9 and drlvm) is:
C:\tmp\tmp17>C:\jrockit-j2sdk1.4.2_04\bin\java.exe -Xbootclasspath/a:C:\harmony\trunk_0427\modules\text\bin\test;i:/junit.jar
-showversion junit.textui.TestRunner org.apache.harmony.text.tests.java.text.DateFormatTest

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)
................
Time: 1.853

OK (16 tests)



C:\tmp\tmp17>C:\harmony\trunk_0427\deploy\jdk\jre\bin\java.exe -Xbootclasspath/a:C:\harmony\trunk_0427\modules\text\bin\test;i:/junit.jar
-showversion junit.textui.TestRunner org.apache.harmony.text.tests.java.text.DateFormatTest

java version 1.5 (subset)

(c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
..E..............
Time: 1.482
There was 1 error:
1) test_getAvailableLocales(org.apache.harmony.text.tests.java.text.DateFormatTest)java.lang.ExceptionInInitializerError
	at java.lang.J9VMInternals.initialize(J9VMInternals.java:203)
	at com.ibm.icu.text.DecimalFormat.subparse(DecimalFormat.java:1642)
	at com.ibm.icu.text.DecimalFormat.parse(DecimalFormat.java:1468)
	at com.ibm.icu.text.DecimalFormat.parse(DecimalFormat.java:1403)
	at java.text.DecimalFormat.parse(DecimalFormat.java:416)
	at java.text.ChoiceFormat.applyPattern(ChoiceFormat.java:100)
	at java.text.ChoiceFormat.<init>(ChoiceFormat.java:64)
	at com.ibm.icu.text.DecimalFormatSymbols.initialize(DecimalFormatSymbols.java:613)
	at com.ibm.icu.text.DecimalFormatSymbols.<init>(DecimalFormatSymbols.java:58)
	at java.text.DecimalFormat.<init>(DecimalFormat.java:88)
	at java.text.NumberFormat.getInstance(NumberFormat.java:276)
	at java.text.NumberFormat.getNumberInstance(NumberFormat.java:341)
	at java.text.NumberFormat.getInstance(NumberFormat.java:272)
	at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:125)
	at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:118)
	at java.text.DateFormat.getDateTimeInstance(DateFormat.java:361)
	at org.apache.harmony.text.tests.java.text.DateFormatTest.test_getAvailableLocales(DateFormatTest.java:50)
	at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:205)
Caused by: java.util.MissingResourceException: Stream is closed
	at com.ibm.icu.lang.UCharacter.<clinit>(UCharacter.java:5720)
	at java.lang.J9VMInternals.initializeImpl(Native Method)
	at java.lang.J9VMInternals.initialize(J9VMInternals.java:185)
	... 29 more

FAILURES!!!
Tests run: 16,  Failures: 0,  Errors: 1


C:\tmp\tmp17>C:\harmony\drlvm\trunk\build\win_ia32_msvc_release\deploy\jre\bin\ij -Xbootclasspath/a:C:\harmony\trunk_0427\modules\text\bin\test;i:/junit.jar
-showversion junit.textui.TestRunner org.apache.harmony.text.tests.java.text.DateFormatTest

Apache Harmony DRLVM HEAD-4807 (2006-05-02), Windows/ia32/msvc 1310, release

..E..............
Time: 0.741
There was 1 error:
1) test_getAvailableLocales(org.apache.harmony.text.tests.java.text.DateFormatTest)java.lang.ExceptionInInitializerError
	at com.ibm.icu.text.DecimalFormat.subparse(DecimalFormat.java:1642)
	at com.ibm.icu.text.DecimalFormat.parse(DecimalFormat.java:1468)
	at com.ibm.icu.text.DecimalFormat.parse(DecimalFormat.java:1403)
	at java.text.DecimalFormat.parse(DecimalFormat.java:416)
	at java.text.ChoiceFormat.applyPattern(ChoiceFormat.java:100)
	at java.text.ChoiceFormat.<init>(ChoiceFormat.java:64)
	at com.ibm.icu.text.DecimalFormatSymbols.initialize(DecimalFormatSymbols.java:613)
	at com.ibm.icu.text.DecimalFormatSymbols.<init>(DecimalFormatSymbols.java:58)
	at java.text.DecimalFormat.<init>(DecimalFormat.java:88)
	at java.text.NumberFormat.getInstance(NumberFormat.java:276)
	at java.text.NumberFormat.getNumberInstance(NumberFormat.java:341)
	at java.text.NumberFormat.getInstance(NumberFormat.java:272)
	at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:125)
	at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:118)
	at java.text.DateFormat.getDateTimeInstance(DateFormat.java:361)
	at org.apache.harmony.text.tests.java.text.DateFormatTest.test_getAvailableLocales(DateFormatTest.java:50)
	at java.lang.reflect.VMReflection.invokeMethod()
Caused by: java.util.MissingResourceException: Stream is closed
	at com.ibm.icu.lang.UCharacter.<clinit>(UCharacter.java:5720)
	at com.ibm.icu.text.DecimalFormat.subparse(DecimalFormat.java:1642)
	... 28 more

FAILURES!!!
Tests run: 16,  Failures: 0,  Errors: 1



> [classlib][io]java.io.BufferedInputStream.skip(int n) unexpected NPE
> --------------------------------------------------------------------
>
>          Key: HARMONY-667
>          URL: http://issues.apache.org/jira/browse/HARMONY-667
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>     Reporter: Vladimir Ivanov
>     Assignee: Mikhail Loenko
>  Attachments: BufferedInputStream.patch, BufferedInputStreamTest.patch
>
> The java.io.BufferedInputStream.skip(int n) throws unexpected NPE if object was constructed
as BufferedInputStream(null, ...) while RI throws IOException. The same behavior observed
for java.io.BufferedInputStream.close()  too.
> =================== test.java ============================
> import java.io.*;
> public class test {
>    public static void main (String[] args) { 
>             BufferedInputStream buf = new BufferedInputStream(null,5);
>             try {
>                 buf.skip(1);
>             } catch (Exception e) {
>                 e.printStackTrace();
>             }                         
>             try {
>                 buf.close();
>             } catch (Exception e) {
>                 e.printStackTrace();
>             }                         
>    }   
> }
> ======================================================
> Output:
> C:\tmp\tmp17>C:\jrockit-j2sdk1.4.2_04\bin\java.exe -showversion test
> 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)
> java.io.IOException: Stream closed
>         at java.io.BufferedInputStream.ensureOpen()V(BufferedInputStream.java:120)
>         at java.io.BufferedInputStream.skip(J)J(BufferedInputStream.java:296)
>         at test.main([Ljava.lang.String;)V(test.java:7)
> C:\tmp\tmp17>C:\harmony\trunk_0427\deploy\jdk\jre\bin\java.exe -showversion test
> java version 1.5 (subset)
> (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
> java.lang.NullPointerException
>         at java.io.BufferedInputStream.skip(BufferedInputStream.java:339)
>         at test.main(test.java:7)
> java.lang.NullPointerException
>         at java.io.FilterInputStream.close(FilterInputStream.java:68)
>         at java.io.BufferedInputStream.close(BufferedInputStream.java:112)
>         at test.main(test.java:12)
> C:\tmp\tmp17>

-- 
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


Mime
View raw message