Author: markt Date: Wed Dec 8 01:12:03 2010 New Revision: 1043263 URL: http://svn.apache.org/viewvc?rev=1043263&view=rev Log: Jasper should not depend on Catalina Re-use constants where possible Fix a FindBugs niggle
Modified: tomcat/trunk/java/org/apache/jasper/Constants.java tomcat/trunk/java/org/apache/jasper/compiler/AntCompiler.java Modified: tomcat/trunk/java/org/apache/jasper/Constants.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/Constants.java?rev=1043263&r1=1043262&r2=1043263&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/jasper/Constants.java (original) +++ tomcat/trunk/java/org/apache/jasper/Constants.java Wed Dec 8 01:12:03 2010 @@ -214,4 +214,15 @@ public class Constants { System.getProperty("org.apache.catalina.SESSION_PARAMETER_NAME", "jsessionid"); + /** + * Name of the system property containing + * the tomcat product installation path + */ + public static final String CATALINA_HOME_PROP = "catalina.home"; + + /** + * Name of the system property containing + * the tomcat instance installation path + */ + public static final String CATALINA_BASE_PROP = "catalina.base"; } Modified: tomcat/trunk/java/org/apache/jasper/compiler/AntCompiler.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/AntCompiler.java?rev=1043263&r1=1043262&r2=1043263&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/jasper/compiler/AntCompiler.java (original) +++ tomcat/trunk/java/org/apache/jasper/compiler/AntCompiler.java Wed Dec 8 01:12:03 2010 @@ -24,7 +24,7 @@ import java.io.IOException; import java.io.PrintStream; import java.util.StringTokenizer; -import org.apache.catalina.Globals; +import org.apache.jasper.Constants; import org.apache.jasper.JasperException; import org.apache.juli.logging.Log; import org.apache.juli.logging.LogFactory; @@ -75,8 +75,8 @@ public class AntCompiler extends Compile logger.setErrorPrintStream(System.err); logger.setMessageOutputLevel(Project.MSG_INFO); project.addBuildListener( logger); - if (System.getProperty(Globals.CATALINA_HOME_PROP) != null) { - project.setBasedir(System.getProperty(Globals.CATALINA_HOME_PROP)); + if (System.getProperty(Constants.CATALINA_HOME_PROP) != null) { + project.setBasedir(System.getProperty(Constants.CATALINA_HOME_PROP)); } if( options.getCompiler() != null ) { @@ -88,7 +88,7 @@ public class AntCompiler extends Compile return project; } - public class JasperAntLogger extends DefaultLogger { + public static class JasperAntLogger extends DefaultLogger { protected StringBuilder reportBuf = new StringBuilder(); @@ -101,7 +101,7 @@ public class AntCompiler extends Compile @Override protected void log(String message) { reportBuf.append(message); - reportBuf.append(System.getProperty("line.separator")); + reportBuf.append(Constants.NEWLINE); } protected String getReport() { @@ -245,7 +245,7 @@ public class AntCompiler extends Compile // Stop capturing the System.err output for this thread String errorCapture = SystemLogHandler.unsetThread(); if (errorCapture != null) { - errorReport.append(System.getProperty("line.separator")); + errorReport.append(Constants.NEWLINE); errorReport.append(errorCapture); } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org