diff options
author | Tom Tromey <tromey@cygnus.com> | 2000-06-18 22:14:06 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2000-06-18 22:14:06 +0000 |
commit | d4d17e95f1b281a9db1c727870350206c77f0103 (patch) | |
tree | 9ccdcb530d815d09f19c1ab07bfd54136d0b2e85 | |
parent | 3b572406c28259bb8dbc1767937bcd965a64b18e (diff) | |
download | gcc-d4d17e95f1b281a9db1c727870350206c77f0103.zip gcc-d4d17e95f1b281a9db1c727870350206c77f0103.tar.gz gcc-d4d17e95f1b281a9db1c727870350206c77f0103.tar.bz2 |
re GNATS gcj/260 ("Klass.class" expression should cause Klass to be initialized)
* java/lang/natClass.cc (forName): Removed dead code. Initialize
returned class. For PR gcj/260.
From-SVN: r34590
-rw-r--r-- | libjava/ChangeLog | 5 | ||||
-rw-r--r-- | libjava/Makefile.in | 62 | ||||
-rw-r--r-- | libjava/java/lang/natClass.cc | 13 |
3 files changed, 24 insertions, 56 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index befafdd..2291722 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,8 @@ +2000-06-18 Tom Tromey <tromey@cygnus.com> + + * java/lang/natClass.cc (forName): Removed dead code. Initialize + returned class. For PR gcj/260. + 2000-06-16 Tom Tromey <tromey@cygnus.com> Fix for PR libgcj/261: diff --git a/libjava/Makefile.in b/libjava/Makefile.in index b913f9e..c7155e6 100644 --- a/libjava/Makefile.in +++ b/libjava/Makefile.in @@ -920,9 +920,8 @@ LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ DATA = $(data_DATA) $(toolexeclib_DATA) DIST_COMMON = README COPYING ChangeLog Makefile.am Makefile.in NEWS \ -THANKS acconfig.h acinclude.m4 aclocal.m4 configure configure.in \ -include/config.h.in include/stamp-h.in libgcj-test.spec.in \ -libgcj.spec.in +THANKS acinclude.m4 aclocal.m4 configure configure.in \ +libgcj-test.spec.in libgcj.spec.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) @@ -1308,34 +1307,6 @@ config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) cd $(srcdir) && $(AUTOCONF) - -include/config.h: include/stamp-h - @if test ! -f $@; then \ - rm -f include/stamp-h; \ - $(MAKE) include/stamp-h; \ - else :; fi -include/stamp-h: $(srcdir)/include/config.h.in $(top_builddir)/config.status - cd $(top_builddir) \ - && CONFIG_FILES= CONFIG_HEADERS=include/config.h \ - $(SHELL) ./config.status - @echo timestamp > include/stamp-h 2> /dev/null -$(srcdir)/include/config.h.in: @MAINTAINER_MODE_TRUE@$(srcdir)/include/stamp-h.in - @if test ! -f $@; then \ - rm -f $(srcdir)/include/stamp-h.in; \ - $(MAKE) $(srcdir)/include/stamp-h.in; \ - else :; fi -$(srcdir)/include/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h - cd $(top_srcdir) && $(AUTOHEADER) - @echo timestamp > $(srcdir)/include/stamp-h.in 2> /dev/null - -mostlyclean-hdr: - -clean-hdr: - -distclean-hdr: - -rm -f include/config.h - -maintainer-clean-hdr: libgcj.spec: $(top_builddir)/config.status libgcj.spec.in cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status libgcj-test.spec: $(top_builddir)/config.status libgcj-test.spec.in @@ -1798,33 +1769,31 @@ distclean-generic: -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: -mostlyclean-am: mostlyclean-hdr mostlyclean-toolexeclibLIBRARIES \ - mostlyclean-compile mostlyclean-libtool \ - mostlyclean-toolexeclibLTLIBRARIES \ +mostlyclean-am: mostlyclean-toolexeclibLIBRARIES mostlyclean-compile \ + mostlyclean-libtool mostlyclean-toolexeclibLTLIBRARIES \ mostlyclean-binPROGRAMS mostlyclean-noinstPROGRAMS \ mostlyclean-tags mostlyclean-depend mostlyclean-generic mostlyclean: mostlyclean-recursive -clean-am: clean-hdr clean-toolexeclibLIBRARIES clean-compile \ - clean-libtool clean-toolexeclibLTLIBRARIES \ - clean-binPROGRAMS clean-noinstPROGRAMS clean-tags \ - clean-depend clean-generic mostlyclean-am clean-local +clean-am: clean-toolexeclibLIBRARIES clean-compile clean-libtool \ + clean-toolexeclibLTLIBRARIES clean-binPROGRAMS \ + clean-noinstPROGRAMS clean-tags clean-depend \ + clean-generic mostlyclean-am clean-local clean: clean-recursive -distclean-am: distclean-hdr distclean-toolexeclibLIBRARIES \ - distclean-compile distclean-libtool \ - distclean-toolexeclibLTLIBRARIES distclean-binPROGRAMS \ - distclean-noinstPROGRAMS distclean-tags \ - distclean-depend distclean-generic clean-am +distclean-am: distclean-toolexeclibLIBRARIES distclean-compile \ + distclean-libtool distclean-toolexeclibLTLIBRARIES \ + distclean-binPROGRAMS distclean-noinstPROGRAMS \ + distclean-tags distclean-depend distclean-generic \ + clean-am -rm -f libtool distclean: distclean-recursive -rm -f config.status -maintainer-clean-am: maintainer-clean-hdr \ - maintainer-clean-toolexeclibLIBRARIES \ +maintainer-clean-am: maintainer-clean-toolexeclibLIBRARIES \ maintainer-clean-compile maintainer-clean-libtool \ maintainer-clean-toolexeclibLTLIBRARIES \ maintainer-clean-binPROGRAMS \ @@ -1837,8 +1806,7 @@ maintainer-clean-am: maintainer-clean-hdr \ maintainer-clean: maintainer-clean-recursive -rm -f config.status -.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \ -mostlyclean-toolexeclibLIBRARIES distclean-toolexeclibLIBRARIES \ +.PHONY: mostlyclean-toolexeclibLIBRARIES distclean-toolexeclibLIBRARIES \ clean-toolexeclibLIBRARIES maintainer-clean-toolexeclibLIBRARIES \ uninstall-toolexeclibLIBRARIES install-toolexeclibLIBRARIES \ mostlyclean-compile distclean-compile clean-compile \ diff --git a/libjava/java/lang/natClass.cc b/libjava/java/lang/natClass.cc index 995e631..33ab1a3 100644 --- a/libjava/java/lang/natClass.cc +++ b/libjava/java/lang/natClass.cc @@ -80,13 +80,6 @@ java::lang::Class::forName (jstring className) if (! className) JvThrow (new java::lang::NullPointerException); -#if 0 - // FIXME: should check syntax of CLASSNAME and throw - // IllegalArgumentException on failure. - - // FIXME: should use class loader from calling method. - jclass klass = _Jv_FindClass (className, NULL); -#else jsize length = _Jv_GetStringUTFLength (className); char buffer[length]; _Jv_GetStringUTFRegion (className, 0, length, buffer); @@ -99,8 +92,10 @@ java::lang::Class::forName (jstring className) jclass klass = (buffer[0] == '[' ? _Jv_FindClassFromSignature (name->data, NULL) : _Jv_FindClass (name, NULL)); -#endif - if (! klass) + + if (klass) + _Jv_InitClass (klass); + else JvThrow (new java::lang::ClassNotFoundException (className)); return klass; |