java/8433: Static initializers must be able to complete normally
ebb9@email.byu.edu
ebb9@email.byu.edu
Sat Nov 2 17:46:00 GMT 2002
>Number: 8433
>Category: java
>Synopsis: Static initializers must be able to complete normally
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: accepts-illegal
>Submitter-Id: net
>Arrival-Date: Sat Nov 02 17:46:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: ebb9@email.byu.edu
>Release: gcj (GCC) 3.2 20020818 (prerelease)
>Organization:
>Environment:
Configured with: /netrel/src/gcc-3.2-1/configure --enable-languages=c,c++,f77,ja
va --enable-libgcj --enable-threads=posix --with-system-zlib --enable-nls --with
out-included-gettext --enable-interpreter --disable-sjlj-exceptions --disable-ve
rsion-specific-runtime-libs --enable-shared --build=i686-pc-linux --host=i686-pc
-cygwin --target=i686-pc-cygwin --enable-haifa --prefix=/usr --exec-prefix=/usr
--sysconfdir=/etc --libdir=/usr/lib --includedir=/nonexistent/include --libexecd
ir=/usr/sbin
Thread model: posix
gcc version 3.2 20020818 (prerelease)
>Description:
Java forbids static initializers from not being able to complete normally. These two classes should both cause a compile-time error, but gcj accepts them:
class Foo
{
static
{
throw new NullPointerException("nope");
}
}
class Other
{
static
{
while (true);
}
}
>How-To-Repeat:
Compile the two example classes. It should give two compile errors.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the Gcc-prs
mailing list