public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
* Re: gnu.bytecode.ParameterizedType does not implement Externalizable
       [not found] <CAMFYt2aq8ggXH2wK2eqHmB0EkA3O+ABKpRjUG6gLHh7cGU-0-Q@mail.gmail.com>
@ 2022-10-15 17:07 ` Per Bothner
  0 siblings, 0 replies; only message in thread
From: Per Bothner @ 2022-10-15 17:07 UTC (permalink / raw)
  To: Panicz Maciej Godek, kawa

[-- Attachment #1: Type: text/plain, Size: 147 bytes --]

Please try the attached patch.
I haven't tested it, except to verify that it compiles.
-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/

[-- Attachment #2: ptype.patch --]
[-- Type: text/x-patch, Size: 1583 bytes --]

diff --git a/gnu/bytecode/ParameterizedType.java b/gnu/bytecode/ParameterizedType.java
index b9d35945d..5d4adc0f4 100644
--- a/gnu/bytecode/ParameterizedType.java
+++ b/gnu/bytecode/ParameterizedType.java
@@ -2,8 +2,9 @@
 // This is free software;  for terms and warranty disclaimer see ./COPYING.
 
 package gnu.bytecode;
+import java.io.*;
 
-public class ParameterizedType extends ObjectType
+public class ParameterizedType extends ObjectType implements Externalizable
 {
     ClassType rawType;
     Type[] typeArgumentTypes;
@@ -146,4 +147,27 @@ public class ParameterizedType extends ObjectType
         this.rawType = rawType;
         this.typeArgumentTypes = typeArgumentTypes;
     }
+    public static final ParameterizedType make(ClassType rawType,
+                                               Type[] typeArgumentTypes,
+                                               char[] typeArgumentBounds) {
+        ParameterizedType ptype =
+            new ParameterizedType(rawType, typeArgumentTypes);
+        ptype.typeArgumentBounds = typeArgumentBounds;
+        return ptype;
+    }
+
+    public void writeExternal(ObjectOutput out) throws IOException
+    {
+        out.writeObject(rawType);
+        out.writeObject(typeArgumentTypes);
+        out.writeObject(typeArgumentBounds);
+    }
+
+    public void readExternal(ObjectInput in)
+        throws IOException, ClassNotFoundException
+    {
+        rawType = (ClassType) in.readObject();
+        typeArgumentTypes = (Type[]) in.readObject();
+        typeArgumentBounds = (char[]) in.readObject();
+    }
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-10-15 17:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CAMFYt2aq8ggXH2wK2eqHmB0EkA3O+ABKpRjUG6gLHh7cGU-0-Q@mail.gmail.com>
2022-10-15 17:07 ` gnu.bytecode.ParameterizedType does not implement Externalizable Per Bothner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).