This is the mail archive of the java-prs@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug java/20338] New: Program compiled with gcj crashes when accessing private static method from nested class


Here's very simple example of class that compiles fine but crashes during
execution. It has something to do with "private" modifier in method of nested
class - after removing "private" the problem disappears.

$ cat Outer.java
public class Outer {
    public static void main(String[] args) {
        Nested.test();
    }

    static class Nested {
        private static void test() {
            System.out.println("test");
        }
    }
}
$ gcj-4.0 -o outer --main=Outer Outer.java
$ ./outer
Exception in thread "main" java.lang.NullPointerException
   at gnu.gcj.convert.Output_8859_1.write(java.lang.String, int, int, char[])
(/usr/lib/libgcj.so.6.0.0)
   at java.io.PrintStream.writeChars(java.lang.String, int, int)
(/usr/lib/libgcj.so.6.0.0)
   at java.io.PrintStream.print(java.lang.String, boolean)
(/usr/lib/libgcj.so.6.0.0)
   at java.io.PrintStream.println(java.lang.String) (/usr/lib/libgcj.so.6.0.0)
   at Outer$Nested.test() (Unknown Source)
   at Outer.main(java.lang.String[]) (Unknown Source)

-- 
           Summary: Program compiled with gcj crashes when accessing private
                    static method from nested class
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: java
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: zbigniew at chyla dot homeip dot net
                CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
                    dot org


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]