I accidentally got Windows end-of-line sequences in the last set of
patches. Here's a better set.
--
Jess Holle
Jess Holle wrote:
Okay, I now (belatedly) understand the problem.
The issue is that by default Jaspper is setting the target release to
1.3 but leaving the source release unspecified -- resulting in the JDK
1.5 javac default source release, 1.5 -- and javac won't allow this
mixture.
I am attaching a set of patches that (1) defaults the source release
to 1.3 as well and (2) allows this to be controlled in a completely
independent and analogous manner to target release.
I would appreciate seeing this in 5.0.30 :-)
--
Jess Holle
--- Options.java-5.0.29 2004-10-19 09:56:58.000000000 -0500
+++ Options.java 2004-10-19 09:57:00.000000000 -0500
@@ -117,11 +117,16 @@
public String getCompiler();
/**
- * Compiler target VM, e.g. 1.1,1.2,1.3, or 1.4.
+ * Compiler target VM, e.g. 1.1, 1.2, 1.3, 1.4, or 1.5.
*/
public String getCompilerTargetVM();
/**
+ * Compiler source VM, e.g. 1.3, 1.4, or 1.5.
+ */
+ public String getCompilerSourceVM();
+
+ /**
* The cache for the location of the TLD's
* for the various tag libraries 'exposed'
* by the web application.
--- Compiler.java-5.0.29 2004-10-19 09:56:54.000000000 -0500
+++ Compiler.java 2004-10-19 09:57:08.000000000 -0500
@@ -386,6 +386,11 @@
info.append(" compilerTargetVM=" + options.getCompilerTargetVM() +
"\n");
}
+ if (options.getCompilerSourceVM() != null) {
+ javac.setSource(options.getCompilerSourceVM());
+ info.append(" compilerSourceVM=" + options.getCompilerSourceVM() +
"\n");
+ }
+
// Build includes path
PatternSet.NameEntry includes = javac.createInclude();
--- EmbeddedServletOptions.java-5.0.29 2004-10-19 09:57:12.000000000 -0500
+++ EmbeddedServletOptions.java 2004-10-19 09:57:06.000000000 -0500
@@ -144,6 +144,11 @@
private String compilerTargetVM = "1.3";
/**
+ * The compiler source VM ("1.3" by default).
+ */
+ private String compilerSourceVM = "1.3";
+
+ /**
* Cache for the TLD locations
*/
private TldLocationsCache tldLocationsCache = null;
@@ -303,6 +308,14 @@
return compilerTargetVM;
}
+ /**
+ * @see Options#getCompilerSourceVM
+ */
+ public String getCompilerSourceVM()
+ {
+ return compilerSourceVM;
+ }
+
public boolean getErrorOnUseBeanInvalidClassAttribute() {
return errorOnUseBeanInvalidClassAttribute;
}
@@ -571,6 +584,11 @@
this.compilerTargetVM = compilerTargetVM;
}
+ String compilerSourceVM = config.getInitParameter("compilerSourceVM");
+ if(compilerSourceVM != null) {
+ this.compilerSourceVM = compilerSourceVM;
+ }
+
String javaEncoding = config.getInitParameter("javaEncoding");
if (javaEncoding != null) {
this.javaEncoding = javaEncoding;
--- JspC.java-5.0.29 2004-10-19 09:57:10.000000000 -0500
+++ JspC.java 2004-10-19 09:57:02.000000000 -0500
@@ -98,6 +98,8 @@
private static final String SWITCH_CLASS_NAME = "-c";
private static final String SWITCH_FULL_STOP = "--";
private static final String SWITCH_COMPILE = "-compile";
+ private static final String SWITCH_SOURCE = "-source";
+ private static final String SWITCH_TARGET = "-target";
private static final String SWITCH_URI_BASE = "-uribase";
private static final String SWITCH_URI_ROOT = "-uriroot";
private static final String SWITCH_FILE_WEBAPP = "-webapp";
@@ -145,6 +147,7 @@
private String compiler = null;
private String compilerTargetVM = "1.3";
+ private String compilerSourceVM = "1.3";
private boolean classDebugInfo = true;
private Vector extensions;
@@ -276,6 +279,10 @@
}
} else if (tok.equals(SWITCH_ENCODING)) {
setJavaEncoding(nextArg());
+ } else if (tok.equals(SWITCH_SOURCE)) {
+ setCompilerSourceVM(nextArg());
+ } else if (tok.equals(SWITCH_TARGET)) {
+ setCompilerTargetVM(nextArg());
} else {
if (tok.startsWith("-")) {
throw new JasperException("Unrecognized option: " + tok +
@@ -479,6 +486,22 @@
compilerTargetVM = vm;
}
+ /**
+ * @see Options#getCompilerSourceVM.
+ */
+ public String getCompilerSourceVM()
+ {
+ return compilerSourceVM;
+ }
+
+ /**
+ * @see Options#getCompilerSourceVM.
+ */
+ public void setCompilerSourceVM( String vm )
+ {
+ compilerSourceVM = vm;
+ }
+
public TldLocationsCache getTldLocationsCache() {
return tldLocationsCache;
}
@@ -1156,5 +1179,4 @@
// pass straight through
}
}
-
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]