incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1044241 - in /sling/trunk: bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/jcr/ bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/ bundles/scripting/api/src/main/java/sun/misc/ bundles/scripting/javas...
Date Fri, 10 Dec 2010 08:49:01 GMT
Author: cziegeler
Date: Fri Dec 10 08:49:00 2010
New Revision: 1044241

URL: http://svn.apache.org/viewvc?rev=1044241&view=rev
Log:
SLING-1891 : Replace Cass.forName uses by ClassLoader.loadClass

Modified:
    sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/jcr/JCRHelper.java
    sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrPropertyMap.java
    sling/trunk/bundles/scripting/api/src/main/java/sun/misc/Service.java
    sling/trunk/bundles/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/wrapper/ScriptableResource.java
    sling/trunk/bundles/scripting/jsp/src/main/java/org/apache/sling/scripting/jsp/jasper/JspCompilationContext.java
    sling/trunk/bundles/scripting/jsp/src/main/java/org/apache/sling/scripting/jsp/jasper/compiler/TagPluginManager.java
    sling/trunk/contrib/explorers/gwt/src/main/java/org/apache/sling/explorer/client/widgets/tree/resource/ResourceTree.java
    sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/Sling.java

Modified: sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/jcr/JCRHelper.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/jcr/JCRHelper.java?rev=1044241&r1=1044240&r2=1044241&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/jcr/JCRHelper.java
(original)
+++ sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/jcr/JCRHelper.java
Fri Dec 10 08:49:00 2010
@@ -377,7 +377,7 @@ public abstract class JCRHelper {
         @Override
         protected Class<?> resolveClass(java.io.ObjectStreamClass classDesc) throws
IOException, ClassNotFoundException {
             if ( this.classloader != null ) {
-                return Class.forName(classDesc.getName(), true, this.classloader);
+                return this.classloader.loadClass(classDesc.getName());
             }
             return super.resolveClass(classDesc);
         }

Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrPropertyMap.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrPropertyMap.java?rev=1044241&r1=1044240&r2=1044241&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrPropertyMap.java
(original)
+++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrPropertyMap.java
Fri Dec 10 08:49:00 2010
@@ -555,7 +555,7 @@ public class JcrPropertyMap
         @Override
         protected Class<?> resolveClass(java.io.ObjectStreamClass classDesc) throws
IOException, ClassNotFoundException {
             if ( this.classloader != null ) {
-                return Class.forName(classDesc.getName(), true, this.classloader);
+                return this.classloader.loadClass(classDesc.getName());
             }
             return super.resolveClass(classDesc);
         }

Modified: sling/trunk/bundles/scripting/api/src/main/java/sun/misc/Service.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/scripting/api/src/main/java/sun/misc/Service.java?rev=1044241&r1=1044240&r2=1044241&view=diff
==============================================================================
--- sling/trunk/bundles/scripting/api/src/main/java/sun/misc/Service.java (original)
+++ sling/trunk/bundles/scripting/api/src/main/java/sun/misc/Service.java Fri Dec 10 08:49:00
2010
@@ -145,7 +145,7 @@ public class Service {
             if (currentFile != null && currentFile.hasNext()) {
                 String name = currentFile.next();
                 try {
-                    Class<?> clazz = Class.forName(name, true, loader);
+                    Class<?> clazz = loader.loadClass(name);
                     return (ProviderType) clazz.newInstance();
                 } catch (Throwable t) {
                     //

Modified: sling/trunk/bundles/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/wrapper/ScriptableResource.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/wrapper/ScriptableResource.java?rev=1044241&r1=1044240&r2=1044241&view=diff
==============================================================================
--- sling/trunk/bundles/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/wrapper/ScriptableResource.java
(original)
+++ sling/trunk/bundles/scripting/javascript/src/main/java/org/apache/sling/scripting/javascript/wrapper/ScriptableResource.java
Fri Dec 10 08:49:00 2010
@@ -215,7 +215,7 @@ public class ScriptableResource extends 
                 if (loader == null) {
                     loader = thisObj.getClass().getClassLoader();
                 }
-                adapter = Class.forName(className, true, loader);
+                adapter = loader.loadClass(className);
             } catch (Exception e) {
                 // TODO: log exception
             }

Modified: sling/trunk/bundles/scripting/jsp/src/main/java/org/apache/sling/scripting/jsp/jasper/JspCompilationContext.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/scripting/jsp/src/main/java/org/apache/sling/scripting/jsp/jasper/JspCompilationContext.java?rev=1044241&r1=1044240&r2=1044241&view=diff
==============================================================================
--- sling/trunk/bundles/scripting/jsp/src/main/java/org/apache/sling/scripting/jsp/jasper/JspCompilationContext.java
(original)
+++ sling/trunk/bundles/scripting/jsp/src/main/java/org/apache/sling/scripting/jsp/jasper/JspCompilationContext.java
Fri Dec 10 08:49:00 2010
@@ -267,7 +267,7 @@ public class JspCompilationContext {
     protected Compiler createCompiler(String className) {
         Compiler compiler = null;
         try {
-            compiler = (Compiler) Class.forName(className).newInstance();
+            compiler = (Compiler) this.getClass().getClassLoader().loadClass(className).newInstance();
         } catch (InstantiationException e) {
             log.warn(Localizer.getMessage("jsp.error.compiler"), e);
         } catch (IllegalAccessException e) {

Modified: sling/trunk/bundles/scripting/jsp/src/main/java/org/apache/sling/scripting/jsp/jasper/compiler/TagPluginManager.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/scripting/jsp/src/main/java/org/apache/sling/scripting/jsp/jasper/compiler/TagPluginManager.java?rev=1044241&r1=1044240&r2=1044241&view=diff
==============================================================================
--- sling/trunk/bundles/scripting/jsp/src/main/java/org/apache/sling/scripting/jsp/jasper/compiler/TagPluginManager.java
(original)
+++ sling/trunk/bundles/scripting/jsp/src/main/java/org/apache/sling/scripting/jsp/jasper/compiler/TagPluginManager.java
Fri Dec 10 08:49:00 2010
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -17,8 +17,10 @@
 
 package org.apache.sling.scripting.jsp.jasper.compiler;
 
-import java.util.*;
-import java.io.*;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Iterator;
+
 import javax.servlet.ServletContext;
 
 import org.apache.sling.scripting.jsp.jasper.JasperException;
@@ -65,7 +67,7 @@ public class TagPluginManager {
         });
 
     }
- 
+
     private void init(ErrorDispatcher err) throws JasperException {
 	if (initialized)
 	    return;
@@ -104,7 +106,7 @@ public class TagPluginManager {
 	    String pluginClassStr = pluginClassNode.getBody();
 	    TagPlugin tagPlugin = null;
 	    try {
-		Class pluginClass = Class.forName(pluginClassStr);
+		Class pluginClass = this.getClass().getClassLoader().loadClass(pluginClassStr);
 		tagPlugin = (TagPlugin) pluginClass.newInstance();
 	    } catch (Exception e) {
 		throw new JasperException(e);
@@ -118,7 +120,7 @@ public class TagPluginManager {
     }
 
     /**
-     * Invoke tag plugin for the given custom tag, if a plugin exists for 
+     * Invoke tag plugin for the given custom tag, if a plugin exists for
      * the custom tag's tag handler.
      *
      * The given custom tag node will be manipulated by the plugin.
@@ -221,7 +223,7 @@ public class TagPluginManager {
 	}
 
 	public void generateBody() {
-	    // Since we'll generate the body anyway, this is really a nop, 
+	    // Since we'll generate the body anyway, this is really a nop,
 	    // except for the fact that it lets us put the Java sources the
 	    // plugins produce in the correct order (w.r.t the body).
 	    curNodes = node.getAtETag();

Modified: sling/trunk/contrib/explorers/gwt/src/main/java/org/apache/sling/explorer/client/widgets/tree/resource/ResourceTree.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/explorers/gwt/src/main/java/org/apache/sling/explorer/client/widgets/tree/resource/ResourceTree.java?rev=1044241&r1=1044240&r2=1044241&view=diff
==============================================================================
--- sling/trunk/contrib/explorers/gwt/src/main/java/org/apache/sling/explorer/client/widgets/tree/resource/ResourceTree.java
(original)
+++ sling/trunk/contrib/explorers/gwt/src/main/java/org/apache/sling/explorer/client/widgets/tree/resource/ResourceTree.java
Fri Dec 10 08:49:00 2010
@@ -93,7 +93,7 @@ public class ResourceTree extends Tree {
 		root = new TreeItem(constants.rootItemDescription());
 //		try {
 //
-//            SessionInfo info = (SessionInfo)   Class.forName("org.apache.sling.explorer.client.sling.SessionInfo").newInstance();
+//            SessionInfo info = (SessionInfo)   this.getClass().getClassLoader().loadClass("org.apache.sling.explorer.client.sling.SessionInfo").newInstance();
 //
 //            root = new TreeItem(info.getUser());
 //        }

Modified: sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/Sling.java
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/Sling.java?rev=1044241&r1=1044240&r2=1044241&view=diff
==============================================================================
--- sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/Sling.java
(original)
+++ sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/Sling.java
Fri Dec 10 08:49:00 2010
@@ -30,13 +30,13 @@ import java.util.Hashtable;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.Map.Entry;
 import java.util.Properties;
 import java.util.Set;
 import java.util.SortedMap;
 import java.util.StringTokenizer;
 import java.util.TreeMap;
 import java.util.TreeSet;
-import java.util.Map.Entry;
 
 import javax.management.Attribute;
 import javax.management.AttributeList;
@@ -588,8 +588,7 @@ public class Sling implements BundleActi
                     String className = key.substring(prefix.length()
                         + "class.".length());
                     try {
-                        Class.forName(className, true,
-                            this.getClass().getClassLoader());
+                        this.getClass().getClassLoader().loadClass(className);
                     } catch (Throwable t) {
                         // don't really care, but class checking failed, so we
                         // do not add



Mime
View raw message