Author: markt
Date: Mon Oct 27 22:51:00 2014
New Revision: 1634720

URL: http://svn.apache.org/r1634720
Log:
registerSourceFile() is only called from the constructor.
At this point sourceFiles is always empty so registerSourceFile() will
always return zero.
That makes the code that follows registerSourceFile() always a NO-OP
which in turn removes the need for calling registerSourceFile() in the
first place.
Remove soucrceFiles as unused.

Modified:
    tomcat/trunk/java/org/apache/jasper/compiler/JspReader.java

Modified: tomcat/trunk/java/org/apache/jasper/compiler/JspReader.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/JspReader.java?rev=1634720&r1=1634719&r2=1634720&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/JspReader.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/JspReader.java Mon Oct 27 
22:51:00 2014
@@ -20,8 +20,6 @@ import java.io.CharArrayWriter;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStreamReader;
-import java.util.List;
-import java.util.Vector;
 
 import org.apache.jasper.JasperException;
 import org.apache.jasper.JspCompilationContext;
@@ -64,11 +62,6 @@ class JspReader {
     private String master;
 
     /**
-     * The list of source files.
-     */
-    private final List<String> sourceFiles;
-
-    /**
      * The compilation context.
      */
     private final JspCompilationContext context;
@@ -113,22 +106,6 @@ class JspReader {
 
         this.context = ctxt;
         this.err = err;
-        sourceFiles = new Vector<>();
-
-        int fileid = registerSourceFile(fname);
-
-        if (fileid == -1) {
-            // http://issues.apache.org/bugzilla/show_bug.cgi?id=37407
-            try {
-                reader.close();
-            } catch (Exception any) {
-                if(log.isDebugEnabled()) {
-                    log.debug("Exception closing reader: ", any);
-                }
-            }
-
-            err.jspError("jsp.error.file.already.registered", fname);
-        }
 
         try {
             CharArrayWriter caw = new CharArrayWriter();
@@ -632,22 +609,5 @@ class JspReader {
             return true;
         }
     }
-
-    /**
-     * Register a new source file.
-     * This method is used to implement file inclusion. Each included file
-     * gets a unique identifier (which is the index in the array of source
-     * files).
-     *
-     * @return The index of the now registered file.
-     */
-    private int registerSourceFile(final String file) {
-        if (sourceFiles.contains(file)) {
-            return -1;
-        }
-
-        sourceFiles.add(file);
-        return sourceFiles.size() - 1;
-    }
 }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to