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]

java/8433: Static initializers must be able to complete normally


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


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