Remy Maucherat wrote:
[EMAIL PROTECTED] wrote:

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=34090>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=34090

------- Additional Comments From [EMAIL PROTECTED] 2005-03-21 17:40 -------
Whatever it is you are doing is absolutely scary. I tried to see if calling the
superclass helps and does not cause regressions or problems, as the field you
mention cannot be used.


If I commit this, does Sun see it as a legal problem ? Simply calling the superclass could create issues, and I don't want to try it.

Hi,

here is the answer I got from management:

" Hi Remy - This is Jim. We (Sun) can't relicense use of copywritten Sun code from the JDK outside of the JDK itself without extensive use of lawyers, and the Apache board. So, it would be better to find another solution. This isn't significantly different than JBoss' position that Apache can't use JBoss code, so I'm sure it's not too big a suprise. If I'm misunderstanding what's been requested, please let me know."

-- Jeanfrancois





Index: CustomObjectInputStream.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/util/CustomObjectInputStream.java,v


retrieving revision 1.4
diff -u -r1.4 CustomObjectInputStream.java
--- CustomObjectInputStream.java    10 Mar 2005 23:54:45 -0000    1.4
+++ CustomObjectInputStream.java    21 Mar 2005 16:47:25 -0000
@@ -21,6 +21,7 @@
 import java.io.ObjectInputStream;
 import java.io.ObjectStreamClass;
 import java.lang.reflect.Proxy;
+import java.util.HashMap;

 /**
  * Custom subclass of <code>ObjectInputStream</code> that loads from the
@@ -37,6 +38,23 @@


/**
+ * List of primitive classes.
+ */
+ private static final HashMap primitiveTypes = new HashMap();
+ static {
+ primitiveTypes.put("boolean", boolean.class);
+ primitiveTypes.put("byte", byte.class);
+ primitiveTypes.put("char", char.class);
+ primitiveTypes.put("double", double.class);
+ primitiveTypes.put("float", float.class);
+ primitiveTypes.put("int", int.class);
+ primitiveTypes.put("long", long.class);
+ primitiveTypes.put("short", short.class);
+ primitiveTypes.put("void", void.class);
+ }
+
+
+ /**
* The class loader we will use to resolve classes.
*/
private ClassLoader classLoader = null;
@@ -70,7 +88,17 @@
*/
public Class resolveClass(ObjectStreamClass classDesc)
throws ClassNotFoundException, IOException {
- return Class.forName(classDesc.getName(), false, classLoader);
+ try {
+ return Class.forName(classDesc.getName(), false, classLoader);
+ } catch (ClassNotFoundException e) {
+ // Trying again for the case of primitives
+ Class result = (Class) primitiveTypes.get(classDesc.getName());
+ if (result != null) {
+ return result;
+ } else {
+ throw e;
+ }
+ }
}


Rémy


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to