[jboss-cvs] Repository SVN: r24305 - sun-jaxb/2.1.4.patch01-brew/src.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Apr 9 17:42:16 EDT 2009
Author: fnasser at redhat.com
Date: 2009-04-09 17:42:16 -0400 (Thu, 09 Apr 2009)
New Revision: 24305
Added:
sun-jaxb/2.1.4.patch01-brew/src/glassfish-jaxb-JBPAPP-1560.patch
sun-jaxb/2.1.4.patch01-brew/src/glassfish-jaxb-build-hack.patch
Log:
Add the patch files used in the build
Added: sun-jaxb/2.1.4.patch01-brew/src/glassfish-jaxb-JBPAPP-1560.patch
===================================================================
--- sun-jaxb/2.1.4.patch01-brew/src/glassfish-jaxb-JBPAPP-1560.patch (rev 0)
+++ sun-jaxb/2.1.4.patch01-brew/src/glassfish-jaxb-JBPAPP-1560.patch 2009-04-09 21:42:16 UTC (rev 24305)
@@ -0,0 +1,123 @@
+--- jaxb-ri/runtime/src/com/sun/xml/bind/v2/runtime/reflect/opt/Injector.java.orig 2009-01-08 17:28:13.000000000 -0500
++++ jaxb-ri/runtime/src/com/sun/xml/bind/v2/runtime/reflect/opt/Injector.java 2009-01-08 17:44:51.000000000 -0500
+@@ -68,8 +68,8 @@ final class Injector {
+ *
+ * We only need one injector per one user class loader.
+ */
+- private static final Map<ClassLoader,WeakReference<Injector>> injectors =
+- Collections.synchronizedMap(new WeakHashMap<ClassLoader,WeakReference<Injector>>());
++ private static final Map<ClassLoader,Injector> injectors =
++ Collections.synchronizedMap(new WeakHashMap<ClassLoader,Injector>());
+
+ private static final Logger logger = Util.getClassLogger();
+
+@@ -82,7 +82,7 @@ final class Injector {
+ static Class inject( ClassLoader cl, String className, byte[] image ) {
+ Injector injector = get(cl);
+ if(injector!=null)
+- return injector.inject(className,image);
++ return injector.internalInject(cl,className,image);
+ else
+ return null;
+ }
+@@ -93,7 +93,7 @@ final class Injector {
+ static Class find( ClassLoader cl, String className ) {
+ Injector injector = get(cl);
+ if(injector!=null)
+- return injector.find(className);
++ return injector.internalFind(cl,className);
+ else
+ return null;
+ }
+@@ -105,26 +105,23 @@ final class Injector {
+ * if it fails.
+ */
+ private static Injector get(ClassLoader cl) {
+- Injector injector = null;
+- WeakReference<Injector> wr = injectors.get(cl);
+- if(wr!=null)
+- injector = wr.get();
++ Injector injector = injectors.get(cl);
++
+ if(injector==null)
+ try {
+- injectors.put(cl,new WeakReference<Injector>(injector = new Injector(cl)));
++ injectors.put(cl,injector = new Injector(cl));
+ } catch (SecurityException e) {
+ logger.log(Level.FINE,"Unable to set up a back-door for the injector",e);
+ return null;
+ }
++
+ return injector;
+ }
+
+ /**
+ * Injected classes keyed by their names.
+ */
+- private final Map<String,Class> classes = new HashMap<String,Class>();
+-
+- private final ClassLoader parent;
++ private final Map<String,WeakReference<Class>> classes = new HashMap<String,WeakReference<Class>>();
+
+ /**
+ * True if this injector is capable of injecting accessors.
+@@ -155,7 +152,6 @@ final class Injector {
+ }
+
+ private Injector(ClassLoader parent) {
+- this.parent = parent;
+ assert parent!=null;
+
+ boolean loadable = false;
+@@ -170,11 +166,14 @@ final class Injector {
+ }
+
+
+- private synchronized Class inject(String className, byte[] image) {
++ private synchronized Class internalInject(ClassLoader parent, String className, byte[] image) {
+ if(!loadable) // this injector cannot inject anything
+ return null;
+
+- Class c = classes.get(className);
++ Class c = null;
++ WeakReference<Class> ref = classes.get(className);
++ if (ref != null)
++ c = ref.get();
+ if(c==null) {
+ // we need to inject a class into the
+ try {
+@@ -193,12 +192,31 @@ final class Injector {
+ logger.log(Level.FINE,"Unable to inject "+className,e);
+ return null;
+ }
+- classes.put(className,c);
++ classes.put(className,new WeakReference<Class>(c));
+ }
+ return c;
+ }
+
+- private synchronized Class find(String className) {
+- return classes.get(className);
++ private synchronized Class internalFind(ClassLoader parent, String className) {
++ Class clazz = null;
++ WeakReference<Class> ref = classes.get(className);
++ if (ref != null)
++ {
++ clazz = ref.get();
++ if (clazz==null)
++ {
++ // If we have a reference but no class the class must have been
++ // loaded at some point.
++ try {
++ clazz = parent.loadClass(className);
++ } catch (ClassNotFoundException e) {
++ // If this fails then null can be returned so the class can
++ // be redefined.
++ logger.log(Level.FINE,"Unable to load "+className,e);
++ }
++ }
++ }
++
++ return clazz;
+ }
+ }
Added: sun-jaxb/2.1.4.patch01-brew/src/glassfish-jaxb-build-hack.patch
===================================================================
--- sun-jaxb/2.1.4.patch01-brew/src/glassfish-jaxb-build-hack.patch (rev 0)
+++ sun-jaxb/2.1.4.patch01-brew/src/glassfish-jaxb-build-hack.patch 2009-04-09 21:42:16 UTC (rev 24305)
@@ -0,0 +1,11 @@
+--- jaxb-ri/docs/xjc.html.old 2008-07-18 11:56:23.000000000 -0400
++++ jaxb-ri/docs/xjc.html 2008-07-18 11:56:53.000000000 -0400
+@@ -51,7 +51,7 @@
+ <h4>Output</h4>
+ <blockquote>
+ <!-- load help message from property file -->
+- <util:properties uri="../xjc/src/com/sun/tools/xjc/MessageBundle.properties" xmlns:util="jelly:util"/>
++ <util:properties uri="../xjc/src/com/sun/tools/xjc/MessageBundle.properties"/>
+ <pre>${Driver.Public.Usage}</pre>
+ </blockquote>
+ </blockquote>
More information about the jboss-cvs-commits
mailing list