From 881dfb65bfb4b3ed6d12eb0b9e6af30a9bb87015 Mon Sep 17 00:00:00 2001 From: mkoch Date: Fri, 24 Sep 2004 09:05:10 +0000 Subject: 2004-09-24 Jeroen Frijters * java/io/ObjectInputStream.java (readObject): Delegate instantation of Externalizable classes to ObjectStreamClass. * java/io/ObjectStreamClass.java (newInstance): New method to instantiate Externalizable (while ignoring the accessibility of the constructor). (constructor): New field to cache the constructor. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@88019 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/java/io/ObjectInputStream.java | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'libjava/java/io/ObjectInputStream.java') diff --git a/libjava/java/io/ObjectInputStream.java b/libjava/java/io/ObjectInputStream.java index 809e9b1c941..b9bba27b09b 100644 --- a/libjava/java/io/ObjectInputStream.java +++ b/libjava/java/io/ObjectInputStream.java @@ -291,29 +291,7 @@ public class ObjectInputStream extends InputStream if (osc.realClassIsExternalizable) { - Externalizable obj = null; - - try - { - obj = (Externalizable)clazz.newInstance(); - } - catch (InstantiationException e) - { - throw new ClassNotFoundException - ("Instance of " + clazz + " could not be created"); - } - catch (IllegalAccessException e) - { - throw new ClassNotFoundException - ("Instance of " + clazz + " could not be created because class or " - + "zero-argument constructor is not accessible"); - } - catch (NoSuchMethodError e) - { - throw new ClassNotFoundException - ("Instance of " + clazz - + " could not be created because zero-argument constructor is not defined"); - } + Externalizable obj = osc.newInstance(); int handle = assignNewHandle(obj); -- cgit v1.2.3