summaryrefslogtreecommitdiff
path: root/libjava/java
diff options
context:
space:
mode:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2006-05-05 15:05:20 +0000
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2006-05-05 15:05:20 +0000
commit514075bc9ecfcf166b3aff5648ddaed449a2ab8a (patch)
tree7224d376e0ab8c0a6d24d040d25e96f8dc5d254c /libjava/java
parent117886ac9d62dd35a850b0ce74ce7f6974fb8a87 (diff)
downloadgcc-514075bc9ecfcf166b3aff5648ddaed449a2ab8a.tar.gz
PR libgcj/27294:
* java/lang/natVMClassLoader.cc (defineClass): Throw VirtualMachineError if no interpreter configured. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113554 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java')
-rw-r--r--libjava/java/lang/natVMClassLoader.cc17
1 files changed, 16 insertions, 1 deletions
diff --git a/libjava/java/lang/natVMClassLoader.cc b/libjava/java/lang/natVMClassLoader.cc
index bffbfc067db..95c1f15934c 100644
--- a/libjava/java/lang/natVMClassLoader.cc
+++ b/libjava/java/lang/natVMClassLoader.cc
@@ -1,6 +1,6 @@
// natVMClassLoader.cc - VMClassLoader native methods
-/* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation
+/* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation
This file is part of libgcj.
@@ -34,6 +34,7 @@ details. */
#include <java/lang/StringBuffer.h>
#include <java/lang/Runtime.h>
#include <java/util/HashSet.h>
+#include <java/lang/VirtualMachineError.h>
java::lang::Class *
java::lang::VMClassLoader::defineClass (java::lang::ClassLoader *loader,
@@ -94,6 +95,20 @@ java::lang::VMClassLoader::defineClass (java::lang::ClassLoader *loader,
}
#endif // INTERPRETER
+ if (! klass)
+ {
+ StringBuffer *sb = new StringBuffer();
+ if (name)
+ {
+ sb->append(JvNewStringLatin1("found class file for class "));
+ sb->append(name);
+ }
+ else
+ sb->append(JvNewStringLatin1("found unnamed class file"));
+ sb->append(JvNewStringLatin1(", but no interpreter configured in this libgcj"));
+ throw new VirtualMachineError(sb->toString());
+ }
+
return klass;
}