incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r602932 - in /incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource: ./ internal/helper/ internal/mapping/classloader/
Date Mon, 10 Dec 2007 15:35:40 GMT
Author: cziegeler
Date: Mon Dec 10 07:35:39 2007
New Revision: 602932

URL: http://svn.apache.org/viewvc?rev=602932&view=rev
Log:
More generics and minor cleanup.

Modified:
    incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/SyntheticResource.java
    incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/Mapping.java
    incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/mapping/classloader/BundleLoader.java
    incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/mapping/classloader/ClassLoaderLoader.java
    incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/mapping/classloader/MapperClassLoader.java

Modified: incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/SyntheticResource.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/SyntheticResource.java?rev=602932&r1=602931&r2=602932&view=diff
==============================================================================
--- incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/SyntheticResource.java
(original)
+++ incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/SyntheticResource.java
Mon Dec 10 07:35:39 2007
@@ -18,8 +18,6 @@
  */
 package org.apache.sling.jcr.resource;
 
-import java.io.InputStream;
-
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceMetadata;
 

Modified: incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/Mapping.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/Mapping.java?rev=602932&r1=602931&r2=602932&view=diff
==============================================================================
--- incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/Mapping.java
(original)
+++ incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/Mapping.java
Mon Dec 10 07:35:39 2007
@@ -134,7 +134,7 @@
      *            by the <em>from</em> prefix.
      * @return The string after replacement or <code>null</code> if the
      *         <code>uriPath</code> does not start with the <em>to</em>
-     *         prefix, or {@link #mapsInwards} returns <code>false</code>.
+     *         prefix, or {@link #mapsInbound()} returns <code>false</code>.
      */
     public String mapUri(String uriPath) {
         return (this.mapsInbound() && uriPath.startsWith(this.to)) ? this.from
@@ -152,7 +152,7 @@
      *            prefix by the <em>to</em> prefix.
      * @return The string after replacement or <code>null</code> if the
      *         <code>handle</code> does not start with the <em>from</em>
-     *         prefix, or {@link #mapsOutwards} returns <code>false</code>.
+     *         prefix, or {@link #mapsOutbound()} returns <code>false</code>.
      */
     public String mapHandle(String handle) {
         return (this.mapsOutbound() && handle.startsWith(this.from)) ? this.to

Modified: incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/mapping/classloader/BundleLoader.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/mapping/classloader/BundleLoader.java?rev=602932&r1=602931&r2=602932&view=diff
==============================================================================
--- incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/mapping/classloader/BundleLoader.java
(original)
+++ incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/mapping/classloader/BundleLoader.java
Mon Dec 10 07:35:39 2007
@@ -33,7 +33,7 @@
     }
 
     /**
-     * @see org.apache.sling.core.content.jcr.internal.mapping.classloader.Loader#loadClass(java.lang.String)
+     * @see org.apache.sling.jcr.resource.internal.mapping.classloader.Loader#loadClass(java.lang.String)
      */
     public Class loadClass(String name) throws ClassNotFoundException {
         try {
@@ -52,6 +52,9 @@
         }
     }
 
+    /**
+     * @see org.apache.sling.jcr.resource.internal.mapping.classloader.Loader#getLoader()
+     */
     public Object getLoader() {
         return this.bundle;
     }

Modified: incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/mapping/classloader/ClassLoaderLoader.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/mapping/classloader/ClassLoaderLoader.java?rev=602932&r1=602931&r2=602932&view=diff
==============================================================================
--- incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/mapping/classloader/ClassLoaderLoader.java
(original)
+++ incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/mapping/classloader/ClassLoaderLoader.java
Mon Dec 10 07:35:39 2007
@@ -30,12 +30,15 @@
     }
 
     /**
-     * @see org.apache.sling.core.content.jcr.internal.mapping.classloader.Loader#loadClass(java.lang.String)
+     * @see org.apache.sling.jcr.resource.internal.mapping.classloader.Loader#loadClass(java.lang.String)
      */
     public Class loadClass(String name) throws ClassNotFoundException {
         return this.classLoader.loadClass(name);
     }
 
+    /**
+     * @see org.apache.sling.jcr.resource.internal.mapping.classloader.Loader#getLoader()
+     */
     public Object getLoader() {
         return this.classLoader;
     }

Modified: incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/mapping/classloader/MapperClassLoader.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/mapping/classloader/MapperClassLoader.java?rev=602932&r1=602931&r2=602932&view=diff
==============================================================================
--- incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/mapping/classloader/MapperClassLoader.java
(original)
+++ incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/mapping/classloader/MapperClassLoader.java
Mon Dec 10 07:35:39 2007
@@ -42,7 +42,7 @@
 public class MapperClassLoader extends ClassLoader {
 
     // Map of class loaders indexed by fully qualified class className
-    private Map delegateeLoaders;
+    private Map<String, LoaderDelegate> delegateeLoaders;
 
     private Loader[] delegatees;
 
@@ -52,7 +52,7 @@
     public MapperClassLoader() {
         super(null);
 
-        this.delegateeLoaders = new HashMap();
+        this.delegateeLoaders = new HashMap<String, LoaderDelegate>();
         this.delegatees = new Loader[0];
     }
 
@@ -104,10 +104,11 @@
      *
      * @throws ClassNotFoundException If the given class cannot be returned.
      */
+    @SuppressWarnings("unchecked")
     protected synchronized Class loadClass(String name, boolean resolve)
             throws ClassNotFoundException {
         // 1. check whether we already know the class
-        LoaderDelegate dele = (LoaderDelegate) this.delegateeLoaders.get(name);
+        LoaderDelegate dele = this.delegateeLoaders.get(name);
         if (dele != null) {
             return dele.loadClass();
         }
@@ -158,8 +159,8 @@
 
     private void unregisterLoaderInternal(Object loader) {
         // remove classes registered with the class loader
-        for (Iterator di = this.delegateeLoaders.values().iterator(); di.hasNext();) {
-            LoaderDelegate dele = (LoaderDelegate) di.next();
+        for (Iterator<LoaderDelegate> di = this.delegateeLoaders.values().iterator();
di.hasNext();) {
+            LoaderDelegate dele = di.next();
 
             // remove the entry if the class loaders are the same
             if (dele.getLoader() == loader) {



Mime
View raw message