struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From musa...@apache.org
Subject svn commit: r804373 [12/19] - in /struts/sandbox/trunk/struts2-jsp-plugin: ./ src/main/java/org/apache/struts2/ src/main/java/org/apache/struts2/jasper/ src/main/java/org/apache/struts2/jasper/compiler/ src/main/java/org/apache/struts2/jasper/compiler/...
Date Fri, 14 Aug 2009 21:02:36 GMT
Modified: struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/runtime/JspWriterImpl.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/runtime/JspWriterImpl.java?rev=804373&r1=804372&r2=804373&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/runtime/JspWriterImpl.java (original)
+++ struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/runtime/JspWriterImpl.java Fri Aug 14 21:02:33 2009
@@ -31,50 +31,49 @@
 /**
  * Write text to a character-output stream, buffering characters so as
  * to provide for the efficient writing of single characters, arrays,
- * and strings. 
- *
- * Provide support for discarding for the output that has been 
- * buffered. 
- * 
+ * and strings.
+ * <p/>
+ * Provide support for discarding for the output that has been
+ * buffered.
+ * <p/>
  * This needs revisiting when the buffering problems in the JSP spec
- * are fixed -akv 
+ * are fixed -akv
  *
  * @author Anil K. Vijendran
  */
 public class JspWriterImpl extends JspWriter {
-    
+
     private Writer out;
-    private ServletResponse response;    
+    private ServletResponse response;
     private char cb[];
     private int nextChar;
     private boolean flushed = false;
     private boolean closed = false;
-    
+
     public JspWriterImpl() {
-        super( Constants.DEFAULT_BUFFER_SIZE, true );
+        super(Constants.DEFAULT_BUFFER_SIZE, true);
     }
-    
+
     /**
      * Create a buffered character-output stream that uses a default-sized
      * output buffer.
      *
-     * @param  response  A Servlet Response
+     * @param response A Servlet Response
      */
     public JspWriterImpl(ServletResponse response) {
         this(response, Constants.DEFAULT_BUFFER_SIZE, true);
     }
-    
+
     /**
      * Create a new buffered character-output stream that uses an output
      * buffer of the given size.
      *
-     * @param  response A Servlet Response
-     * @param  sz   	Output-buffer size, a positive integer
-     *
-     * @exception  IllegalArgumentException  If sz is <= 0
+     * @param response A Servlet Response
+     * @param sz       Output-buffer size, a positive integer
+     * @throws IllegalArgumentException If sz is <= 0
      */
-    public JspWriterImpl(ServletResponse response, int sz, 
-            boolean autoFlush) {
+    public JspWriterImpl(ServletResponse response, int sz,
+                         boolean autoFlush) {
         super(sz, autoFlush);
         if (sz < 0)
             throw new IllegalArgumentException("Buffer size <= 0");
@@ -82,17 +81,18 @@
         cb = sz == 0 ? null : new char[sz];
         nextChar = 0;
     }
-    
-    void init( ServletResponse response, int sz, boolean autoFlush ) {
-        this.response= response;
-        if( sz > 0 && ( cb == null || sz > cb.length ) )
-            cb=new char[sz];
+
+    void init(ServletResponse response, int sz, boolean autoFlush) {
+        this.response = response;
+        if (sz > 0 && (cb == null || sz > cb.length))
+            cb = new char[sz];
         nextChar = 0;
-        this.autoFlush=autoFlush;
-        this.bufferSize=sz;
+        this.autoFlush = autoFlush;
+        this.bufferSize = sz;
     }
-    
-    /** Package-level access
+
+    /**
+     * Package-level access
      */
     void recycle() {
         flushed = false;
@@ -101,7 +101,7 @@
         nextChar = 0;
         response = null;
     }
-    
+
     /**
      * Flush the output buffer to the underlying character stream, without
      * flushing the stream itself.  This method is non-private only so that it
@@ -118,25 +118,25 @@
         out.write(cb, 0, nextChar);
         nextChar = 0;
     }
-    
+
     private void initOut() throws IOException {
         if (out == null) {
             out = response.getWriter();
         }
     }
-    
-    private String getLocalizeMessage(final String message){
-        if (SecurityUtil.isPackageProtectionEnabled()){
-            return (String)AccessController.doPrivileged(new PrivilegedAction(){
-                public Object run(){
-                    return Localizer.getMessage(message); 
+
+    private String getLocalizeMessage(final String message) {
+        if (SecurityUtil.isPackageProtectionEnabled()) {
+            return (String) AccessController.doPrivileged(new PrivilegedAction() {
+                public Object run() {
+                    return Localizer.getMessage(message);
                 }
             });
         } else {
             return Localizer.getMessage(message);
         }
     }
-    
+
     /**
      * Discard the output buffer.
      */
@@ -151,7 +151,7 @@
         ensureOpen();
         nextChar = 0;
     }
-    
+
     public void clearBuffer() throws IOException {
         if (bufferSize == 0)
             throw new IllegalStateException(
@@ -159,25 +159,23 @@
         ensureOpen();
         nextChar = 0;
     }
-    
+
     private final void bufferOverflow() throws IOException {
         throw new IOException(getLocalizeMessage("jsp.error.overflow"));
     }
-    
+
     /**
      * Flush the stream.
-     *
      */
-    public void flush()  throws IOException {
+    public void flush() throws IOException {
         flushBuffer();
         if (out != null) {
             out.flush();
         }
     }
-    
+
     /**
      * Close the stream.
-     *
      */
     public void close() throws IOException {
         if (response == null || closed)
@@ -189,21 +187,23 @@
         out = null;
         closed = true;
     }
-    
+
     /**
      * @return the number of bytes unused in the buffer
      */
     public int getRemaining() {
         return bufferSize - nextChar;
     }
-    
-    /** check to make sure that the stream has not been closed */
+
+    /**
+     * check to make sure that the stream has not been closed
+     */
     private void ensureOpen() throws IOException {
         if (response == null || closed)
             throw new IOException("Stream closed");
     }
-    
-    
+
+
     /**
      * Write a single character.
      */
@@ -212,8 +212,7 @@
         if (bufferSize == 0) {
             initOut();
             out.write(c);
-        }
-        else {
+        } else {
             if (nextChar >= bufferSize)
                 if (autoFlush)
                     flushBuffer();
@@ -222,7 +221,7 @@
             cb[nextChar++] = (char) c;
         }
     }
-    
+
     /**
      * Our own little min method, to avoid loading java.lang.Math if we've run
      * out of file descriptors and we're trying to print a stack trace.
@@ -231,10 +230,10 @@
         if (a < b) return a;
         return b;
     }
-    
+
     /**
      * Write a portion of an array of characters.
-     *
+     * <p/>
      * <p> Ordinarily this method stores characters from the given array into
      * this stream's buffer, flushing the buffer to the underlying stream as
      * needed.  If the requested length is at least as large as the buffer,
@@ -242,28 +241,27 @@
      * directly to the underlying stream.  Thus redundant
      * <code>DiscardableBufferedWriter</code>s will not copy data unnecessarily.
      *
-     * @param  cbuf  A character array
-     * @param  off   Offset from which to start reading characters
-     * @param  len   Number of characters to write
-     */
-    public void write(char cbuf[], int off, int len) 
-    throws IOException 
-    {
+     * @param cbuf A character array
+     * @param off  Offset from which to start reading characters
+     * @param len  Number of characters to write
+     */
+    public void write(char cbuf[], int off, int len)
+            throws IOException {
         ensureOpen();
-        
+
         if (bufferSize == 0) {
             initOut();
             out.write(cbuf, off, len);
             return;
         }
-        
+
         if ((off < 0) || (off > cbuf.length) || (len < 0) ||
                 ((off + len) > cbuf.length) || ((off + len) < 0)) {
             throw new IndexOutOfBoundsException();
         } else if (len == 0) {
             return;
-        } 
-        
+        }
+
         if (len >= bufferSize) {
             /* If the request length exceeds the size of the output buffer,
              flush the buffer and then write the data directly.  In this
@@ -276,22 +274,22 @@
             out.write(cbuf, off, len);
             return;
         }
-        
+
         int b = off, t = off + len;
         while (b < t) {
             int d = min(bufferSize - nextChar, t - b);
             System.arraycopy(cbuf, b, cb, nextChar, d);
             b += d;
             nextChar += d;
-            if (nextChar >= bufferSize) 
+            if (nextChar >= bufferSize)
                 if (autoFlush)
                     flushBuffer();
                 else
                     bufferOverflow();
         }
-        
+
     }
-    
+
     /**
      * Write an array of characters.  This method cannot be inherited from the
      * Writer class because it must suppress I/O exceptions.
@@ -299,13 +297,13 @@
     public void write(char buf[]) throws IOException {
         write(buf, 0, buf.length);
     }
-    
+
     /**
      * Write a portion of a String.
      *
-     * @param  s     String to be written
-     * @param  off   Offset from which to start reading characters
-     * @param  len   Number of characters to be written
+     * @param s   String to be written
+     * @param off Offset from which to start reading characters
+     * @param len Number of characters to be written
      */
     public void write(String s, int off, int len) throws IOException {
         ensureOpen();
@@ -320,14 +318,14 @@
             s.getChars(b, b + d, cb, nextChar);
             b += d;
             nextChar += d;
-            if (nextChar >= bufferSize) 
+            if (nextChar >= bufferSize)
                 if (autoFlush)
                     flushBuffer();
                 else
                     bufferOverflow();
         }
     }
-    
+
     /**
      * Write a string.  This method cannot be inherited from the Writer class
      * because it must suppress I/O exceptions.
@@ -335,31 +333,31 @@
     public void write(String s) throws IOException {
         // Simple fix for Bugzilla 35410
         // Calling the other write function so as to init the buffer anyways
-        if(s == null) {
+        if (s == null) {
             write(s, 0, 0);
         } else {
             write(s, 0, s.length());
         }
     }
-    
-    
+
+
     static String lineSeparator = System.getProperty("line.separator");
-    
+
     /**
      * Write a line separator.  The line separator string is defined by the
      * system property <tt>line.separator</tt>, and is not necessarily a single
      * newline ('\n') character.
      *
-     * @exception  IOException  If an I/O error occurs
+     * @throws IOException If an I/O error occurs
      */
-    
+
     public void newLine() throws IOException {
         write(lineSeparator);
     }
-    
-    
+
+
     /* Methods that do not terminate lines */
-    
+
     /**
      * Print a boolean value.  The string produced by <code>{@link
      * java.lang.String#valueOf(boolean)}</code> is translated into bytes
@@ -367,24 +365,24 @@
      * are written in exactly the manner of the <code>{@link
      * #write(int)}</code> method.
      *
-     * @param      b   The <code>boolean</code> to be printed
+     * @param b The <code>boolean</code> to be printed
      */
     public void print(boolean b) throws IOException {
         write(b ? "true" : "false");
     }
-    
+
     /**
      * Print a character.  The character is translated into one or more bytes
      * according to the platform's default character encoding, and these bytes
      * are written in exactly the manner of the <code>{@link
      * #write(int)}</code> method.
      *
-     * @param      c   The <code>char</code> to be printed
+     * @param c The <code>char</code> to be printed
      */
     public void print(char c) throws IOException {
         write(String.valueOf(c));
     }
-    
+
     /**
      * Print an integer.  The string produced by <code>{@link
      * java.lang.String#valueOf(int)}</code> is translated into bytes according
@@ -392,12 +390,12 @@
      * written in exactly the manner of the <code>{@link #write(int)}</code>
      * method.
      *
-     * @param      i   The <code>int</code> to be printed
+     * @param i The <code>int</code> to be printed
      */
     public void print(int i) throws IOException {
         write(String.valueOf(i));
     }
-    
+
     /**
      * Print a long integer.  The string produced by <code>{@link
      * java.lang.String#valueOf(long)}</code> is translated into bytes
@@ -405,12 +403,12 @@
      * are written in exactly the manner of the <code>{@link #write(int)}</code>
      * method.
      *
-     * @param      l   The <code>long</code> to be printed
+     * @param l The <code>long</code> to be printed
      */
     public void print(long l) throws IOException {
         write(String.valueOf(l));
     }
-    
+
     /**
      * Print a floating-point number.  The string produced by <code>{@link
      * java.lang.String#valueOf(float)}</code> is translated into bytes
@@ -418,12 +416,12 @@
      * are written in exactly the manner of the <code>{@link #write(int)}</code>
      * method.
      *
-     * @param      f   The <code>float</code> to be printed
+     * @param f The <code>float</code> to be printed
      */
     public void print(float f) throws IOException {
         write(String.valueOf(f));
     }
-    
+
     /**
      * Print a double-precision floating-point number.  The string produced by
      * <code>{@link java.lang.String#valueOf(double)}</code> is translated into
@@ -431,26 +429,25 @@
      * bytes are written in exactly the manner of the <code>{@link
      * #write(int)}</code> method.
      *
-     * @param      d   The <code>double</code> to be printed
+     * @param d The <code>double</code> to be printed
      */
     public void print(double d) throws IOException {
         write(String.valueOf(d));
     }
-    
+
     /**
      * Print an array of characters.  The characters are converted into bytes
      * according to the platform's default character encoding, and these bytes
      * are written in exactly the manner of the <code>{@link #write(int)}</code>
      * method.
      *
-     * @param      s   The array of chars to be printed
-     *
-     * @throws  NullPointerException  If <code>s</code> is <code>null</code>
+     * @param s The array of chars to be printed
+     * @throws NullPointerException If <code>s</code> is <code>null</code>
      */
     public void print(char s[]) throws IOException {
         write(s);
     }
-    
+
     /**
      * Print a string.  If the argument is <code>null</code> then the string
      * <code>"null"</code> is printed.  Otherwise, the string's characters are
@@ -458,7 +455,7 @@
      * encoding, and these bytes are written in exactly the manner of the
      * <code>{@link #write(int)}</code> method.
      *
-     * @param      s   The <code>String</code> to be printed
+     * @param s The <code>String</code> to be printed
      */
     public void print(String s) throws IOException {
         if (s == null) {
@@ -466,7 +463,7 @@
         }
         write(s);
     }
-    
+
     /**
      * Print an object.  The string produced by the <code>{@link
      * java.lang.String#valueOf(Object)}</code> method is translated into bytes
@@ -474,28 +471,28 @@
      * are written in exactly the manner of the <code>{@link #write(int)}</code>
      * method.
      *
-     * @param      obj   The <code>Object</code> to be printed
+     * @param obj The <code>Object</code> to be printed
      */
     public void print(Object obj) throws IOException {
         write(String.valueOf(obj));
     }
-    
+
     /* Methods that do terminate lines */
-    
+
     /**
      * Terminate the current line by writing the line separator string.  The
      * line separator string is defined by the system property
      * <code>line.separator</code>, and is not necessarily a single newline
      * character (<code>'\n'</code>).
-     *
+     * <p/>
      * Need to change this from PrintWriter because the default
      * println() writes  to the sink directly instead of through the
-     * write method...  
+     * write method...
      */
     public void println() throws IOException {
         newLine();
     }
-    
+
     /**
      * Print a boolean value and then terminate the line.  This method behaves
      * as though it invokes <code>{@link #print(boolean)}</code> and then
@@ -505,7 +502,7 @@
         print(x);
         println();
     }
-    
+
     /**
      * Print a character and then terminate the line.  This method behaves as
      * though it invokes <code>{@link #print(char)}</code> and then <code>{@link
@@ -515,7 +512,7 @@
         print(x);
         println();
     }
-    
+
     /**
      * Print an integer and then terminate the line.  This method behaves as
      * though it invokes <code>{@link #print(int)}</code> and then <code>{@link
@@ -525,7 +522,7 @@
         print(x);
         println();
     }
-    
+
     /**
      * Print a long integer and then terminate the line.  This method behaves
      * as though it invokes <code>{@link #print(long)}</code> and then
@@ -535,7 +532,7 @@
         print(x);
         println();
     }
-    
+
     /**
      * Print a floating-point number and then terminate the line.  This method
      * behaves as though it invokes <code>{@link #print(float)}</code> and then
@@ -545,7 +542,7 @@
         print(x);
         println();
     }
-    
+
     /**
      * Print a double-precision floating-point number and then terminate the
      * line.  This method behaves as though it invokes <code>{@link
@@ -555,7 +552,7 @@
         print(x);
         println();
     }
-    
+
     /**
      * Print an array of characters and then terminate the line.  This method
      * behaves as though it invokes <code>{@link #print(char[])}</code> and then
@@ -565,7 +562,7 @@
         print(x);
         println();
     }
-    
+
     /**
      * Print a String and then terminate the line.  This method behaves as
      * though it invokes <code>{@link #print(String)}</code> and then
@@ -575,7 +572,7 @@
         print(x);
         println();
     }
-    
+
     /**
      * Print an Object and then terminate the line.  This method behaves as
      * though it invokes <code>{@link #print(Object)}</code> and then
@@ -585,5 +582,5 @@
         print(x);
         println();
     }
-    
+
 }

Modified: struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/runtime/PageContextImpl.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/runtime/PageContextImpl.java?rev=804373&r1=804372&r2=804373&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/runtime/PageContextImpl.java (original)
+++ struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/runtime/PageContextImpl.java Fri Aug 14 21:02:33 2009
@@ -59,7 +59,7 @@
 
     // The expression evaluator, for evaluating EL expressions.
     private static ExpressionEvaluatorImpl elExprEval
-        = new ExpressionEvaluatorImpl(false);
+            = new ExpressionEvaluatorImpl(false);
 
     // The variable resolver, for evaluating EL expressions.
     private VariableResolverImpl variableResolver;
@@ -74,7 +74,7 @@
     private String errorPageURL;
 
     // page-scope attributes
-    private transient Hashtable        attributes;
+    private transient Hashtable attributes;
 
     // per-request state
     private transient ServletRequest request;
@@ -105,7 +105,7 @@
                            boolean autoFlush) throws IOException {
 
         _initialize(servlet, request, response, errorPageURL, needsSession,
-                    bufferSize, autoFlush);
+                bufferSize, autoFlush);
     }
 
     private void _initialize(Servlet servlet,
@@ -127,10 +127,10 @@
 
         // Setup session (if required)
         if (request instanceof HttpServletRequest && needsSession)
-            this.session = ((HttpServletRequest)request).getSession();
+            this.session = ((HttpServletRequest) request).getSession();
         if (needsSession && session == null)
             throw new IllegalStateException
-                ("Page needs a session and none is available");
+                    ("Page needs a session and none is available");
 
         // initialize the initial out ...
         depth = -1;
@@ -155,14 +155,14 @@
         setAttribute(APPLICATION, context);
 
         isIncluded = request.getAttribute(
-            "javax.servlet.include.servlet_path") != null;
+                "javax.servlet.include.servlet_path") != null;
     }
 
     public void release() {
         out = baseOut;
         try {
             if (isIncluded) {
-                ((JspWriterImpl)out).flushBuffer();
+                ((JspWriterImpl) out).flushBuffer();
                 // push it into the including jspWriter
             } else {
                 // Old code:
@@ -170,11 +170,11 @@
                 // Do not flush the buffer even if we're not included (i.e.
                 // we are the main page. The servlet will flush it and close
                 // the stream.
-                ((JspWriterImpl)out).flushBuffer();
+                ((JspWriterImpl) out).flushBuffer();
             }
         } catch (IOException ex) {
             context.log(
-                "PageContextImpl.release(): Internal error flushing buffer");
+                    "PageContextImpl.release(): Internal error flushing buffer");
         }
 
         servlet = null;
@@ -197,9 +197,9 @@
                     Localizer.getMessage("jsp.error.attribute.null_name"));
         }
 
-        if (SecurityUtil.isPackageProtectionEnabled()){
-            return AccessController.doPrivileged(new PrivilegedAction(){
-                public Object run(){
+        if (SecurityUtil.isPackageProtectionEnabled()) {
+            return AccessController.doPrivileged(new PrivilegedAction() {
+                public Object run() {
                     return doGetAttribute(name);
                 }
             });
@@ -209,7 +209,7 @@
 
     }
 
-    private Object doGetAttribute(String name){
+    private Object doGetAttribute(String name) {
         return attributes.get(name);
     }
 
@@ -220,9 +220,9 @@
                     Localizer.getMessage("jsp.error.attribute.null_name"));
         }
 
-        if (SecurityUtil.isPackageProtectionEnabled()){
-            return AccessController.doPrivileged(new PrivilegedAction(){
-                public Object run(){
+        if (SecurityUtil.isPackageProtectionEnabled()) {
+            return AccessController.doPrivileged(new PrivilegedAction() {
+                public Object run() {
                     return doGetAttribute(name, scope);
                 }
             });
@@ -232,26 +232,26 @@
 
     }
 
-    private Object doGetAttribute(String name, int scope){
+    private Object doGetAttribute(String name, int scope) {
         switch (scope) {
             case PAGE_SCOPE:
-            return attributes.get(name);
+                return attributes.get(name);
 
             case REQUEST_SCOPE:
-            return request.getAttribute(name);
+                return request.getAttribute(name);
 
             case SESSION_SCOPE:
-            if (session == null) {
-                throw new IllegalStateException(
-                        Localizer.getMessage("jsp.error.page.noSession"));
-            }
-            return session.getAttribute(name);
+                if (session == null) {
+                    throw new IllegalStateException(
+                            Localizer.getMessage("jsp.error.page.noSession"));
+                }
+                return session.getAttribute(name);
 
             case APPLICATION_SCOPE:
-            return context.getAttribute(name);
+                return context.getAttribute(name);
 
             default:
-            throw new IllegalArgumentException("Invalid scope");
+                throw new IllegalArgumentException("Invalid scope");
         }
     }
 
@@ -262,9 +262,9 @@
                     Localizer.getMessage("jsp.error.attribute.null_name"));
         }
 
-        if (SecurityUtil.isPackageProtectionEnabled()){
-            AccessController.doPrivileged(new PrivilegedAction(){
-                public Object run(){
+        if (SecurityUtil.isPackageProtectionEnabled()) {
+            AccessController.doPrivileged(new PrivilegedAction() {
+                public Object run() {
                     doSetAttribute(name, attribute);
                     return null;
                 }
@@ -274,7 +274,7 @@
         }
     }
 
-    private void doSetAttribute(String name, Object attribute){
+    private void doSetAttribute(String name, Object attribute) {
         if (attribute != null) {
             attributes.put(name, attribute);
         } else {
@@ -289,9 +289,9 @@
                     Localizer.getMessage("jsp.error.attribute.null_name"));
         }
 
-        if (SecurityUtil.isPackageProtectionEnabled()){
-            AccessController.doPrivileged(new PrivilegedAction(){
-                public Object run(){
+        if (SecurityUtil.isPackageProtectionEnabled()) {
+            AccessController.doPrivileged(new PrivilegedAction() {
+                public Object run() {
                     doSetAttribute(name, o, scope);
                     return null;
                 }
@@ -302,31 +302,31 @@
 
     }
 
-    private void doSetAttribute(String name, Object o, int scope ){
+    private void doSetAttribute(String name, Object o, int scope) {
         if (o != null) {
             switch (scope) {
-            case PAGE_SCOPE:
-            attributes.put(name, o);
-            break;
-
-            case REQUEST_SCOPE:
-            request.setAttribute(name, o);
-            break;
-
-            case SESSION_SCOPE:
-            if (session == null) {
-                throw new IllegalStateException(
-                        Localizer.getMessage("jsp.error.page.noSession"));
-            }
-            session.setAttribute(name, o);
-            break;
+                case PAGE_SCOPE:
+                    attributes.put(name, o);
+                    break;
+
+                case REQUEST_SCOPE:
+                    request.setAttribute(name, o);
+                    break;
+
+                case SESSION_SCOPE:
+                    if (session == null) {
+                        throw new IllegalStateException(
+                                Localizer.getMessage("jsp.error.page.noSession"));
+                    }
+                    session.setAttribute(name, o);
+                    break;
 
-            case APPLICATION_SCOPE:
-            context.setAttribute(name, o);
-            break;
+                case APPLICATION_SCOPE:
+                    context.setAttribute(name, o);
+                    break;
 
-            default:
-            throw new IllegalArgumentException("Invalid scope");
+                default:
+                    throw new IllegalArgumentException("Invalid scope");
             }
         } else {
             removeAttribute(name, scope);
@@ -339,9 +339,9 @@
             throw new NullPointerException(
                     Localizer.getMessage("jsp.error.attribute.null_name"));
         }
-        if (SecurityUtil.isPackageProtectionEnabled()){
-            AccessController.doPrivileged(new PrivilegedAction(){
-                public Object run(){
+        if (SecurityUtil.isPackageProtectionEnabled()) {
+            AccessController.doPrivileged(new PrivilegedAction() {
+                public Object run() {
                     doRemoveAttribute(name, scope);
                     return null;
                 }
@@ -351,30 +351,30 @@
         }
     }
 
-    private void doRemoveAttribute(String name, int scope){
+    private void doRemoveAttribute(String name, int scope) {
         switch (scope) {
-        case PAGE_SCOPE:
-            attributes.remove(name);
-            break;
-
-        case REQUEST_SCOPE:
-            request.removeAttribute(name);
-            break;
-
-        case SESSION_SCOPE:
-            if (session == null) {
-            throw new IllegalStateException(
-                        Localizer.getMessage("jsp.error.page.noSession"));
-            }
-            session.removeAttribute(name);
-            break;
-
-        case APPLICATION_SCOPE:
-            context.removeAttribute(name);
-            break;
-            
-        default:
-            throw new IllegalArgumentException("Invalid scope");
+            case PAGE_SCOPE:
+                attributes.remove(name);
+                break;
+
+            case REQUEST_SCOPE:
+                request.removeAttribute(name);
+                break;
+
+            case SESSION_SCOPE:
+                if (session == null) {
+                    throw new IllegalStateException(
+                            Localizer.getMessage("jsp.error.page.noSession"));
+                }
+                session.removeAttribute(name);
+                break;
+
+            case APPLICATION_SCOPE:
+                context.removeAttribute(name);
+                break;
+
+            default:
+                throw new IllegalArgumentException("Invalid scope");
         }
     }
 
@@ -385,9 +385,9 @@
                     Localizer.getMessage("jsp.error.attribute.null_name"));
         }
 
-        if (SecurityUtil.isPackageProtectionEnabled()){
-            return ((Integer)AccessController.doPrivileged(new PrivilegedAction(){
-                public Object run(){
+        if (SecurityUtil.isPackageProtectionEnabled()) {
+            return ((Integer) AccessController.doPrivileged(new PrivilegedAction() {
+                public Object run() {
                     return new Integer(doGetAttributeScope(name));
                 }
             })).intValue();
@@ -396,7 +396,7 @@
         }
     }
 
-    private int doGetAttributeScope(String name){
+    private int doGetAttributeScope(String name) {
         if (attributes.get(name) != null)
             return PAGE_SCOPE;
 
@@ -407,7 +407,7 @@
             try {
                 if (session.getAttribute(name) != null)
                     return SESSION_SCOPE;
-            } catch(IllegalStateException ise) {
+            } catch (IllegalStateException ise) {
                 // Session has been invalidated.
                 // Ignore and fall through to application scope.
             }
@@ -420,9 +420,9 @@
     }
 
     public Object findAttribute(final String name) {
-        if (SecurityUtil.isPackageProtectionEnabled()){
-            return AccessController.doPrivileged(new PrivilegedAction(){
-                public Object run(){
+        if (SecurityUtil.isPackageProtectionEnabled()) {
+            return AccessController.doPrivileged(new PrivilegedAction() {
+                public Object run() {
                     if (name == null) {
                         throw new NullPointerException(
                                 Localizer.getMessage("jsp.error.attribute.null_name"));
@@ -441,7 +441,7 @@
         }
     }
 
-    private Object doFindAttribute(String name){
+    private Object doFindAttribute(String name) {
 
         Object o = attributes.get(name);
         if (o != null)
@@ -454,7 +454,7 @@
         if (session != null) {
             try {
                 o = session.getAttribute(name);
-            } catch(IllegalStateException ise) {
+            } catch (IllegalStateException ise) {
                 // Session has been invalidated.
                 // Ignore and fall through to application scope.
             }
@@ -467,38 +467,38 @@
 
 
     public Enumeration getAttributeNamesInScope(final int scope) {
-        if (SecurityUtil.isPackageProtectionEnabled()){
+        if (SecurityUtil.isPackageProtectionEnabled()) {
             return (Enumeration)
-                    AccessController.doPrivileged(new PrivilegedAction(){
-                public Object run(){
-                    return doGetAttributeNamesInScope(scope);
-                }
-            });
+                    AccessController.doPrivileged(new PrivilegedAction() {
+                        public Object run() {
+                            return doGetAttributeNamesInScope(scope);
+                        }
+                    });
         } else {
             return doGetAttributeNamesInScope(scope);
         }
     }
 
-    private Enumeration doGetAttributeNamesInScope(int scope){
+    private Enumeration doGetAttributeNamesInScope(int scope) {
         switch (scope) {
-        case PAGE_SCOPE:
-            return attributes.keys();
-            
-        case REQUEST_SCOPE:
-            return request.getAttributeNames();
-
-        case SESSION_SCOPE:
-            if (session == null) {
-            throw new IllegalStateException(
-                        Localizer.getMessage("jsp.error.page.noSession"));
-            }
-            return session.getAttributeNames();
+            case PAGE_SCOPE:
+                return attributes.keys();
+
+            case REQUEST_SCOPE:
+                return request.getAttributeNames();
 
-        case APPLICATION_SCOPE:
-            return context.getAttributeNames();
+            case SESSION_SCOPE:
+                if (session == null) {
+                    throw new IllegalStateException(
+                            Localizer.getMessage("jsp.error.page.noSession"));
+                }
+                return session.getAttributeNames();
 
-        default:
-            throw new IllegalArgumentException("Invalid scope");
+            case APPLICATION_SCOPE:
+                return context.getAttributeNames();
+
+            default:
+                throw new IllegalArgumentException("Invalid scope");
         }
     }
 
@@ -509,9 +509,9 @@
                     Localizer.getMessage("jsp.error.attribute.null_name"));
         }
 
-        if (SecurityUtil.isPackageProtectionEnabled()){
-            AccessController.doPrivileged(new PrivilegedAction(){
-                public Object run(){
+        if (SecurityUtil.isPackageProtectionEnabled()) {
+            AccessController.doPrivileged(new PrivilegedAction() {
+                public Object run() {
                     doRemoveAttribute(name);
                     return null;
                 }
@@ -519,16 +519,16 @@
         } else {
             doRemoveAttribute(name);
         }
-        }
+    }
 
 
-    private void doRemoveAttribute(String name){
+    private void doRemoveAttribute(String name) {
         removeAttribute(name, PAGE_SCOPE);
         removeAttribute(name, REQUEST_SCOPE);
-        if( session != null ) {
+        if (session != null) {
             try {
                 removeAttribute(name, SESSION_SCOPE);
-            } catch(IllegalStateException ise) {
+            } catch (IllegalStateException ise) {
                 // Session has been invalidated.
                 // Ignore and fall throw to application scope.
             }
@@ -540,14 +540,29 @@
         return out;
     }
 
-    public HttpSession getSession() { return session; }
-    public Servlet getServlet() { return servlet; }
-    public ServletConfig getServletConfig() { return config; }
+    public HttpSession getSession() {
+        return session;
+    }
+
+    public Servlet getServlet() {
+        return servlet;
+    }
+
+    public ServletConfig getServletConfig() {
+        return config;
+    }
+
     public ServletContext getServletContext() {
         return config.getServletContext();
     }
-    public ServletRequest getRequest() { return request; }
-    public ServletResponse getResponse() { return response; }
+
+    public ServletRequest getRequest() {
+        return request;
+    }
+
+    public ServletResponse getResponse() {
+        return response;
+    }
 
 
     /**
@@ -563,7 +578,7 @@
         Throwable t = JspRuntimeLibrary.getThrowable(request);
 
         // Only wrap if needed
-        if((t != null) && (! (t instanceof Exception))) {
+        if ((t != null) && (!(t instanceof Exception))) {
             t = new JspException(t);
         }
 
@@ -571,7 +586,9 @@
     }
 
 
-    public Object getPage() { return servlet; }
+    public Object getPage() {
+        return servlet;
+    }
 
 
     private final String getAbsolutePathRelativeToContext(String relativeUrlPath) {
@@ -579,38 +596,38 @@
 
         if (!path.startsWith("/")) {
             String uri = (String)
-                request.getAttribute("javax.servlet.include.servlet_path");
+                    request.getAttribute("javax.servlet.include.servlet_path");
             if (uri == null)
                 uri = ((HttpServletRequest) request).getServletPath();
             String baseURI = uri.substring(0, uri.lastIndexOf('/'));
-            path = baseURI+'/'+path;
+            path = baseURI + '/' + path;
         }
 
         return path;
     }
 
     public void include(String relativeUrlPath)
-                throws ServletException, IOException {
+            throws ServletException, IOException {
         JspRuntimeLibrary.include(request, response, relativeUrlPath, out,
-                                  true);
+                true);
     }
 
     public void include(final String relativeUrlPath, final boolean flush)
-                throws ServletException, IOException {
-        if (SecurityUtil.isPackageProtectionEnabled()){
-            try{
-                AccessController.doPrivileged(new PrivilegedExceptionAction(){
-                    public Object run() throws Exception{
+            throws ServletException, IOException {
+        if (SecurityUtil.isPackageProtectionEnabled()) {
+            try {
+                AccessController.doPrivileged(new PrivilegedExceptionAction() {
+                    public Object run() throws Exception {
                         doInclude(relativeUrlPath, flush);
                         return null;
                     }
                 });
-            } catch (PrivilegedActionException e){
-                Exception ex =  e.getException();
-                if (ex instanceof IOException){
-                    throw (IOException)ex;
+            } catch (PrivilegedActionException e) {
+                Exception ex = e.getException();
+                if (ex instanceof IOException) {
+                    throw (IOException) ex;
                 } else {
-                    throw (ServletException)ex;
+                    throw (ServletException) ex;
                 }
             }
         } else {
@@ -619,9 +636,9 @@
     }
 
     private void doInclude(String relativeUrlPath, boolean flush)
-                throws ServletException, IOException {
+            throws ServletException, IOException {
         JspRuntimeLibrary.include(request, response, relativeUrlPath, out,
-                                  flush);
+                flush);
     }
 
     public VariableResolver getVariableResolver() {
@@ -629,21 +646,21 @@
     }
 
     public void forward(final String relativeUrlPath)
-        throws ServletException, IOException {
-        if (SecurityUtil.isPackageProtectionEnabled()){
-            try{
-                AccessController.doPrivileged(new PrivilegedExceptionAction(){
-                    public Object run() throws Exception{
+            throws ServletException, IOException {
+        if (SecurityUtil.isPackageProtectionEnabled()) {
+            try {
+                AccessController.doPrivileged(new PrivilegedExceptionAction() {
+                    public Object run() throws Exception {
                         doForward(relativeUrlPath);
                         return null;
                     }
                 });
-            } catch (PrivilegedActionException e){
-                Exception ex =  e.getException();
-                if (ex instanceof IOException){
-                    throw (IOException)ex;
+            } catch (PrivilegedActionException e) {
+                Exception ex = e.getException();
+                if (ex instanceof IOException) {
+                    throw (IOException) ex;
                 } else {
-                    throw (ServletException)ex;
+                    throw (ServletException) ex;
                 }
             }
         } else {
@@ -652,14 +669,14 @@
     }
 
     private void doForward(String relativeUrlPath)
-        throws ServletException, IOException{
+            throws ServletException, IOException {
 
         // JSP.4.5 If the buffer was flushed, throw IllegalStateException
         try {
             out.clear();
         } catch (IOException ex) {
             IllegalStateException ise =
-                new IllegalStateException(Localizer.getMessage(
+                    new IllegalStateException(Localizer.getMessage(
                             "jsp.error.attempt_to_clear_flushed_buffer"));
             ise.initCause(ex);
             throw ise;
@@ -667,13 +684,13 @@
 
         // Make sure that the response object is not the wrapper for include
         while (response instanceof ServletResponseWrapperInclude) {
-            response = ((ServletResponseWrapperInclude)response).getResponse();
+            response = ((ServletResponseWrapperInclude) response).getResponse();
         }
 
         final String path = getAbsolutePathRelativeToContext(relativeUrlPath);
         String includeUri
-            = (String) request.getAttribute(Constants.INC_SERVLET_PATH);
-            
+                = (String) request.getAttribute(Constants.INC_SERVLET_PATH);
+
         if (includeUri != null)
             request.removeAttribute(Constants.INC_SERVLET_PATH);
         try {
@@ -693,7 +710,7 @@
         depth++;
         if (depth >= outs.length) {
             BodyContentImpl[] newOuts = new BodyContentImpl[depth + 1];
-            for (int i=0; i<outs.length; i++) {
+            for (int i = 0; i < outs.length; i++) {
                 newOuts[i] = outs[i];
             }
             newOuts[depth] = new BodyContentImpl(out);
@@ -735,33 +752,31 @@
     }
 
     public void handlePageException(Exception ex)
-        throws IOException, ServletException
-    {
+            throws IOException, ServletException {
         // Should never be called since handleException() called with a
         // Throwable in the generated servlet.
         handlePageException((Throwable) ex);
     }
 
     public void handlePageException(final Throwable t)
-        throws IOException, ServletException
-    {
+            throws IOException, ServletException {
         if (t == null)
             throw new NullPointerException("null Throwable");
 
-        if (SecurityUtil.isPackageProtectionEnabled()){
-            try{
-                AccessController.doPrivileged(new PrivilegedExceptionAction(){
-                    public Object run() throws Exception{
+        if (SecurityUtil.isPackageProtectionEnabled()) {
+            try {
+                AccessController.doPrivileged(new PrivilegedExceptionAction() {
+                    public Object run() throws Exception {
                         doHandlePageException(t);
                         return null;
                     }
                 });
-            } catch (PrivilegedActionException e){
-                Exception ex =  e.getException();
-                if (ex instanceof IOException){
-                    throw (IOException)ex;
+            } catch (PrivilegedActionException e) {
+                Exception ex = e.getException();
+                if (ex instanceof IOException) {
+                    throw (IOException) ex;
                 } else {
-                    throw (ServletException)ex;
+                    throw (ServletException) ex;
                 }
             }
         } else {
@@ -771,7 +786,7 @@
     }
 
     private void doHandlePageException(Throwable t)
-        throws IOException, ServletException {
+            throws IOException, ServletException {
 
         if (errorPageURL != null && !errorPageURL.equals("")) {
 
@@ -786,11 +801,11 @@
              */
             request.setAttribute("javax.servlet.jsp.jspException", t);
             request.setAttribute("javax.servlet.error.status_code",
-                new Integer(HttpServletResponse.SC_INTERNAL_SERVER_ERROR));
+                    new Integer(HttpServletResponse.SC_INTERNAL_SERVER_ERROR));
             request.setAttribute("javax.servlet.error.request_uri",
-            ((HttpServletRequest) request).getRequestURI());
+                    ((HttpServletRequest) request).getRequestURI());
             request.setAttribute("javax.servlet.error.servlet_name",
-                     config.getServletName());
+                    config.getServletName());
             try {
                 forward(errorPageURL);
             } catch (IllegalStateException ise) {
@@ -802,7 +817,7 @@
             Object newException = request.getAttribute("javax.servlet.error.exception");
 
             // t==null means the attribute was not set.
-            if( (newException!= null) && (newException==t) ) {
+            if ((newException != null) && (newException == t)) {
                 request.removeAttribute("javax.servlet.error.exception");
             }
 
@@ -816,9 +831,9 @@
             // Otherwise throw the exception wrapped inside a ServletException.
             // Set the exception as the root cause in the ServletException
             // to get a stack trace for the real problem
-            if (t instanceof IOException) throw (IOException)t;
-            if (t instanceof ServletException) throw (ServletException)t;
-            if (t instanceof RuntimeException) throw (RuntimeException)t;
+            if (t instanceof IOException) throw (IOException) t;
+            if (t instanceof ServletException) throw (ServletException) t;
+            if (t instanceof RuntimeException) throw (RuntimeException) t;
 
             Throwable rootCause = null;
             if (t instanceof JspException) {
@@ -828,10 +843,10 @@
             }
 
             if (rootCause != null) {
-                throw new ServletException(t.getClass().getName() + ": " + 
-                                           t.getMessage(), rootCause);
+                throw new ServletException(t.getClass().getName() + ": " +
+                        t.getMessage(), rootCause);
             }
-                 
+
             throw new ServletException(t);
         }
     }
@@ -855,7 +870,7 @@
         }
 
         StringBuffer sb = new StringBuffer();
