geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r1436570 - in /geronimo/external/trunk/tomcat-parent-7.0.27/jasper/src/main/java/org/apache/jasper: JspC.java servlet/JspCServletContext.java
Date Mon, 21 Jan 2013 19:35:45 GMT
Author: gawor
Date: Mon Jan 21 19:35:45 2013
New Revision: 1436570

URL: http://svn.apache.org/viewvc?rev=1436570&view=rev
Log:
Fix a regression caused by the changes for https://issues.apache.org/bugzilla/show_bug.cgi?id=54240
that broke compilation with JspC.

Modified:
    geronimo/external/trunk/tomcat-parent-7.0.27/jasper/src/main/java/org/apache/jasper/JspC.java
    geronimo/external/trunk/tomcat-parent-7.0.27/jasper/src/main/java/org/apache/jasper/servlet/JspCServletContext.java

Modified: geronimo/external/trunk/tomcat-parent-7.0.27/jasper/src/main/java/org/apache/jasper/JspC.java
URL: http://svn.apache.org/viewvc/geronimo/external/trunk/tomcat-parent-7.0.27/jasper/src/main/java/org/apache/jasper/JspC.java?rev=1436570&r1=1436569&r2=1436570&view=diff
==============================================================================
--- geronimo/external/trunk/tomcat-parent-7.0.27/jasper/src/main/java/org/apache/jasper/JspC.java
(original)
+++ geronimo/external/trunk/tomcat-parent-7.0.27/jasper/src/main/java/org/apache/jasper/JspC.java
Mon Jan 21 19:35:45 2013
@@ -56,7 +56,8 @@ import org.apache.jasper.servlet.JspCSer
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tools.ant.AntClassLoader;
-import org.apache.tools.ant.Project;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Task;
 import org.apache.tools.ant.util.FileUtils;
 
 /**
@@ -91,7 +92,7 @@ import org.apache.tools.ant.util.FileUti
  * @author Costin Manolache
  * @author Yoav Shapira
  */
-public class JspC implements Options {
+public class JspC extends Task implements Options {
 
     public static final String DEFAULT_IE_CLASS_ID =
             "clsid:8AD9C840-044E-11D1-B3E9-00805F499D93";
@@ -164,7 +165,6 @@ public class JspC implements Options {
     protected String targetClassName;
     protected String uriBase;
     protected String uriRoot;
-    protected Project project;
     protected int dieLevel;
     protected boolean helpNeeded = false;
     protected boolean compile = false;
@@ -263,6 +263,11 @@ public class JspC implements Options {
                 if (jspc.dieLevel != NO_DIE_LEVEL) {
                     System.exit(jspc.dieLevel);
                 }
+            } catch (BuildException je) {
+                System.err.println(je);
+                if (jspc.dieLevel != NO_DIE_LEVEL) {
+                    System.exit(jspc.dieLevel);
+                }
             }
         }
     }
@@ -778,25 +783,6 @@ public class JspC implements Options {
     }
 
     /**
-     * Sets the Ant project.
-     *
-     * @param theProject The project
-     */
-    public void setProject(final Project theProject) {
-        project = theProject;
-    }
-
-    /**
-     * Returns the project: may be <code>null</code> if not running
-     * inside an Ant project.
-     *
-     * @return The project
-     */
-    public Project getProject() {
-        return project;
-    }
-
-    /**
      * Base dir for the webapp. Used to generate class names and resolve
      * includes.
      */
@@ -1274,7 +1260,8 @@ public class JspC implements Options {
      *
      * @throws JasperException If an error occurs
      */
-    public void execute() throws JasperException {
+    @Override
+    public void execute() {
         if(log.isDebugEnabled()) {
             log.debug("execute() starting for " + pages.size() + " pages.");
         }
@@ -1349,7 +1336,7 @@ public class JspC implements Options {
             }
 
         } catch (IOException ioe) {
-            throw new JasperException(ioe);
+            throw new BuildException(ioe);
 
         } catch (JasperException je) {
             Throwable rootCause = je;
@@ -1360,7 +1347,7 @@ public class JspC implements Options {
             if (rootCause != je) {
                 rootCause.printStackTrace();
             }
-            throw je;
+            throw new BuildException(je);
         } finally {
             if (loader != null) {
                 LogFactory.release(loader);
@@ -1529,7 +1516,7 @@ public class JspC implements Options {
         URL urlsA[]=new URL[urls.size()];
         urls.toArray(urlsA);
         loader = new URLClassLoader(urlsA, this.getClass().getClassLoader());
-
+        context.setClassLoader(loader);
     }
 
     /**

Modified: geronimo/external/trunk/tomcat-parent-7.0.27/jasper/src/main/java/org/apache/jasper/servlet/JspCServletContext.java
URL: http://svn.apache.org/viewvc/geronimo/external/trunk/tomcat-parent-7.0.27/jasper/src/main/java/org/apache/jasper/servlet/JspCServletContext.java?rev=1436570&r1=1436569&r2=1436570&view=diff
==============================================================================
--- geronimo/external/trunk/tomcat-parent-7.0.27/jasper/src/main/java/org/apache/jasper/servlet/JspCServletContext.java
(original)
+++ geronimo/external/trunk/tomcat-parent-7.0.27/jasper/src/main/java/org/apache/jasper/servlet/JspCServletContext.java
Mon Jan 21 19:35:45 2013
@@ -78,9 +78,14 @@ public class JspCServletContext implemen
     protected URL myResourceBaseURL;
 
 
-    // ----------------------------------------------------------- Constructors
+    /**
+     * Web application class loader.
+     */
+    private ClassLoader loader;
 
 
+    // ----------------------------------------------------------- Constructors
+
     /**
      * Create a new instance of this ServletContext implementation.
      *
@@ -612,7 +617,12 @@ public class JspCServletContext implemen
 
     @Override
     public ClassLoader getClassLoader() {
-        return null;
+        return loader;
+    }
+
+
+    public void setClassLoader(ClassLoader loader) {
+        this.loader = loader;
     }
 
 



Mime
View raw message