You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cz...@apache.org on 2008/02/18 15:27:42 UTC
svn commit: r628753 - in /incubator/sling/trunk:
api/src/main/java/org/apache/sling/api/resource/
api/src/main/java/org/apache/sling/api/scripting/
api/src/main/java/org/apache/sling/api/servlets/
jcr/ocm/src/main/java/org/apache/sling/jcr/ocm/ jcr/ocm...
Author: cziegeler
Date: Mon Feb 18 06:27:36 2008
New Revision: 628753
URL: http://svn.apache.org/viewvc?rev=628753&view=rev
Log:
Clean up code.
Modified:
incubator/sling/trunk/api/src/main/java/org/apache/sling/api/resource/ResourceNotFoundException.java
incubator/sling/trunk/api/src/main/java/org/apache/sling/api/resource/ResourceResolver.java
incubator/sling/trunk/api/src/main/java/org/apache/sling/api/scripting/SlingScriptResolver.java
incubator/sling/trunk/api/src/main/java/org/apache/sling/api/servlets/ServletResolver.java
incubator/sling/trunk/jcr/ocm/src/main/java/org/apache/sling/jcr/ocm/DefaultMappedObject.java
incubator/sling/trunk/jcr/ocm/src/main/java/org/apache/sling/jcr/ocm/impl/BundleMapper.java
incubator/sling/trunk/jcr/ocm/src/main/java/org/apache/sling/jcr/ocm/impl/ClassDescriptorReader.java
incubator/sling/trunk/jcr/ocm/src/main/java/org/apache/sling/jcr/ocm/impl/SlingAtomicTypeConverterProvider.java
incubator/sling/trunk/jcr/ocm/src/main/java/org/apache/sling/jcr/ocm/impl/classloader/BundleLoader.java
incubator/sling/trunk/jcr/ocm/src/main/java/org/apache/sling/jcr/ocm/impl/classloader/ClassLoaderLoader.java
incubator/sling/trunk/jcr/ocm/src/main/java/org/apache/sling/jcr/ocm/impl/classloader/Loader.java
incubator/sling/trunk/jcr/ocm/src/main/java/org/apache/sling/jcr/ocm/impl/classloader/LoaderDelegate.java
incubator/sling/trunk/jcr/ocm/src/main/java/org/apache/sling/jcr/ocm/impl/classloader/MapperClassLoader.java
incubator/sling/trunk/scripting/resolver/src/main/java/org/apache/sling/scripting/resolver/impl/helper/OnDemandReaderRequest.java
incubator/sling/trunk/sling/adapter/src/main/java/org/apache/sling/adapter/SlingAdaptable.java
incubator/sling/trunk/sling/adapter/src/main/java/org/apache/sling/adapter/internal/AdapterFactoryDescriptorKey.java
incubator/sling/trunk/sling/adapter/src/main/java/org/apache/sling/adapter/internal/AdapterFactoryDescriptorMap.java
incubator/sling/trunk/sling/core/src/main/java/org/apache/sling/core/impl/parameters/EncodedRequestParameter.java
incubator/sling/trunk/sling/core/src/main/java/org/apache/sling/core/impl/request/RequestData.java
incubator/sling/trunk/sling/core/src/main/java/org/apache/sling/core/impl/request/SlingRequestDispatcher.java
incubator/sling/trunk/sling/core/src/main/java/org/apache/sling/core/impl/request/SlingRequestPathInfo.java
incubator/sling/trunk/sling/servlet-resolver/src/main/java/org/apache/sling/servlet/resolver/SlingServletResolver.java
incubator/sling/trunk/sling/servlet-resolver/src/main/java/org/apache/sling/servlet/resolver/defaults/DefaultServlet.java
incubator/sling/trunk/sling/servlet-resolver/src/main/java/org/apache/sling/servlet/resolver/resource/ServletResource.java
incubator/sling/trunk/sling/servlet-resolver/src/main/java/org/apache/sling/servlet/resolver/resource/ServletResourceProvider.java
Modified: incubator/sling/trunk/api/src/main/java/org/apache/sling/api/resource/ResourceNotFoundException.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/api/src/main/java/org/apache/sling/api/resource/ResourceNotFoundException.java?rev=628753&r1=628752&r2=628753&view=diff
==============================================================================
--- incubator/sling/trunk/api/src/main/java/org/apache/sling/api/resource/ResourceNotFoundException.java (original)
+++ incubator/sling/trunk/api/src/main/java/org/apache/sling/api/resource/ResourceNotFoundException.java Mon Feb 18 06:27:36 2008
@@ -16,8 +16,6 @@
*/
package org.apache.sling.api.resource;
-import javax.servlet.http.HttpServletResponse;
-
import org.apache.sling.api.SlingException;
/**
@@ -38,7 +36,7 @@
public ResourceNotFoundException(String message) {
this(null, message);
}
-
+
public ResourceNotFoundException(String resource, String message) {
super(message);
this.resource = resource;
Modified: incubator/sling/trunk/api/src/main/java/org/apache/sling/api/resource/ResourceResolver.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/api/src/main/java/org/apache/sling/api/resource/ResourceResolver.java?rev=628753&r1=628752&r2=628753&view=diff
==============================================================================
--- incubator/sling/trunk/api/src/main/java/org/apache/sling/api/resource/ResourceResolver.java (original)
+++ incubator/sling/trunk/api/src/main/java/org/apache/sling/api/resource/ResourceResolver.java Mon Feb 18 06:27:36 2008
@@ -48,14 +48,14 @@
* {@link Resource#getPath() resource path} set to the request URI.
* {@link Resource#adaptTo(Class) object} returns <code>null</code> for
* all classes.
- *
+ *
* @param request The http servlet request object used to resolve the
* resource for.
* @return The {@link Resource} for the request.
- * @throws AccessControlException if the user authenticated with the request
+ * @throws java.security.AccessControlException if the user authenticated with the request
* does not have enough rights to access the resource to which
* the request maps.
- * @throws SlingException A subclass of this exception is thrown if the
+ * @throws org.apache.sling.api.SlingException A subclass of this exception is thrown if the
* resource to which the request maps cannot be retrieved.
*/
Resource resolve(HttpServletRequest request);
@@ -73,14 +73,14 @@
* <p>
* If the <code>absPath</code> is a relative path, this method returns
* <code>null</code>.
- *
+ *
* @param absPath The absolute path to be mapped to a resource.
* @return The {@link Resource} mapped from the path or <code>null</code>
* if no resource can be found for the path.
- * @throws AccessControlException if the user authenticated with the request
+ * @throws java.security.AccessControlException if the user authenticated with the request
* does not have enough rights to access the resource to which
* the request maps.
- * @throws SlingException A subclass of this exception is thrown if the
+ * @throws org.apache.sling.api.SlingException A subclass of this exception is thrown if the
* resource to which the request maps cannot be retrieved.
*/
Resource resolve(String absPath);
@@ -97,7 +97,7 @@
* an existing resource roundtripping may of course not work and calling
* {@link #resolve(String)} with the path returned may return
* <code>null</code>.
- *
+ *
* @param resourcePath The path for which to return a mapped path.
* @return The mapped path.
*/
@@ -111,7 +111,7 @@
* a Java Content Repository, the path could be a
* <code>javax.jcr.Item</code> path from which the resource object is
* loaded.
- *
+ *
* @param path The absolute path to the resource object to be loaded. The
* path may contain relative path specifiers like <code>.</code>
* (current location) and <code>..</code> (parent location),
@@ -121,10 +121,10 @@
* relative path to a resource.
* @return The <code>Resource</code> object loaded from the path or
* <code>null</code> if the path does not resolve to a resource.
- * @throws AccessControlException if an item exists at the <code>path</code>
+ * @throws java.security.AccessControlException if an item exists at the <code>path</code>
* but the session of this resource manager has no read access
* to the item.
- * @throws SlingException If an error occurrs trying to load the resource
+ * @throws org.apache.sling.api.SlingException If an error occurrs trying to load the resource
* object from the path.
*/
Resource getResource(String path);
@@ -137,7 +137,7 @@
* a Java Content Repository, the path could be a
* <code>javax.jcr.Item</code> path from which the resource object is
* loaded.
- *
+ *
* @param base The base {@link Resource} against which a relative path
* argument given by <code>path</code> is resolved. This
* parameter may be <code>null</code> if the <code>path</code>
@@ -151,10 +151,10 @@
* this method.
* @return The <code>Resource</code> object loaded from the path or
* <code>null</code> if the path does not resolve to a resource.
- * @throws AccessControlException if an item exists at the <code>path</code>
+ * @throws java.security.AccessControlException if an item exists at the <code>path</code>
* but the session of this resource manager has no read access
* to the item.
- * @throws SlingException If an error occurrs trying to load the resource
+ * @throws org.apache.sling.api.SlingException If an error occurrs trying to load the resource
* object from the path or if <code>base</code> is
* <code>null</code> and <code>path</code> is relative.
*/
@@ -180,12 +180,12 @@
* reading content from a Java Content Repository, the children could be the
* {@link Resource} objects loaded from child items of the <code>Item</code>
* of the given <code>Resource</code>.
- *
+ *
* @param parent The {@link Resource Resource} whose children are requested.
* @return An <code>Iterator</code> of {@link Resource} objects.
* @throws NullPointerException If <code>parent</code> is
* <code>null</code>.
- * @throws SlingException If any error occurs acquiring the child resource
+ * @throws org.apache.sling.api.SlingException If any error occurs acquiring the child resource
* iterator.
*/
Iterator<Resource> listChildren(Resource parent);
@@ -200,7 +200,7 @@
* create a JCR <code>Query</code> through the <code>QueryManager</code>.
* The result returned is then based on the <code>NodeIterator</code>
* provided by the query result.
- *
+ *
* @param query The query string to use to find the resources.
* @param language The language in which the query is formulated.
* @return An <code>Iterator</code> of {@link Resource} objects matching
@@ -208,7 +208,7 @@
* @throws QuerySyntaxException If the query is not syntactically correct
* according to the query language indicator of if the query
* language is not supported.
- * @throws SlingException If an error occurrs querying for the resources.
+ * @throws org.apache.sling.api.SlingException If an error occurrs querying for the resources.
*/
Iterator<Resource> findResources(String query, String language);
@@ -225,7 +225,7 @@
* the column name and the column value is the JCR <code>Value</code>
* object converted into the respective Java object, such as
* <code>Boolean</code> for a value of property type <em>Boolean</em>.
- *
+ *
* @param query The query string to use to find the resources.
* @param language The language in which the query is formulated.
* @return An <code>Iterator</code> of <code>Map</code> instances
@@ -233,7 +233,7 @@
* @throws QuerySyntaxException If the query is not syntactically correct
* according to the query language indicator of if the query
* language is not supported.
- * @throws SlingException If an error occurrs querying for the resources.
+ * @throws org.apache.sling.api.SlingException If an error occurrs querying for the resources.
*/
Iterator<Map<String, Object>> queryResources(String query, String language);
Modified: incubator/sling/trunk/api/src/main/java/org/apache/sling/api/scripting/SlingScriptResolver.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/api/src/main/java/org/apache/sling/api/scripting/SlingScriptResolver.java?rev=628753&r1=628752&r2=628753&view=diff
==============================================================================
--- incubator/sling/trunk/api/src/main/java/org/apache/sling/api/scripting/SlingScriptResolver.java (original)
+++ incubator/sling/trunk/api/src/main/java/org/apache/sling/api/scripting/SlingScriptResolver.java Mon Feb 18 06:27:36 2008
@@ -16,7 +16,6 @@
*/
package org.apache.sling.api.scripting;
-import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.resource.ResourceResolver;
/**
@@ -60,9 +59,9 @@
* @param name The script name. Must not be <code>null</code>.
* @return The {@link SlingScript} to which the name resolved or
* <code>null</code> otherwise.
- * @throws AccessControlException If the requested script cannot be accessed
+ * @throws java.security.AccessControlException If the requested script cannot be accessed
* due to access control restrictions.
- * @throws SlingException If an error occurrs trying to resolve the name.
+ * @throws org.apache.sling.api.SlingException If an error occurrs trying to resolve the name.
*/
SlingScript findScript(ResourceResolver resourceResolver, String name);
}
Modified: incubator/sling/trunk/api/src/main/java/org/apache/sling/api/servlets/ServletResolver.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/api/src/main/java/org/apache/sling/api/servlets/ServletResolver.java?rev=628753&r1=628752&r2=628753&view=diff
==============================================================================
--- incubator/sling/trunk/api/src/main/java/org/apache/sling/api/servlets/ServletResolver.java (original)
+++ incubator/sling/trunk/api/src/main/java/org/apache/sling/api/servlets/ServletResolver.java Mon Feb 18 06:27:36 2008
@@ -45,15 +45,15 @@
* The returned servlet must be assumed to be initialized and ready to run.
* That is, the <code>init</code> nor the <code>destroy</code> methods
* must <em>NOT</em> be called on the returned servlet.
- *
+ *
* @param request The {@link SlingHttpServletRequest} object used to drive
* selection of the servlet.
* @return The servlet whose <code>service</code> method may be called to
* handle the request.
- * @throws AccessControlException If the script to which the request
+ * @throws java.security.AccessControlException If the script to which the request
* resolves cannot be accessed due to access control
* restrictions.
- * @throws SlingException Is thrown if an error occurrs while trying to find
+ * @throws org.apache.sling.api.SlingException Is thrown if an error occurrs while trying to find
* an appropriate servlet to handle the request or if no servlet
* could be resolved to handle the request.
*/
Modified: incubator/sling/trunk/jcr/ocm/src/main/java/org/apache/sling/jcr/ocm/DefaultMappedObject.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/ocm/src/main/java/org/apache/sling/jcr/ocm/DefaultMappedObject.java?rev=628753&r1=628752&r2=628753&view=diff
==============================================================================
--- incubator/sling/trunk/jcr/ocm/src/main/java/org/apache/sling/jcr/ocm/DefaultMappedObject.java (original)
+++ incubator/sling/trunk/jcr/ocm/src/main/java/org/apache/sling/jcr/ocm/DefaultMappedObject.java Mon Feb 18 06:27:36 2008
@@ -34,7 +34,7 @@
* type <code>nt:unstructured</code> without any mixin types is created
* <li>All non-protected properties are simply read and may be accessed in the
* Java standard <code>Map</code> style using the {@link #get(Object)} and
- * {@link #put(Object, Object)} methods.
+ * {@link #put(String, Object)} methods.
* <li>Storing the object back to the repository just writes the map contents
* into the properties. Care must be taken to obey the node type restrictions if
* setting properties, otherwise storing back may fail.
Modified: incubator/sling/trunk/jcr/ocm/src/main/java/org/apache/sling/jcr/ocm/impl/BundleMapper.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/ocm/src/main/java/org/apache/sling/jcr/ocm/impl/BundleMapper.java?rev=628753&r1=628752&r2=628753&view=diff
==============================================================================
--- incubator/sling/trunk/jcr/ocm/src/main/java/org/apache/sling/jcr/ocm/impl/BundleMapper.java (original)
+++ incubator/sling/trunk/jcr/ocm/src/main/java/org/apache/sling/jcr/ocm/impl/BundleMapper.java Mon Feb 18 06:27:36 2008
@@ -32,6 +32,7 @@
this.mappingDescriptor = mappingDescriptor;
}
+ @SuppressWarnings("unchecked")
public ClassDescriptor getClassDescriptorByClass(Class clazz) {
return this.mappingDescriptor.getClassDescriptorByName(clazz.getName());
}
@@ -48,6 +49,7 @@
return this.toStringArray(this.mappingDescriptor.getClassDescriptorsByNodeType());
}
+ @SuppressWarnings("unchecked")
private String[] toStringArray(Map map) {
return (String[]) map.keySet().toArray(new String[map.size()]);
}
Modified: incubator/sling/trunk/jcr/ocm/src/main/java/org/apache/sling/jcr/ocm/impl/ClassDescriptorReader.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/ocm/src/main/java/org/apache/sling/jcr/ocm/impl/ClassDescriptorReader.java?rev=628753&r1=628752&r2=628753&view=diff
==============================================================================
--- incubator/sling/trunk/jcr/ocm/src/main/java/org/apache/sling/jcr/ocm/impl/ClassDescriptorReader.java (original)
+++ incubator/sling/trunk/jcr/ocm/src/main/java/org/apache/sling/jcr/ocm/impl/ClassDescriptorReader.java Mon Feb 18 06:27:36 2008
@@ -439,6 +439,7 @@
}
}
+ @SuppressWarnings("unchecked")
private List<String> solveReferences(List<String> errors, List<ClassDescriptor> rootClassDescriptors) {
Set<ClassDescriptor> toRemove = new HashSet<ClassDescriptor>();
for( ClassDescriptor cd : (Collection<ClassDescriptor>)this.descriptors.getClassDescriptorsByClassName().values() ) {
@@ -492,6 +493,7 @@
return errors;
}
+ @SuppressWarnings("unchecked")
private void dropClassDescriptor(ClassDescriptor cd) {
// remove descriptor
this.descriptors.getClassDescriptorsByClassName().remove(cd.getClassName());
@@ -513,6 +515,7 @@
* @param classDescriptors the ancestor classdescriptors
* @return
*/
+ @SuppressWarnings("unchecked")
private List<String> validateDescriptors(List<String> errors, Collection<ClassDescriptor> classDescriptors) {
for (ClassDescriptor classDescriptor : classDescriptors) {
try {
Modified: incubator/sling/trunk/jcr/ocm/src/main/java/org/apache/sling/jcr/ocm/impl/SlingAtomicTypeConverterProvider.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/ocm/src/main/java/org/apache/sling/jcr/ocm/impl/SlingAtomicTypeConverterProvider.java?rev=628753&r1=628752&r2=628753&view=diff
==============================================================================
--- incubator/sling/trunk/jcr/ocm/src/main/java/org/apache/sling/jcr/ocm/impl/SlingAtomicTypeConverterProvider.java (original)
+++ incubator/sling/trunk/jcr/ocm/src/main/java/org/apache/sling/jcr/ocm/impl/SlingAtomicTypeConverterProvider.java Mon Feb 18 06:27:36 2008
@@ -31,6 +31,7 @@
public class SlingAtomicTypeConverterProvider extends
DefaultAtomicTypeConverterProvider {
+ @SuppressWarnings("unchecked")
protected Map registerDefaultAtomicTypeConverters() {
Map converters = super.registerDefaultAtomicTypeConverters();
Modified: incubator/sling/trunk/jcr/ocm/src/main/java/org/apache/sling/jcr/ocm/impl/classloader/BundleLoader.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/ocm/src/main/java/org/apache/sling/jcr/ocm/impl/classloader/BundleLoader.java?rev=628753&r1=628752&r2=628753&view=diff
==============================================================================
--- incubator/sling/trunk/jcr/ocm/src/main/java/org/apache/sling/jcr/ocm/impl/classloader/BundleLoader.java (original)
+++ incubator/sling/trunk/jcr/ocm/src/main/java/org/apache/sling/jcr/ocm/impl/classloader/BundleLoader.java Mon Feb 18 06:27:36 2008
@@ -33,9 +33,9 @@
}
/**
- * @see org.apache.sling.jcr.resource.internal.mapping.classloader.Loader#loadClass(java.lang.String)
+ * @see org.apache.sling.jcr.ocm.impl.classloader.Loader#loadClass(java.lang.String)
*/
- public Class loadClass(String name) throws ClassNotFoundException {
+ public Class<?> loadClass(String name) throws ClassNotFoundException {
try {
// to prevent nasty messages, we check for the class resource
// before actually accessing the class
@@ -53,7 +53,7 @@
}
/**
- * @see org.apache.sling.jcr.resource.internal.mapping.classloader.Loader#getLoader()
+ * @see org.apache.sling.jcr.ocm.impl.classloader.Loader#getLoader()
*/
public Object getLoader() {
return this.bundle;
Modified: incubator/sling/trunk/jcr/ocm/src/main/java/org/apache/sling/jcr/ocm/impl/classloader/ClassLoaderLoader.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/ocm/src/main/java/org/apache/sling/jcr/ocm/impl/classloader/ClassLoaderLoader.java?rev=628753&r1=628752&r2=628753&view=diff
==============================================================================
--- incubator/sling/trunk/jcr/ocm/src/main/java/org/apache/sling/jcr/ocm/impl/classloader/ClassLoaderLoader.java (original)
+++ incubator/sling/trunk/jcr/ocm/src/main/java/org/apache/sling/jcr/ocm/impl/classloader/ClassLoaderLoader.java Mon Feb 18 06:27:36 2008
@@ -29,15 +29,12 @@
this.classLoader = classLoader;
}
- /**
- * @see org.apache.sling.jcr.resource.internal.mapping.classloader.Loader#loadClass(java.lang.String)
- */
- public Class loadClass(String name) throws ClassNotFoundException {
+ public Class<?> loadClass(String name) throws ClassNotFoundException {
return this.classLoader.loadClass(name);
}
/**
- * @see org.apache.sling.jcr.resource.internal.mapping.classloader.Loader#getLoader()
+ * @see org.apache.sling.jcr.ocm.impl.classloader.Loader#getLoader()
*/
public Object getLoader() {
return this.classLoader;
Modified: incubator/sling/trunk/jcr/ocm/src/main/java/org/apache/sling/jcr/ocm/impl/classloader/Loader.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/ocm/src/main/java/org/apache/sling/jcr/ocm/impl/classloader/Loader.java?rev=628753&r1=628752&r2=628753&view=diff
==============================================================================
--- incubator/sling/trunk/jcr/ocm/src/main/java/org/apache/sling/jcr/ocm/impl/classloader/Loader.java (original)
+++ incubator/sling/trunk/jcr/ocm/src/main/java/org/apache/sling/jcr/ocm/impl/classloader/Loader.java Mon Feb 18 06:27:36 2008
@@ -20,7 +20,7 @@
public interface Loader {
- Class loadClass(String name) throws ClassNotFoundException;
+ Class<?> loadClass(String name) throws ClassNotFoundException;
Object getLoader();
}
Modified: incubator/sling/trunk/jcr/ocm/src/main/java/org/apache/sling/jcr/ocm/impl/classloader/LoaderDelegate.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/ocm/src/main/java/org/apache/sling/jcr/ocm/impl/classloader/LoaderDelegate.java?rev=628753&r1=628752&r2=628753&view=diff
==============================================================================
--- incubator/sling/trunk/jcr/ocm/src/main/java/org/apache/sling/jcr/ocm/impl/classloader/LoaderDelegate.java (original)
+++ incubator/sling/trunk/jcr/ocm/src/main/java/org/apache/sling/jcr/ocm/impl/classloader/LoaderDelegate.java Mon Feb 18 06:27:36 2008
@@ -26,7 +26,7 @@
return new LoadingDelegate(loader, className);
}
- static LoaderDelegate create(Loader loader, Class clazz) {
+ static LoaderDelegate create(Loader loader, Class<?> clazz) {
return new ReturningDelegate(loader, clazz);
}
@@ -34,7 +34,7 @@
this.loader = loader;
}
- abstract Class loadClass() throws ClassNotFoundException;
+ abstract Class<?> loadClass() throws ClassNotFoundException;
final Object getLoader() {
return this.loader.getLoader();
@@ -47,19 +47,19 @@
this.className = className;
}
- Class loadClass() throws ClassNotFoundException {
+ Class<?> loadClass() throws ClassNotFoundException {
return this.loader.loadClass(this.className);
}
}
private static class ReturningDelegate extends LoaderDelegate {
- private Class clazz;
- ReturningDelegate(Loader loader, Class clazz) {
+ private Class<?> clazz;
+ ReturningDelegate(Loader loader, Class<?> clazz) {
super(loader);
this.clazz = clazz;
}
- Class loadClass() {
+ Class<?> loadClass() {
return this.clazz;
}
}
Modified: incubator/sling/trunk/jcr/ocm/src/main/java/org/apache/sling/jcr/ocm/impl/classloader/MapperClassLoader.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/ocm/src/main/java/org/apache/sling/jcr/ocm/impl/classloader/MapperClassLoader.java?rev=628753&r1=628752&r2=628753&view=diff
==============================================================================
--- incubator/sling/trunk/jcr/ocm/src/main/java/org/apache/sling/jcr/ocm/impl/classloader/MapperClassLoader.java (original)
+++ incubator/sling/trunk/jcr/ocm/src/main/java/org/apache/sling/jcr/ocm/impl/classloader/MapperClassLoader.java Mon Feb 18 06:27:36 2008
@@ -140,7 +140,7 @@
this.delegateeLoaders.put(className, LoaderDelegate.create(loader, className));
}
- private void registerClassInternal(Class clazz, Loader loader) {
+ private void registerClassInternal(Class<?> clazz, Loader loader) {
this.delegateeLoaders.put(clazz.getName(), LoaderDelegate.create(loader, clazz));
}
Modified: incubator/sling/trunk/scripting/resolver/src/main/java/org/apache/sling/scripting/resolver/impl/helper/OnDemandReaderRequest.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/scripting/resolver/src/main/java/org/apache/sling/scripting/resolver/impl/helper/OnDemandReaderRequest.java?rev=628753&r1=628752&r2=628753&view=diff
==============================================================================
--- incubator/sling/trunk/scripting/resolver/src/main/java/org/apache/sling/scripting/resolver/impl/helper/OnDemandReaderRequest.java (original)
+++ incubator/sling/trunk/scripting/resolver/src/main/java/org/apache/sling/scripting/resolver/impl/helper/OnDemandReaderRequest.java Mon Feb 18 06:27:36 2008
@@ -19,7 +19,6 @@
package org.apache.sling.scripting.resolver.impl.helper;
import java.io.BufferedReader;
-import java.io.IOException;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.wrappers.SlingHttpServletRequestWrapper;
@@ -27,11 +26,11 @@
public class OnDemandReaderRequest extends SlingHttpServletRequestWrapper {
private BufferedReader reader;
-
+
public OnDemandReaderRequest(SlingHttpServletRequest request) {
super(request);
}
-
+
@Override
public BufferedReader getReader() {
if (reader == null) {
Modified: incubator/sling/trunk/sling/adapter/src/main/java/org/apache/sling/adapter/SlingAdaptable.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/sling/adapter/src/main/java/org/apache/sling/adapter/SlingAdaptable.java?rev=628753&r1=628752&r2=628753&view=diff
==============================================================================
--- incubator/sling/trunk/sling/adapter/src/main/java/org/apache/sling/adapter/SlingAdaptable.java (original)
+++ incubator/sling/trunk/sling/adapter/src/main/java/org/apache/sling/adapter/SlingAdaptable.java Mon Feb 18 06:27:36 2008
@@ -24,7 +24,7 @@
/**
* The <code>SlingAdaptable</code> class is an (abstract) default
* implementation of the <code>Adaptable</code> interface. It just uses the
- * default {@link AdapterManager} implemented in this bundle to adapt the itself
+ * default {@link org.apache.sling.api.adapter.AdapterManager} implemented in this bundle to adapt the itself
* to the requested type.
* <p>
* Extensions of this class may overwrite the {@link #adaptTo(Class)} method
Modified: incubator/sling/trunk/sling/adapter/src/main/java/org/apache/sling/adapter/internal/AdapterFactoryDescriptorKey.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/sling/adapter/src/main/java/org/apache/sling/adapter/internal/AdapterFactoryDescriptorKey.java?rev=628753&r1=628752&r2=628753&view=diff
==============================================================================
--- incubator/sling/trunk/sling/adapter/src/main/java/org/apache/sling/adapter/internal/AdapterFactoryDescriptorKey.java (original)
+++ incubator/sling/trunk/sling/adapter/src/main/java/org/apache/sling/adapter/internal/AdapterFactoryDescriptorKey.java Mon Feb 18 06:27:36 2008
@@ -26,7 +26,7 @@
* The <code>AdapterFactoryDescriptorKey</code> provides the indexing
* functionality for the {@link AdapterFactoryDescriptorMap}. The key consists
* of the OSGi <code>service.id</code> of the
- * {@link org.apache.sling.osgi.commons.AdapterFactory} service and the ID of
+ * {@link org.apache.sling.api.adapter.AdapterFactory} service and the ID of
* the the bundle providing the service.
* <p>
* Sort order among the keys is defined primarily by the bundle id and
Modified: incubator/sling/trunk/sling/adapter/src/main/java/org/apache/sling/adapter/internal/AdapterFactoryDescriptorMap.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/sling/adapter/src/main/java/org/apache/sling/adapter/internal/AdapterFactoryDescriptorMap.java?rev=628753&r1=628752&r2=628753&view=diff
==============================================================================
--- incubator/sling/trunk/sling/adapter/src/main/java/org/apache/sling/adapter/internal/AdapterFactoryDescriptorMap.java (original)
+++ incubator/sling/trunk/sling/adapter/src/main/java/org/apache/sling/adapter/internal/AdapterFactoryDescriptorMap.java Mon Feb 18 06:27:36 2008
@@ -24,7 +24,7 @@
* The <code>AdapterFactoryDescriptorMap</code> is a sorted map of
* {@link AdapterFactoryDescriptor} instances indexed (and ordered) by their
* {@link AdapterFactoryDescriptorKey}. This map is used to organize the
- * registered {@link org.apache.sling.osgi.commons.AdapterFactory} services for
+ * registered {@link org.apache.sling.api.adapter.AdapterFactory} services for
* a given adaptable type.
* <p>
* Each entry in the map is a {@link AdapterFactoryDescriptor} thus enabling the
Modified: incubator/sling/trunk/sling/core/src/main/java/org/apache/sling/core/impl/parameters/EncodedRequestParameter.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/sling/core/src/main/java/org/apache/sling/core/impl/parameters/EncodedRequestParameter.java?rev=628753&r1=628752&r2=628753&view=diff
==============================================================================
--- incubator/sling/trunk/sling/core/src/main/java/org/apache/sling/core/impl/parameters/EncodedRequestParameter.java (original)
+++ incubator/sling/trunk/sling/core/src/main/java/org/apache/sling/core/impl/parameters/EncodedRequestParameter.java Mon Feb 18 06:27:36 2008
@@ -21,7 +21,6 @@
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
/**
* The <code>EncodedRequestParameter</code> TODO
Modified: incubator/sling/trunk/sling/core/src/main/java/org/apache/sling/core/impl/request/RequestData.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/sling/core/src/main/java/org/apache/sling/core/impl/request/RequestData.java?rev=628753&r1=628752&r2=628753&view=diff
==============================================================================
--- incubator/sling/trunk/sling/core/src/main/java/org/apache/sling/core/impl/request/RequestData.java (original)
+++ incubator/sling/trunk/sling/core/src/main/java/org/apache/sling/core/impl/request/RequestData.java Mon Feb 18 06:27:36 2008
@@ -29,7 +29,6 @@
import java.util.LinkedList;
import java.util.Locale;
-import javax.jcr.Session;
import javax.servlet.Servlet;
import javax.servlet.ServletException;
import javax.servlet.ServletInputStream;
@@ -47,12 +46,12 @@
import org.apache.sling.api.request.RequestPathInfo;
import org.apache.sling.api.request.RequestProgressTracker;
import org.apache.sling.api.resource.Resource;
-import org.apache.sling.api.resource.ResourceNotFoundException;
import org.apache.sling.api.resource.ResourceResolver;
import org.apache.sling.api.services.ServiceLocator;
import org.apache.sling.api.servlets.ServletResolver;
import org.apache.sling.api.wrappers.SlingHttpServletRequestWrapper;
import org.apache.sling.api.wrappers.SlingHttpServletResponseWrapper;
+import org.apache.sling.core.CoreConstants;
import org.apache.sling.core.RequestUtil;
import org.apache.sling.core.impl.SlingHttpServletRequestImpl;
import org.apache.sling.core.impl.SlingHttpServletResponseImpl;
@@ -61,7 +60,6 @@
import org.apache.sling.core.impl.output.BufferProvider;
import org.apache.sling.core.impl.parameters.ParameterSupport;
import org.apache.sling.core.theme.Theme;
-import org.apache.sling.jcr.resource.JcrResourceResolverFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -69,7 +67,7 @@
* The <code>RequestData</code> class provides access to objects which are set
* on a Servlet Request wide basis such as the repository session, the
* persistence manager, etc.
- *
+ *
* @see ContentData
*/
public class RequestData implements BufferProvider {
@@ -117,7 +115,7 @@
/**
* The name of the currently active serlvet.
- *
+ *
* @see #setActiveServletName(String)
* @see #getActiveServletName()
*/
@@ -141,7 +139,7 @@
this.resourceResolver = resourceResolver;
}
-
+
public void init() {
// resolve the resource and the request path info, will never be null
@@ -210,7 +208,7 @@
/**
* Unwraps the ServletRequest to a SlingHttpServletRequest.
- *
+ *
* @throws IllegalArgumentException If the <code>request</code> is not a
* <code>SlingHttpServletRequest</code> and not a
* <code>ServletRequestWrapper</code> wrapping a
@@ -241,7 +239,7 @@
/**
* Unwraps the SlingHttpServletRequest to a SlingHttpServletRequestImpl
- *
+ *
* @param request
* @throws IllegalArgumentException If <code>request</code> is not a
* <code>SlingHttpServletRequestImpl</code> and not
@@ -264,7 +262,7 @@
/**
* Unwraps the ServletRequest to a SlingHttpServletRequest.
- *
+ *
* @throws IllegalArgumentException If the <code>response</code> is not a
* <code>SlingHttpServletResponse</code> and not a
* <code>ServletResponseWrapper</code> wrapping a
@@ -295,7 +293,7 @@
/**
* Unwraps a SlingHttpServletResponse to a SlingHttpServletResponseImpl
- *
+ *
* @param response
* @throws IllegalArgumentException If <code>response</code> is not a
* <code>SlingHttpServletResponseImpl</code> and not
@@ -384,7 +382,7 @@
*/
public static SlingHttpServletResponse toSlingHttpServletResponse(
ServletResponse response) {
-
+
// unwrap to SlingHttpServletResponse
SlingHttpServletResponse cResponse = unwrap(response);
@@ -423,7 +421,7 @@
* servlet terminates normally. In case of a Throwable, the active servlet
* name is not reset and indicates which servlet caused the potential abort
* of the request.
- *
+ *
* @param request The request object for the service method
* @param response The response object for the service method
* @throws IOException May be thrown by the servlet's service method
Modified: incubator/sling/trunk/sling/core/src/main/java/org/apache/sling/core/impl/request/SlingRequestDispatcher.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/sling/core/src/main/java/org/apache/sling/core/impl/request/SlingRequestDispatcher.java?rev=628753&r1=628752&r2=628753&view=diff
==============================================================================
--- incubator/sling/trunk/sling/core/src/main/java/org/apache/sling/core/impl/request/SlingRequestDispatcher.java (original)
+++ incubator/sling/trunk/sling/core/src/main/java/org/apache/sling/core/impl/request/SlingRequestDispatcher.java Mon Feb 18 06:27:36 2008
@@ -29,9 +29,6 @@
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.request.RequestDispatcherOptions;
import org.apache.sling.api.resource.Resource;
-import org.apache.sling.api.resource.ResourceMetadata;
-import org.apache.sling.api.resource.ResourceProvider;
-import org.apache.sling.api.resource.ResourceResolver;
import org.apache.sling.api.resource.ResourceWrapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Modified: incubator/sling/trunk/sling/core/src/main/java/org/apache/sling/core/impl/request/SlingRequestPathInfo.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/sling/core/src/main/java/org/apache/sling/core/impl/request/SlingRequestPathInfo.java?rev=628753&r1=628752&r2=628753&view=diff
==============================================================================
--- incubator/sling/trunk/sling/core/src/main/java/org/apache/sling/core/impl/request/SlingRequestPathInfo.java (original)
+++ incubator/sling/trunk/sling/core/src/main/java/org/apache/sling/core/impl/request/SlingRequestPathInfo.java Mon Feb 18 06:27:36 2008
@@ -19,7 +19,6 @@
import org.apache.sling.api.request.RequestDispatcherOptions;
import org.apache.sling.api.request.RequestPathInfo;
import org.apache.sling.api.resource.Resource;
-import org.apache.sling.api.resource.ResourceMetadata;
/**
* microsling request URI parser that provides SlingRequestPathInfo for the
@@ -77,7 +76,7 @@
suffix = pathToParse.substring(0, lastDot).substring(1);
extension = pathToParse.substring(lastDot + 1);
} else {
- extension = null;
+ extension = null;
suffix = pathToParse;
}
Modified: incubator/sling/trunk/sling/servlet-resolver/src/main/java/org/apache/sling/servlet/resolver/SlingServletResolver.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/sling/servlet-resolver/src/main/java/org/apache/sling/servlet/resolver/SlingServletResolver.java?rev=628753&r1=628752&r2=628753&view=diff
==============================================================================
--- incubator/sling/trunk/sling/servlet-resolver/src/main/java/org/apache/sling/servlet/resolver/SlingServletResolver.java (original)
+++ incubator/sling/trunk/sling/servlet-resolver/src/main/java/org/apache/sling/servlet/resolver/SlingServletResolver.java Mon Feb 18 06:27:36 2008
@@ -142,13 +142,13 @@
Iterator<String> pathIterator = PathSupport.getPathIterator(request,
path);
servlet = getServlet(resolver, pathIterator, baseName);
-
+
// (2) GET/HEAD and according to resource type and selectors
if (servlet == null && !baseName.equals(request.getMethod())) {
pathIterator = PathSupport.getPathIterator(request, path);
servlet = getServlet(resolver, pathIterator, request.getMethod());
}
-
+
// (3) default script name and default servlet name and selectors
if (servlet == null) {
pathIterator = PathSupport.getPathIterator(DEFAULT_SERVLET_NAME, path);
@@ -220,9 +220,7 @@
// ---------- ErrorHandler interface --------------------------------------
/**
- * @see org.apache.sling.core.servlets.ErrorHandler#handleError(int,
- * java.lang.String, javax.servlet.http.HttpServletRequest,
- * javax.servlet.http.HttpServletResponse)
+ * @see org.apache.sling.core.servlets.ErrorHandler#handleError(int, String, SlingHttpServletRequest, SlingHttpServletResponse)
*/
public void handleError(int status, String message,
SlingHttpServletRequest request, SlingHttpServletResponse response)
@@ -317,11 +315,11 @@
+ location + "/" + baseName, se);
}
}
-
+
// exhausted all
return null;
}
-
+
private Servlet getServletAt(ResourceResolver resolver, String location,
String baseName) throws SlingException {
Servlet result = null;
Modified: incubator/sling/trunk/sling/servlet-resolver/src/main/java/org/apache/sling/servlet/resolver/defaults/DefaultServlet.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/sling/servlet-resolver/src/main/java/org/apache/sling/servlet/resolver/defaults/DefaultServlet.java?rev=628753&r1=628752&r2=628753&view=diff
==============================================================================
--- incubator/sling/trunk/sling/servlet-resolver/src/main/java/org/apache/sling/servlet/resolver/defaults/DefaultServlet.java (original)
+++ incubator/sling/trunk/sling/servlet-resolver/src/main/java/org/apache/sling/servlet/resolver/defaults/DefaultServlet.java Mon Feb 18 06:27:36 2008
@@ -73,14 +73,14 @@
// check whether we have a directly addressed script
if (extension == null) {
-
+
// check whether the resource adapts to a stream, spool then
InputStream stream = resource.adaptTo(InputStream.class);
if (stream != null) {
stream(response, resource, stream);
return;
}
-
+
}
// format response according to extension (use Mime mapping instead)
@@ -220,9 +220,9 @@
private void stream(HttpServletResponse response, Resource resource,
InputStream stream) throws IOException {
-
+
ResourceMetadata meta = resource.getResourceMetadata();
-
+
String contentType = meta.getContentType();
if (contentType == null) {
contentType = getServletContext().getMimeType(resource.getPath());
@@ -230,38 +230,27 @@
if (contentType != null) {
response.setContentType(contentType);
}
-
+
String encoding = meta.getCharacterEncoding();
if (encoding != null) {
response.setCharacterEncoding(encoding);
}
-
+
try {
OutputStream out = response.getOutputStream();
-
+
byte[] buf = new byte[1024];
int rd;
while ( (rd=stream.read(buf)) >= 0) {
out.write(buf, 0, rd);
}
-
+
} finally {
try {
stream.close();
} catch (IOException ignore) {
// don't care
}
- }
- }
-
- private void printObjectJson(PrintWriter pw, Object object) {
- boolean quote = !((object instanceof Boolean) || (object instanceof Number));
- if (quote) {
- pw.print('"');
- }
- pw.print(object);
- if (quote) {
- pw.print('"');
}
}
Modified: incubator/sling/trunk/sling/servlet-resolver/src/main/java/org/apache/sling/servlet/resolver/resource/ServletResource.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/sling/servlet-resolver/src/main/java/org/apache/sling/servlet/resolver/resource/ServletResource.java?rev=628753&r1=628752&r2=628753&view=diff
==============================================================================
--- incubator/sling/trunk/sling/servlet-resolver/src/main/java/org/apache/sling/servlet/resolver/resource/ServletResource.java (original)
+++ incubator/sling/trunk/sling/servlet-resolver/src/main/java/org/apache/sling/servlet/resolver/resource/ServletResource.java Mon Feb 18 06:27:36 2008
@@ -23,7 +23,6 @@
import org.apache.sling.adapter.SlingAdaptable;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.resource.ResourceMetadata;
-import org.apache.sling.api.resource.ResourceProvider;
import org.apache.sling.api.resource.ResourceResolver;
class ServletResource extends SlingAdaptable implements Resource {
@@ -84,7 +83,7 @@
if (servletName == null) {
servletName = servlet.getClass().getName();
}
-
+
return getClass().getSimpleName() + ", servlet=" + servletName
+ ", path=" + getPath();
}
Modified: incubator/sling/trunk/sling/servlet-resolver/src/main/java/org/apache/sling/servlet/resolver/resource/ServletResourceProvider.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/sling/servlet-resolver/src/main/java/org/apache/sling/servlet/resolver/resource/ServletResourceProvider.java?rev=628753&r1=628752&r2=628753&view=diff
==============================================================================
--- incubator/sling/trunk/sling/servlet-resolver/src/main/java/org/apache/sling/servlet/resolver/resource/ServletResourceProvider.java (original)
+++ incubator/sling/trunk/sling/servlet-resolver/src/main/java/org/apache/sling/servlet/resolver/resource/ServletResourceProvider.java Mon Feb 18 06:27:36 2008
@@ -26,7 +26,6 @@
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;