diff options
Diffstat (limited to 'libjava/java')
-rw-r--r-- | libjava/java/lang/Object.h | 3 | ||||
-rw-r--r-- | libjava/java/lang/Object.java | 8 |
2 files changed, 11 insertions, 0 deletions
diff --git a/libjava/java/lang/Object.h b/libjava/java/lang/Object.h index bf68a72..54fd447 100644 --- a/libjava/java/lang/Object.h +++ b/libjava/java/lang/Object.h @@ -83,6 +83,9 @@ private: // Initialize the sync_info field. Not called with JV_HASH_SYNCHRONIZATION. void sync_init (void); + +public: + virtual void throwNoSuchMethodError (void); }; #endif /* __JAVA_LANG_OBJECT_H__ */ diff --git a/libjava/java/lang/Object.java b/libjava/java/lang/Object.java index dbe3411..e81a48a 100644 --- a/libjava/java/lang/Object.java +++ b/libjava/java/lang/Object.java @@ -506,6 +506,14 @@ public class Object // completeness (some day we'll be able to auto-generate Object.h). private final native void sync_init(); + // If we fail to find a method at class loading time we put the + // vtable index of this method in its place: any attempt to call + // that method will result in an error. + void throwNoSuchMethodError() + { + throw new NoSuchMethodError("in " + getClass()); + } + // Note that we don't mention the sync_info field here. If we do, // jc1 will not work correctly. } |