Author: cziegeler
Date: Tue Nov 3 23:29:09 2009
New Revision: 832600
URL: http://svn.apache.org/viewvc?rev=832600&view=rev
Log:
Clean up code
Modified:
sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/auth/AuthenticationHandler2.java
sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/SlingHttpServletResponseImpl.java
sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/request/SlingRequestProgressTracker.java
Modified:
sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/auth/AuthenticationHandler2.java
URL:
http://svn.apache.org/viewvc/sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/auth/AuthenticationHandler2.java?rev=832600&r1=832599&r2=832600&view=diff
==============================================================================
---
sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/auth/AuthenticationHandler2.java
(original)
+++
sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/auth/AuthenticationHandler2.java
Tue Nov 3 23:29:09 2009
@@ -29,7 +29,7 @@
* extracting credentials from the request.
* <p>
* Authentication handlers implementing this interface should still be
- * registered with the {...@link AuthenticationHandler#SERVICE authentication
+ * registered with the {...@link AuthenticationHandler#SERVICE_NAME
authentication
* handler service name}. Internally, the
* {...@link Authenticator#logout(HttpServletRequest, HttpServletResponse)}
method
* will identify the authentication handler appropriately.
Modified:
sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/SlingHttpServletResponseImpl.java
URL:
http://svn.apache.org/viewvc/sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/SlingHttpServletResponseImpl.java?rev=832600&r1=832599&r2=832600&view=diff
==============================================================================
---
sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/SlingHttpServletResponseImpl.java
(original)
+++
sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/SlingHttpServletResponseImpl.java
Tue Nov 3 23:29:09 2009
@@ -121,19 +121,19 @@
}
//---------- Adaptable interface
-
+
public <AdapterType> AdapterType adaptTo(Class<AdapterType> type) {
AdapterManager adapterManager = getRequestData().getAdapterManager();
if (adapterManager != null) {
return adapterManager.getAdapter(this, type);
}
-
+
// no adapter manager, nothing to adapt to
return null;
}
-
+
//---------- SlingHttpServletResponse interface
-
+
@Override
public void flushBuffer() throws IOException {
getRequestData().getContentData().flushBuffer();
@@ -430,6 +430,7 @@
* of potentially existing header values. Otherwise the new
value
* replaces any existing values.
*/
+ @SuppressWarnings("unchecked")
private void registerHeader(String name, String value, boolean add) {
// ensure the headers map
if (this.headers == null) {
Modified:
sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/request/SlingRequestProgressTracker.java
URL:
http://svn.apache.org/viewvc/sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/request/SlingRequestProgressTracker.java?rev=832600&r1=832599&r2=832600&view=diff
==============================================================================
---
sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/request/SlingRequestProgressTracker.java
(original)
+++
sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/request/SlingRequestProgressTracker.java
Tue Nov 3 23:29:09 2009
@@ -97,22 +97,22 @@
* @see #dumpText(PrintWriter)
*/
private static final String DUMP_FORMAT = "%1$7d (%2$tF %2$tT) %3$s%n";
-
+
/**
* The name of the timer tracking the processing time of the complete
* process.
*/
private static final String REQUEST_PROCESSING_TIMER = "Request
Processing";
-
+
/** Prefix for log messages */
private static final String LOG_PREFIX = "LOG ";
-
+
/** Prefix for comment messages */
private static final String COMMENT_PREFIX = "COMMENT ";
-
+
/** TIMER_END format explanation */
private static final String TIMER_END_FORMAT = "{<elapsed msec>,<timer
name>} <optional message>";
-
+
/**
* The system time at creation of this instance or the last {...@link
#reset()}.
*/
@@ -128,7 +128,7 @@
* start of the respective timer.
*/
private final Map<String, Long> namedTimerEntries = new HashMap<String,
Long>();
-
+
private boolean done;
/**
@@ -144,7 +144,7 @@
*/
public void reset() {
done = false;
-
+
// remove all entries
entries.clear();
namedTimerEntries.clear();
@@ -203,28 +203,18 @@
}
/**
- * Creates an entry with the given time, entry tag and message. This is a
- * private method, as for users of this API time stamps are managed by this
- * class. For internal uses the timestamp may be generated outside of this
- * method.
- */
- private void log(long timeStamp, String message) {
- entries.add(new TrackingEntry(timeStamp, message));
- }
-
- /**
* Starts a named timer. If a timer of the same name already exists, it is
* reset to the current time.
*/
public void startTimer(String name) {
startTimerInternal(name);
}
-
+
/**
* Start the named timer and returns the start time in milliseconds.
* Logs a message with format
* <pre>
- * TIMER_START{<name>} <optional message>
+ * TIMER_START{<name>} <optional message>
* </pre>
*/
private long startTimerInternal(String name) {
@@ -251,7 +241,7 @@
logTimerInternal(name, MessageFormat.format(format, args),
namedTimerEntries.get(name));
}
}
-
+
/**
* Log a timer entry, including start, end and elapsed time using
TIMER_END_FORMAT
*/
@@ -268,7 +258,7 @@
}
entries.add(new TrackingEntry(sb.toString()));
}
-
+
public void done() {
if(done) return;
logTimer(REQUEST_PROCESSING_TIMER, REQUEST_PROCESSING_TIMER);