bug-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug classpath/26108] New: reader.readLine() returns null while reader.r


From: egon dot willighagen at gmail dot com
Subject: [Bug classpath/26108] New: reader.readLine() returns null while reader.ready() returns true
Date: 5 Feb 2006 18:20:51 -0000

cc: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=351551

When I run a CDK based test suite [1], the "OpenSource JVM Test Suite", I get a
NullPointerException, because of this situation:

- reader.ready() returns true
- a subsequent reader.readLine() returns null

The code I deduce this from is:

    protected void loadClassList(String classList) throws Exception {
        classesToTest = new Vector();

        // get the src/core.javafiles file
        BufferedReader reader = new BufferedReader(new InputStreamReader(
            this.getClass().getClassLoader().getResourceAsStream(classList)
        ));
        while (reader.ready()) {
            // load them one by one
            String rawClassName = reader.readLine();
            rawClassName = rawClassName.substring(20);
            String className = convertSlash2Dot(
                rawClassName.substring(0, rawClassName.indexOf('.'))
            );
            classesToTest.add(className);
        }
    }

The NullPointerException occurs on this line:

rawClassName = rawClassName.substring(20);

Because rawClassName is null.

This happens with cacao and jamvm, but not with kaffe, so seems a Classpath
problem.

Egon


-- 
           Summary: reader.readLine() returns null while reader.ready()
                    returns true
           Product: classpath
           Version: 0.20
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: classpath
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: egon dot willighagen at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26108





reply via email to

[Prev in Thread] Current Thread [Next in Thread]