This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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/20302] New: Problem with sub classes with contructors with exceptions


GCJ does not handle compilation of sub classes with out explicitly defined
constructors to override the super class constructors when the constructors
throw exceptions.

[steve@helios steve]$ gcj Test.java -c Test.o
Test.java: In class 'Test$1':
Test.java: In constructor '(Test,java.io.ByteArrayInputStream)':
Test.java:9: error: Exception 'java.io.IOException' must be caught, or it must
be declared in the 'throws' clause of 'Test$1'.
           ObjectInputStream in = new ObjectInputStream(is)
                                                          ^
Test.java:9: error: Exception 'java.io.StreamCorruptedException' must be caught,
or it must be declared in the 'throws' clause of 'Test$1'.
           ObjectInputStream in = new ObjectInputStream(is)
                                                          ^
2 errors
[steve@helios steve]$ gcj Test2.java -c Test2.o
Test2.java: In class 'Test2':
Test2.java: In constructor '()':
Test2.java:3: error: Exception 'java.io.IOException' must be caught, or it must
be declared in the 'throws' clause of 'Test2'.
   class Test2 extends ObjectInputStream
        ^
1 error

-- 
           Summary: Problem with sub classes with contructors with
                    exceptions
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: java
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: steve at netfuel dot com
                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=20302


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