-        for(int i = 0; i < s.length(); i++) {
+        for (int i = 0; i < s.length(); i++) {
             char c = s.charAt(i);
             if (c == '<') {
                 sb.append("&lt;");
@@ -880,32 +895,31 @@
      * out of JSTL and into its own project.  For now, this is necessary
      * because the standard machinery is too slow.
      *
-     * @param expression The expression to be evaluated
+     * @param expression   The expression to be evaluated
      * @param expectedType The expected resulting type
-     * @param pageContext The page context
-     * @param functionMap Maps prefix and name to Method
+     * @param pageContext  The page context
+     * @param functionMap  Maps prefix and name to Method
      * @return The result of the evaluation
      */
-    public static Object proprietaryEvaluate(final String expression, 
+    public static Object proprietaryEvaluate(final String expression,
                                              final Class expectedType,
                                              final PageContext pageContext,
                                              final ProtectedFunctionMapper functionMap,
                                              final boolean escape)
-        throws ELException
-    {
+            throws ELException {
         Object retValue;
-        if (SecurityUtil.isPackageProtectionEnabled()){
+        if (SecurityUtil.isPackageProtectionEnabled()) {
             try {
                 retValue = AccessController.doPrivileged(
-                        new PrivilegedExceptionAction(){
+                        new PrivilegedExceptionAction() {
 
-                    public Object run() throws Exception{
-                        return elExprEval.evaluate(expression,
-                                                   expectedType,
-                                                   pageContext.getVariableResolver(),
-                                                   functionMap);
-                    }
-                });
+                            public Object run() throws Exception {
+                                return elExprEval.evaluate(expression,
+                                        expectedType,
+                                        pageContext.getVariableResolver(),
+                                        functionMap);
+                            }
+                        });
             } catch (PrivilegedActionException ex) {
                 Exception realEx = ex.getException();
                 if (realEx instanceof ELException) {
@@ -916,9 +930,9 @@
             }
         } else {
             retValue = elExprEval.evaluate(expression,
-                                           expectedType,
-                                           pageContext.getVariableResolver(),
-                                           functionMap);
+                    expectedType,
+                    pageContext.getVariableResolver(),
+                    functionMap);
         }
         if (escape) {
             retValue = XmlEscape(retValue.toString());

Modified: struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/runtime/PerThreadTagHandlerPool.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/runtime/PerThreadTagHandlerPool.java?rev=804373&r1=804372&r2=804373&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/runtime/PerThreadTagHandlerPool.java (original)
+++ struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/runtime/PerThreadTagHandlerPool.java Fri Aug 14 21:02:33 2009
@@ -79,22 +79,20 @@
      * instantiating one if this tag handler pool is empty.
      *
      * @param handlerClass Tag handler class
-     *
      * @return Reused or newly instantiated tag handler
-     *
      * @throws JspException if a tag handler cannot be instantiated
      */
     public Tag get(Class handlerClass) throws JspException {
-        PerThreadData ptd = (PerThreadData)perThread.get();
-        if(ptd.current >=0 ) {
+        PerThreadData ptd = (PerThreadData) perThread.get();
+        if (ptd.current >= 0) {
             return ptd.handlers[ptd.current--];
         } else {
-	    try {
-		return (Tag) handlerClass.newInstance();
-	    } catch (Exception e) {
-		throw new JspException(e.getMessage(), e);
-	    }
-	}
+            try {
+                return (Tag) handlerClass.newInstance();
+            } catch (Exception e) {
+                throw new JspException(e.getMessage(), e);
+            }
+        }
     }
 
     /**
@@ -105,9 +103,9 @@
      * @param handler Tag handler to add to this tag handler pool
      */
     public void reuse(Tag handler) {
-        PerThreadData ptd=(PerThreadData)perThread.get();
-	if (ptd.current < (ptd.handlers.length - 1)) {
-	    ptd.handlers[++ptd.current] = handler;
+        PerThreadData ptd = (PerThreadData) perThread.get();
+        if (ptd.current < (ptd.handlers.length - 1)) {
+            ptd.handlers[++ptd.current] = handler;
         } else {
             handler.release();
         }
@@ -116,15 +114,15 @@
     /**
      * Calls the release() method of all tag handlers in this tag handler pool.
      */
-    public void release() {        
+    public void release() {
         Enumeration enumeration = perThreadDataVector.elements();
         while (enumeration.hasMoreElements()) {
-	    PerThreadData ptd = (PerThreadData)enumeration.nextElement();
+            PerThreadData ptd = (PerThreadData) enumeration.nextElement();
             if (ptd.handlers != null) {
-                for (int i=ptd.current; i>=0; i--) {
+                for (int i = ptd.current; i >= 0; i--) {
                     if (ptd.handlers[i] != null) {
                         ptd.handlers[i].release();
-		    }
+                    }
                 }
             }
         }

Modified: struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/runtime/ProtectedFunctionMapper.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/runtime/ProtectedFunctionMapper.java?rev=804373&r1=804372&r2=804373&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/runtime/ProtectedFunctionMapper.java (original)
+++ struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/runtime/ProtectedFunctionMapper.java Fri Aug 14 21:02:33 2009
@@ -37,7 +37,7 @@
  */
 public final class ProtectedFunctionMapper implements FunctionMapper {
 
-    /** 
+    /**
      * Maps "prefix:name" to java.lang.Method objects.
      */
     private HashMap fnmap = null;
@@ -63,59 +63,58 @@
      */
     public static ProtectedFunctionMapper getInstance() {
         ProtectedFunctionMapper funcMapper;
-	if (SecurityUtil.isPackageProtectionEnabled()) {
-	    funcMapper = (ProtectedFunctionMapper)AccessController.doPrivileged(
-		new PrivilegedAction() {
-		public Object run() {
-		    return new ProtectedFunctionMapper();
-		}
-	    } );
-	} else {
-	    funcMapper = new ProtectedFunctionMapper();
-	}
-	funcMapper.fnmap = new java.util.HashMap();
-	return funcMapper;
+        if (SecurityUtil.isPackageProtectionEnabled()) {
+            funcMapper = (ProtectedFunctionMapper) AccessController.doPrivileged(
+                    new PrivilegedAction() {
+                        public Object run() {
+                            return new ProtectedFunctionMapper();
+                        }
+                    });
+        } else {
+            funcMapper = new ProtectedFunctionMapper();
+        }
+        funcMapper.fnmap = new java.util.HashMap();
+        return funcMapper;
     }
 
     /**
-     * Stores a mapping from the given EL function prefix and name to 
+     * Stores a mapping from the given EL function prefix and name to
      * the given Java method.
      *
-     * @param fnQName The EL function qualified name (including prefix)
-     * @param c The class containing the Java method
+     * @param fnQName    The EL function qualified name (including prefix)
+     * @param c          The class containing the Java method
      * @param methodName The name of the Java method
-     * @param args The arguments of the Java method
+     * @param args       The arguments of the Java method
      * @throws RuntimeException if no method with the given signature
-     *     could be found.
+     *                          could be found.
      */
     public void mapFunction(String fnQName, final Class c,
-			    final String methodName, final Class[] args ) 
-    {
-	java.lang.reflect.Method method;
-        if (SecurityUtil.isPackageProtectionEnabled()){
-            try{
-                method = (java.lang.reflect.Method)AccessController.doPrivileged(new PrivilegedExceptionAction(){
+                            final String methodName, final Class[] args) {
+        java.lang.reflect.Method method;
+        if (SecurityUtil.isPackageProtectionEnabled()) {
+            try {
+                method = (java.lang.reflect.Method) AccessController.doPrivileged(new PrivilegedExceptionAction() {
 
-                    public Object run() throws Exception{
+                    public Object run() throws Exception {
                         return c.getDeclaredMethod(methodName, args);
-                    }                
-                });      
-            } catch (PrivilegedActionException ex){
+                    }
+                });
+            } catch (PrivilegedActionException ex) {
                 throw new RuntimeException(
-                    "Invalid function mapping - no such method: "
-		    + ex.getException().getMessage());               
+                        "Invalid function mapping - no such method: "
+                                + ex.getException().getMessage());
             }
         } else {
-             try {
+            try {
                 method = c.getDeclaredMethod(methodName, args);
-            } catch( NoSuchMethodException e ) {
+            } catch (NoSuchMethodException e) {
                 throw new RuntimeException(
-                    "Invalid function mapping - no such method: "
-		    + e.getMessage());
+                        "Invalid function mapping - no such method: "
+                                + e.getMessage());
             }
         }
 
-	this.fnmap.put(fnQName, method );
+        this.fnmap.put(fnQName, method);
     }
 
     /**
@@ -123,67 +122,66 @@
      * the given EL function prefix and name. This method is used for
      * the case when there is only one function in the EL expression.
      *
-     * @param fnQName The EL function qualified name (including prefix)
-     * @param c The class containing the Java method
+     * @param fnQName    The EL function qualified name (including prefix)
+     * @param c          The class containing the Java method
      * @param methodName The name of the Java method
-     * @param args The arguments of the Java method
+     * @param args       The arguments of the Java method
      * @throws RuntimeException if no method with the given signature
-     *     could be found.
+     *                          could be found.
      */
     public static ProtectedFunctionMapper getMapForFunction(
-		String fnQName, final Class c,
-                final String methodName, final Class[] args )
-    {
+            String fnQName, final Class c,
+            final String methodName, final Class[] args) {
         java.lang.reflect.Method method;
         ProtectedFunctionMapper funcMapper;
-        if (SecurityUtil.isPackageProtectionEnabled()){
-            funcMapper = (ProtectedFunctionMapper)AccessController.doPrivileged(
-                new PrivilegedAction(){
-                public Object run() {
-                    return new ProtectedFunctionMapper();
-                }
-            });
-
-            try{
-                method = (java.lang.reflect.Method)AccessController.doPrivileged
-(new PrivilegedExceptionAction(){
-
-                    public Object run() throws Exception{
-                        return c.getDeclaredMethod(methodName, args);
-                    }
-                });
-            } catch (PrivilegedActionException ex){
+        if (SecurityUtil.isPackageProtectionEnabled()) {
+            funcMapper = (ProtectedFunctionMapper) AccessController.doPrivileged(
+                    new PrivilegedAction() {
+                        public Object run() {
+                            return new ProtectedFunctionMapper();
+                        }
+                    });
+
+            try {
+                method = (java.lang.reflect.Method) AccessController.doPrivileged
+                        (new PrivilegedExceptionAction() {
+
+                            public Object run() throws Exception {
+                                return c.getDeclaredMethod(methodName, args);
+                            }
+                        });
+            } catch (PrivilegedActionException ex) {
                 throw new RuntimeException(
-                    "Invalid function mapping - no such method: "
-                    + ex.getException().getMessage());
+                        "Invalid function mapping - no such method: "
+                                + ex.getException().getMessage());
             }
         } else {
-	    funcMapper = new ProtectedFunctionMapper();
-             try {
+            funcMapper = new ProtectedFunctionMapper();
+            try {
                 method = c.getDeclaredMethod(methodName, args);
-            } catch( NoSuchMethodException e ) {
+            } catch (NoSuchMethodException e) {
                 throw new RuntimeException(
-                    "Invalid function mapping - no such method: "
-                    + e.getMessage());
+                        "Invalid function mapping - no such method: "
+                                + e.getMessage());
             }
         }
         funcMapper.theMethod = method;
-	return funcMapper;
+        return funcMapper;
     }
 
     /**
      * Resolves the specified local name and prefix into a Java.lang.Method.
      * Returns null if the prefix and local name are not found.
-     * 
-     * @param prefix the prefix of the function
+     *
+     * @param prefix    the prefix of the function
      * @param localName the short name of the function
      * @return the result of the method mapping.  Null means no entry found.
-     **/
+     */
     public Method resolveFunction(String prefix, String localName) {
         if (this.fnmap != null) {
             return (Method) this.fnmap.get(prefix + ":" + localName);
         }
-	return theMethod;
+        return theMethod;
     }
 }
 

Modified: struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/runtime/ServletResponseWrapperInclude.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/runtime/ServletResponseWrapperInclude.java?rev=804373&r1=804372&r2=804373&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/runtime/ServletResponseWrapperInclude.java (original)
+++ struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/runtime/ServletResponseWrapperInclude.java Fri Aug 14 21:02:33 2009
@@ -27,7 +27,7 @@
 
 /**
  * ServletResponseWrapper used by the JSP 'include' action.
- *
+ * <p/>
  * This wrapper response object is passed to RequestDispatcher.include(), so
  * that the output of the included resource is appended to that of the
  * including page.
@@ -44,22 +44,22 @@
 
     private JspWriter jspWriter;
 
-    public ServletResponseWrapperInclude(ServletResponse response, 
-					 JspWriter jspWriter) {
-	super((HttpServletResponse)response);
-	this.printWriter = new PrintWriter(jspWriter);
-	this.jspWriter = jspWriter;
+    public ServletResponseWrapperInclude(ServletResponse response,
+                                         JspWriter jspWriter) {
+        super((HttpServletResponse) response);
+        this.printWriter = new PrintWriter(jspWriter);
+        this.jspWriter = jspWriter;
     }
 
     /**
      * Returns a wrapper around the JspWriter of the including page.
      */
     public PrintWriter getWriter() throws IOException {
-	return printWriter;
+        return printWriter;
     }
 
     public ServletOutputStream getOutputStream() throws IOException {
-	throw new IllegalStateException();
+        throw new IllegalStateException();
     }
 
     /**
@@ -67,9 +67,9 @@
      * page.
      */
     public void resetBuffer() {
-	try {
-	    jspWriter.clearBuffer();
-	} catch (IOException ioe) {
-	}
+        try {
+            jspWriter.clearBuffer();
+        } catch (IOException ioe) {
+        }
     }
 }

Modified: struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/runtime/TagHandlerPool.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/runtime/TagHandlerPool.java?rev=804373&r1=804372&r2=804373&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/runtime/TagHandlerPool.java (original)
+++ struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/runtime/TagHandlerPool.java Fri Aug 14 21:02:33 2009
@@ -32,43 +32,43 @@
 
     private Tag[] handlers;
 
-    public static String OPTION_TAGPOOL="tagpoolClassName";
-    public static String OPTION_MAXSIZE="tagpoolMaxSize";
+    public static String OPTION_TAGPOOL = "tagpoolClassName";
+    public static String OPTION_MAXSIZE = "tagpoolMaxSize";
 
     // index of next available tag handler
     private int current;
 
-    public static TagHandlerPool getTagHandlerPool( ServletConfig config) {
-        TagHandlerPool result=null;
+    public static TagHandlerPool getTagHandlerPool(ServletConfig config) {
+        TagHandlerPool result = null;
 
-        String tpClassName=getOption( config, OPTION_TAGPOOL, null);
-        if( tpClassName != null ) {
+        String tpClassName = getOption(config, OPTION_TAGPOOL, null);
+        if (tpClassName != null) {
             try {
-                Class c=Class.forName( tpClassName );
-                result=(TagHandlerPool)c.newInstance();
+                Class c = Class.forName(tpClassName);
+                result = (TagHandlerPool) c.newInstance();
             } catch (Exception e) {
                 e.printStackTrace();
-                result=null;
+                result = null;
             }
         }
-        if( result==null ) result=new TagHandlerPool();
+        if (result == null) result = new TagHandlerPool();
         result.init(config);
 
         return result;
     }
 
-    protected void init( ServletConfig config ) {
-        int maxSize=-1;
-        String maxSizeS=getOption(config, OPTION_MAXSIZE, null);
-        if( maxSizeS != null ) {
+    protected void init(ServletConfig config) {
+        int maxSize = -1;
+        String maxSizeS = getOption(config, OPTION_MAXSIZE, null);
+        if (maxSizeS != null) {
             try {
-                maxSize=Integer.parseInt(maxSizeS);
-            } catch( Exception ex) {
-                maxSize=-1;
+                maxSize = Integer.parseInt(maxSizeS);
+            } catch (Exception ex) {
+                maxSize = -1;
             }
         }
-        if( maxSize <0  ) {
-            maxSize=Constants.MAX_POOL_SIZE;
+        if (maxSize < 0) {
+            maxSize = Constants.MAX_POOL_SIZE;
         }
         this.handlers = new Tag[maxSize];
         this.current = -1;
@@ -78,7 +78,7 @@
      * Constructs a tag handler pool with the default capacity.
      */
     public TagHandlerPool() {
-	// Nothing - jasper generated servlets call the other constructor,
+        // Nothing - jasper generated servlets call the other constructor,
         // this should be used in future + init .
     }
 
@@ -89,8 +89,8 @@
      * @deprecated Use static getTagHandlerPool
      */
     public TagHandlerPool(int capacity) {
-	this.handlers = new Tag[capacity];
-	this.current = -1;
+        this.handlers = new Tag[capacity];
+        this.current = -1;
     }
 
     /**
@@ -98,14 +98,12 @@
      * instantiating one if this tag handler pool is empty.
      *
      * @param handlerClass Tag handler class
-     *
      * @return Reused or newly instantiated tag handler
-     *
      * @throws JspException if a tag handler cannot be instantiated
      */
     public Tag get(Class handlerClass) throws JspException {
-	Tag handler = null;
-        synchronized( this ) {
+        Tag handler = null;
+        synchronized (this) {
             if (current >= 0) {
                 handler = handlers[current--];
                 return handler;
@@ -129,7 +127,7 @@
      * @param handler Tag handler to add to this tag handler pool
      */
     public void reuse(Tag handler) {
-        synchronized( this ) {
+        synchronized (this) {
             if (current < (handlers.length - 1)) {
                 handlers[++current] = handler;
                 return;
@@ -144,20 +142,20 @@
      * handler pool.
      */
     public synchronized void release() {
-	for (int i=current; i>=0; i--) {
-	    handlers[i].release();
-	}
+        for (int i = current; i >= 0; i--) {
+            handlers[i].release();
+        }
     }
 
-    protected static String getOption( ServletConfig config, String name, String defaultV) {
-        if( config == null ) return defaultV;
+    protected static String getOption(ServletConfig config, String name, String defaultV) {
+        if (config == null) return defaultV;
 
-        String value=config.getInitParameter(name);
-        if( value != null ) return value;
-        if( config.getServletContext() ==null )
+        String value = config.getInitParameter(name);
+        if (value != null) return value;
+        if (config.getServletContext() == null)
             return defaultV;
-        value=config.getServletContext().getInitParameter(name);
-        if( value!=null ) return value;
+        value = config.getServletContext().getInitParameter(name);
+        if (value != null) return value;
         return defaultV;
     }
 

Modified: struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/security/SecurityClassLoad.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/security/SecurityClassLoad.java?rev=804373&r1=804372&r2=804373&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/security/SecurityClassLoad.java (original)
+++ struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/security/SecurityClassLoad.java Fri Aug 14 21:02:33 2009
@@ -18,6 +18,9 @@
 
 package org.apache.struts2.jasper.security;
 
+import com.opensymphony.xwork2.util.logging.Logger;
+import com.opensymphony.xwork2.util.logging.LoggerFactory;
+
 /**
  * Static class used to preload java classes when using the
  * Java SecurityManager so that the defineClassInPackage
@@ -28,82 +31,81 @@
 
 public final class SecurityClassLoad {
 
-    private static org.apache.commons.logging.Log log=
-        org.apache.commons.logging.LogFactory.getLog( SecurityClassLoad.class );
+    private static Logger log = LoggerFactory.getLogger(SecurityClassLoad.class);
 
-    public static void securityClassLoad(ClassLoader loader){
+    public static void securityClassLoad(ClassLoader loader) {
 
-        if( System.getSecurityManager() == null ){
+        if (System.getSecurityManager() == null) {
             return;
         }
 
         String basePackage = "org.apache.struts2.jasper.";
         try {
-            loader.loadClass( basePackage +
-                "runtime.JspFactoryImpl$PrivilegedGetPageContext");
-            loader.loadClass( basePackage +
-                "runtime.JspFactoryImpl$PrivilegedReleasePageContext");
-
-            loader.loadClass( basePackage +
-                "runtime.JspRuntimeLibrary");
-            loader.loadClass( basePackage +
-                "runtime.JspRuntimeLibrary$PrivilegedIntrospectHelper");
-            
-            loader.loadClass( basePackage +
-                "runtime.ServletResponseWrapperInclude");
-            loader.loadClass( basePackage +
-                "runtime.TagHandlerPool");
-            loader.loadClass( basePackage +
-                "runtime.JspFragmentHelper");
-
-            loader.loadClass( basePackage +
-                "runtime.ProtectedFunctionMapper");
-            loader.loadClass( basePackage +
-                "runtime.ProtectedFunctionMapper$1");
-            loader.loadClass( basePackage +
-                "runtime.ProtectedFunctionMapper$2"); 
-            loader.loadClass( basePackage +
-                "runtime.ProtectedFunctionMapper$3");
-            loader.loadClass( basePackage +
-                "runtime.ProtectedFunctionMapper$4"); 
-
-            loader.loadClass( basePackage +
-                "runtime.PageContextImpl");      
-            loader.loadClass( basePackage +
-                "runtime.PageContextImpl$1");      
-            loader.loadClass( basePackage +
-                "runtime.PageContextImpl$2");      
-            loader.loadClass( basePackage +
-                "runtime.PageContextImpl$3");      
-            loader.loadClass( basePackage +
-                "runtime.PageContextImpl$4");      
-            loader.loadClass( basePackage +
-                "runtime.PageContextImpl$5");      
-            loader.loadClass( basePackage +
-                "runtime.PageContextImpl$6");      
-            loader.loadClass( basePackage +
-                "runtime.PageContextImpl$7");      
-            loader.loadClass( basePackage +
-                "runtime.PageContextImpl$8");      
-            loader.loadClass( basePackage +
-                "runtime.PageContextImpl$9");      
-            loader.loadClass( basePackage +
-                "runtime.PageContextImpl$10");      
-            loader.loadClass( basePackage +
-                "runtime.PageContextImpl$11");      
-            loader.loadClass( basePackage +
-                "runtime.PageContextImpl$12");      
-            loader.loadClass( basePackage +
-                "runtime.PageContextImpl$13");      
+            loader.loadClass(basePackage +
+                    "runtime.JspFactoryImpl$PrivilegedGetPageContext");
+            loader.loadClass(basePackage +
+                    "runtime.JspFactoryImpl$PrivilegedReleasePageContext");
+
+            loader.loadClass(basePackage +
+                    "runtime.JspRuntimeLibrary");
+            loader.loadClass(basePackage +
+                    "runtime.JspRuntimeLibrary$PrivilegedIntrospectHelper");
+
+            loader.loadClass(basePackage +
+                    "runtime.ServletResponseWrapperInclude");
+            loader.loadClass(basePackage +
+                    "runtime.TagHandlerPool");
+            loader.loadClass(basePackage +
+                    "runtime.JspFragmentHelper");
+
+            loader.loadClass(basePackage +
+                    "runtime.ProtectedFunctionMapper");
+            loader.loadClass(basePackage +
+                    "runtime.ProtectedFunctionMapper$1");
+            loader.loadClass(basePackage +
+                    "runtime.ProtectedFunctionMapper$2");
+            loader.loadClass(basePackage +
+                    "runtime.ProtectedFunctionMapper$3");
+            loader.loadClass(basePackage +
+                    "runtime.ProtectedFunctionMapper$4");
+
+            loader.loadClass(basePackage +
+                    "runtime.PageContextImpl");
+            loader.loadClass(basePackage +
+                    "runtime.PageContextImpl$1");
+            loader.loadClass(basePackage +
+                    "runtime.PageContextImpl$2");
+            loader.loadClass(basePackage +
+                    "runtime.PageContextImpl$3");
+            loader.loadClass(basePackage +
+                    "runtime.PageContextImpl$4");
+            loader.loadClass(basePackage +
+                    "runtime.PageContextImpl$5");
+            loader.loadClass(basePackage +
+                    "runtime.PageContextImpl$6");
+            loader.loadClass(basePackage +
+                    "runtime.PageContextImpl$7");
+            loader.loadClass(basePackage +
+                    "runtime.PageContextImpl$8");
+            loader.loadClass(basePackage +
+                    "runtime.PageContextImpl$9");
+            loader.loadClass(basePackage +
+                    "runtime.PageContextImpl$10");
+            loader.loadClass(basePackage +
+                    "runtime.PageContextImpl$11");
+            loader.loadClass(basePackage +
+                    "runtime.PageContextImpl$12");
+            loader.loadClass(basePackage +
+                    "runtime.PageContextImpl$13");
 
-            loader.loadClass( basePackage +
-                "runtime.JspContextWrapper");   
+            loader.loadClass(basePackage +
+                    "runtime.JspContextWrapper");
 
-            loader.loadClass( basePackage +
-                "servlet.JspServletWrapper");
+            loader.loadClass(basePackage +
+                    "servlet.JspServletWrapper");
 
-            loader.loadClass( basePackage +
-                "runtime.JspWriterImpl$1");
+            loader.loadClass(basePackage +
+                    "runtime.JspWriterImpl$1");
         } catch (ClassNotFoundException ex) {
             log.error("SecurityClassLoad", ex);
         }

Modified: struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/security/SecurityUtil.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/security/SecurityUtil.java?rev=804373&r1=804372&r2=804373&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/security/SecurityUtil.java (original)
+++ struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/security/SecurityUtil.java Fri Aug 14 21:02:33 2009
@@ -22,21 +22,21 @@
  * @author Jean-Francois Arcand
  */
 
-public final class SecurityUtil{
-    
-    private static boolean packageDefinitionEnabled =  
-         System.getProperty("package.definition") == null ? false : true;
-    
+public final class SecurityUtil {
+
+    private static boolean packageDefinitionEnabled =
+            System.getProperty("package.definition") == null ? false : true;
+
     /**
      * Return the <code>SecurityManager</code> only if Security is enabled AND
      * package protection mechanism is enabled.
      */
-    public static boolean isPackageProtectionEnabled(){
-        if (packageDefinitionEnabled && System.getSecurityManager() !=  null){
+    public static boolean isPackageProtectionEnabled() {
+        if (packageDefinitionEnabled && System.getSecurityManager() != null) {
             return true;
         }
         return false;
     }
-    
-    
+
+
 }

Modified: struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/servlet/JasperLoader.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/servlet/JasperLoader.java?rev=804373&r1=804372&r2=804373&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/servlet/JasperLoader.java (original)
+++ struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/servlet/JasperLoader.java Fri Aug 14 21:02:33 2009
@@ -27,7 +27,7 @@
 import java.security.PermissionCollection;
 
 /**
- * Class loader for loading servlet class files (corresponding to JSP files) 
+ * Class loader for loading servlet class files (corresponding to JSP files)
  * and tag handler class files (corresponding to tag files).
  *
  * @author Anil K. Vijendran
@@ -41,12 +41,12 @@
     private SecurityManager securityManager;
 
     public JasperLoader(URL[] urls, ClassLoader parent,
-			PermissionCollection permissionCollection,
-			CodeSource codeSource) {
-	super(urls, parent);
-	this.permissionCollection = permissionCollection;
-	this.parent = parent;
-	this.securityManager = System.getSecurityManager();
+                        PermissionCollection permissionCollection,
+                        CodeSource codeSource) {
+        super(urls, parent);
+        this.permissionCollection = permissionCollection;
+        this.parent = parent;
+        this.securityManager = System.getSecurityManager();
     }
 
     /**
@@ -55,8 +55,7 @@
      * with <code>false</code> as the second argument.
      *
      * @param name Name of the class to be loaded
-     *
-     * @exception ClassNotFoundException if the class was not found
+     * @throws ClassNotFoundException if the class was not found
      */
     public Class loadClass(String name) throws ClassNotFoundException {
 
@@ -69,72 +68,71 @@
      * be found, returns <code>ClassNotFoundException</code>.
      * <ul>
      * <li>Call <code>findLoadedClass(String)</code> to check if the
-     *     class has already been loaded.  If it has, the same
-     *     <code>Class</code> object is returned.</li>
+     * class has already been loaded.  If it has, the same
+     * <code>Class</code> object is returned.</li>
      * <li>If the <code>delegate</code> property is set to <code>true</code>,
-     *     call the <code>loadClass()</code> method of the parent class
-     *     loader, if any.</li>            
+     * call the <code>loadClass()</code> method of the parent class
+     * loader, if any.</li>
      * <li>Call <code>findClass()</code> to find this class in our locally
-     *     defined repositories.</li>      
+     * defined repositories.</li>
      * <li>Call the <code>loadClass()</code> method of our parent
-     *     class loader, if any.</li>      
+     * class loader, if any.</li>
      * </ul>
      * If the class was found using the above steps, and the
      * <code>resolve</code> flag is <code>true</code>, this method will then
      * call <code>resolveClass(Class)</code> on the resulting Class object.
-     *                                     
-     * @param name Name of the class to be loaded
+     *
+     * @param name    Name of the class to be loaded
      * @param resolve If <code>true</code> then resolve the class
-     *                                     
-     * @exception ClassNotFoundException if the class was not found
-     */                                    
+     * @throws ClassNotFoundException if the class was not found
+     */
     public Class loadClass(final String name, boolean resolve)
-        throws ClassNotFoundException {
+            throws ClassNotFoundException {
+
+        Class clazz = null;
 
-        Class clazz = null;                
-                                           
         // (0) Check our previously loaded class cache
-        clazz = findLoadedClass(name);     
-        if (clazz != null) {               
-            if (resolve)                   
-                resolveClass(clazz);       
-            return (clazz);        
-        }                          
-                          
+        clazz = findLoadedClass(name);
+        if (clazz != null) {
+            if (resolve)
+                resolveClass(clazz);
+            return (clazz);
+        }
+
         // (.5) Permission to access this class when using a SecurityManager
-        if (securityManager != null) {     
+        if (securityManager != null) {
             int dot = name.lastIndexOf('.');
-            if (dot >= 0) {                
-                try {        
+            if (dot >= 0) {
+                try {
                     // Do not call the security manager since by default, we grant that package.
-                    if (!"org.apache.struts2.jasper.runtime".equalsIgnoreCase(name.substring(0,dot))){
-                        securityManager.checkPackageAccess(name.substring(0,dot));
+                    if (!"org.apache.struts2.jasper.runtime".equalsIgnoreCase(name.substring(0, dot))) {
+                        securityManager.checkPackageAccess(name.substring(0, dot));
                     }
                 } catch (SecurityException se) {
                     String error = "Security Violation, attempt to use " +
-                        "Restricted Class: " + name;
+                            "Restricted Class: " + name;
                     se.printStackTrace();
                     throw new ClassNotFoundException(error);
-                }                          
-            }                              
+                }
+            }
         }
 
-	if( !name.startsWith(Constants.JSP_PACKAGE_NAME) ) {
+        if (!name.startsWith(Constants.JSP_PACKAGE_NAME)) {
             // Class is not in org.apache.jsp, therefore, have our
             // parent load it
-            clazz = parent.loadClass(name);            
-	    if( resolve )
-		resolveClass(clazz);
-	    return clazz;
-	}
+            clazz = parent.loadClass(name);
+            if (resolve)
+                resolveClass(clazz);
+            return clazz;
+        }
 
-	return findClass(name);
+        return findClass(name);
     }
 
-    
+
     /**
      * Delegate to parent
-     * 
+     *
      * @see java.lang.ClassLoader#getResourceAsStream(java.lang.String)
      */
     public InputStream getResourceAsStream(String name) {
@@ -151,11 +149,11 @@
         }
         return is;
     }
-    
-    
+
+
     /**
      * Get the Permissions for a CodeSource.
-     *
+     * <p/>
      * Since this ClassLoader is only used for a JSP page in
      * a web application context, we just return our preset
      * PermissionCollection for the web app context.



Mime
View raw message