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/05 16:20:36 UTC
svn commit: r618671 - in /incubator/sling/trunk:
jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/
sling/core/src/main/java/org/apache/sling/core/impl/
sling/core/src/main/java/org/apache/sling/core/impl/request/
Author: cziegeler
Date: Tue Feb 5 07:20:33 2008
New Revision: 618671
URL: http://svn.apache.org/viewvc?rev=618671&view=rev
Log:
Fix potential NPE and correct typos.
Modified:
incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/ResourceProviderEntry.java
incubator/sling/trunk/sling/core/src/main/java/org/apache/sling/core/impl/SlingMainServlet.java
incubator/sling/trunk/sling/core/src/main/java/org/apache/sling/core/impl/request/SlingRequestDispatcher.java
Modified: incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/ResourceProviderEntry.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/ResourceProviderEntry.java?rev=618671&r1=618670&r2=618671&view=diff
==============================================================================
--- incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/ResourceProviderEntry.java (original)
+++ incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/ResourceProviderEntry.java Tue Feb 5 07:20:33 2008
@@ -31,7 +31,7 @@
private final String prefix;
private final ResourceProvider provider;
-
+
private final ResourceProviderEntry parentEntry;
private ResourceProviderEntry[] entries;
@@ -58,11 +58,11 @@
public ResourceProviderEntry getParentEntry() {
return parentEntry;
}
-
+
public ResourceProvider getResourceProvider() {
return provider;
}
-
+
public ResourceProviderEntry[] getEntries() {
return entries;
}
Modified: incubator/sling/trunk/sling/core/src/main/java/org/apache/sling/core/impl/SlingMainServlet.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/sling/core/src/main/java/org/apache/sling/core/impl/SlingMainServlet.java?rev=618671&r1=618670&r2=618671&view=diff
==============================================================================
--- incubator/sling/trunk/sling/core/src/main/java/org/apache/sling/core/impl/SlingMainServlet.java (original)
+++ incubator/sling/trunk/sling/core/src/main/java/org/apache/sling/core/impl/SlingMainServlet.java Tue Feb 5 07:20:33 2008
@@ -81,7 +81,7 @@
/**
* The <code>SlingMainServlet</code> TODO
- *
+ *
* @scr.component immediate="true" label="%sling.name"
* description="%sling.description"
* @scr.property name="sling.root" value="/" private="true"
@@ -151,7 +151,7 @@
public static final String INCLUDE_COUNTER = "Sling.ScriptHelper.include.counter";
public static final int MAX_INCLUDE_RECURSION_LEVEL = 50;
-
+
public static class InfiniteIncludeLoopException extends SlingException {
InfiniteIncludeLoopException(String path) {
super("Infinite include loop (> " + MAX_INCLUDE_RECURSION_LEVEL + " levels) for path '" + path + "'");
@@ -228,10 +228,10 @@
} else if(mimeTypeService == null) {
missing = "MimeTypeService";
}
-
+
if(missing != null) {
final String err = missing + " service missing, cannot service requests";
- final int status = HttpServletResponse.SC_SERVICE_UNAVAILABLE;
+ final int status = HttpServletResponse.SC_SERVICE_UNAVAILABLE;
log.error(err + ", sending status " + status);
sendError(status, err, null, servletRequest, servletResponse);
return;
@@ -275,7 +275,7 @@
// send this exception as a 404 status
log.info("service: Resource {} not found", rnfe.getResource());
-
+
getErrorHandler().handleError(HttpServletResponse.SC_NOT_FOUND,
rnfe.getMessage(), request, response);
@@ -332,7 +332,7 @@
ServletException {
checkRecursionLevel(request, path);
-
+
// check type of response, don't care actually for the response itself
RequestData.unwrap(response);
@@ -353,8 +353,8 @@
RequestPathInfo resolvedURL) throws IOException, ServletException {
checkRecursionLevel(request, resolvedURL.getResourcePath());
-
- // we need a ComponentRequest/ComponentResponse tupel to continue
+
+ // we need a SlingHttpServletRequest/SlingHttpServletResponse tupel to continue
SlingHttpServletRequest cRequest = RequestData.toSlingHttpServletRequest(request);
SlingHttpServletResponse cResponse = RequestData.toSlingHttpServletResponse(response);
@@ -372,7 +372,7 @@
requestData.popContent();
}
}
-
+
/** Add a recursion counter to req and fail if it's too high */
protected void checkRecursionLevel(ServletRequest request, String info) throws InfiniteIncludeLoopException {
// Detect infinite loops
@@ -747,5 +747,5 @@
}
return stringConfig;
}
-
+
}
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=618671&r1=618670&r2=618671&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 Tue Feb 5 07:20:33 2008
@@ -51,7 +51,8 @@
RequestDispatcherOptions options) {
this.resource = resource;
this.options = options;
- this.path = resource.getPath();
+ // TODO Is the empty path ok?
+ this.path = (resource == null ? "" : resource.getPath());
}
public void include(ServletRequest request, ServletResponse response)