diff --git a/tomcat-7.0.104-RemoveCompilerOptions.patch b/tomcat-7.0.104-RemoveCompilerOptions.patch new file mode 100644 index 0000000..d90a5a6 --- /dev/null +++ b/tomcat-7.0.104-RemoveCompilerOptions.patch @@ -0,0 +1,186 @@ +diff --git a/java/org/apache/jasper/compiler/JDTCompiler.java b/java/org/apache/jasper/compiler/JDTCompiler.java +index 2836724..5d5c44b 100644 +--- a/java/org/apache/jasper/compiler/JDTCompiler.java ++++ b/java/org/apache/jasper/compiler/JDTCompiler.java +@@ -95,7 +95,6 @@ public class JDTCompiler extends org.apache.jasper.compiler.Compiler { + /** + * Compile the servlet from .java file to .class file + */ +- @Override + protected void generateClass(String[] smap) throws FileNotFoundException, JasperException, Exception { + + long t1 = 0; +@@ -122,12 +121,10 @@ public class JDTCompiler extends org.apache.jasper.compiler.Compiler { + this.sourceFile = sourceFile; + } + +- @Override + public char[] getFileName() { + return sourceFile.toCharArray(); + } + +- @Override + public char[] getContents() { + char[] result = null; + FileInputStream is = null; +@@ -167,7 +164,6 @@ public class JDTCompiler extends org.apache.jasper.compiler.Compiler { + return result; + } + +- @Override + public char[] getMainTypeName() { + int dot = className.lastIndexOf('.'); + if (dot > 0) { +@@ -176,7 +172,6 @@ public class JDTCompiler extends org.apache.jasper.compiler.Compiler { + return className.toCharArray(); + } + +- @Override + public char[][] getPackageName() { + StringTokenizer izer = new StringTokenizer(className, "."); + char[][] result = new char[izer.countTokens()-1][]; +@@ -187,7 +182,6 @@ public class JDTCompiler extends org.apache.jasper.compiler.Compiler { + return result; + } + +- @Override + public boolean ignoreOptionalProblems() { + return false; + } +@@ -195,7 +189,6 @@ public class JDTCompiler extends org.apache.jasper.compiler.Compiler { + + final INameEnvironment env = new INameEnvironment() { + +- @Override + public NameEnvironmentAnswer + findType(char[][] compoundTypeName) { + StringBuilder result = new StringBuilder(); +@@ -208,7 +201,6 @@ public class JDTCompiler extends org.apache.jasper.compiler.Compiler { + return findType(result.toString()); + } + +- @Override + public NameEnvironmentAnswer findType(char[] typeName, char[][] packageName) { + StringBuilder result = new StringBuilder(); + String sep = ""; +@@ -281,7 +273,6 @@ public class JDTCompiler extends org.apache.jasper.compiler.Compiler { + } + } + +- @Override + public boolean isPackage(char[][] parentPackageName, char[] packageName) { + StringBuilder result = new StringBuilder(); + String sep = ""; +@@ -302,7 +293,6 @@ public class JDTCompiler extends org.apache.jasper.compiler.Compiler { + return isPackage(result.toString()); + } + +- @Override + public void cleanup() { + } + +@@ -350,43 +340,6 @@ public class JDTCompiler extends org.apache.jasper.compiler.Compiler { + } else if(opt.equals("1.7")) { + settings.put(CompilerOptions.OPTION_Source, + CompilerOptions.VERSION_1_7); +- } else if(opt.equals("1.8")) { +- settings.put(CompilerOptions.OPTION_Source, +- CompilerOptions.VERSION_1_8); +- // Support old format that was used in EA implementation as well +- } else if(opt.equals("9") || opt.equals("1.9")) { +- settings.put(CompilerOptions.OPTION_Source, +- JDT_JAVA_9_VERSION); +- } else if(opt.equals("10")) { +- // Constant not available in latest ECJ version that runs on +- // Java 6. +- // This is checked against the actual version below. +- settings.put(CompilerOptions.OPTION_Source, "10"); +- } else if(opt.equals("11")) { +- // Constant not available in latest ECJ version that runs on +- // Java 6. +- // This is checked against the actual version below. +- settings.put(CompilerOptions.OPTION_Source, "11"); +- } else if(opt.equals("12")) { +- // Constant not available in latest ECJ version that runs on +- // Java 6. +- // This is checked against the actual version below. +- settings.put(CompilerOptions.OPTION_Source, "12"); +- } else if(opt.equals("13")) { +- // Constant not available in latest available ECJ version. +- // May be supported in a snapshot build. +- // This is checked against the actual version below. +- settings.put(CompilerOptions.OPTION_Source, "13"); +- } else if(opt.equals("14")) { +- // Constant not available in latest available ECJ version. +- // May be supported in a snapshot build. +- // This is checked against the actual version below. +- settings.put(CompilerOptions.OPTION_Source, "14"); +- } else if(opt.equals("15")) { +- // Constant not available in latest available ECJ version. +- // May be supported in a snapshot build. +- // This is checked against the actual version below. +- settings.put(CompilerOptions.OPTION_Source, "15"); + } else { + log.warn(Localizer.getMessage("jsp.warning.unknown.sourceVM", opt)); + settings.put(CompilerOptions.OPTION_Source, +@@ -428,52 +381,6 @@ public class JDTCompiler extends org.apache.jasper.compiler.Compiler { + CompilerOptions.VERSION_1_7); + settings.put(CompilerOptions.OPTION_Compliance, + CompilerOptions.VERSION_1_7); +- } else if(opt.equals("1.8")) { +- settings.put(CompilerOptions.OPTION_TargetPlatform, +- CompilerOptions.VERSION_1_8); +- settings.put(CompilerOptions.OPTION_Compliance, +- CompilerOptions.VERSION_1_8); +- } else if(opt.equals("9") || opt.equals("1.9")) { +- settings.put(CompilerOptions.OPTION_TargetPlatform, +- JDT_JAVA_9_VERSION); +- settings.put(CompilerOptions.OPTION_Compliance, +- JDT_JAVA_9_VERSION); +- } else if(opt.equals("10")) { +- // Constant not available in latest ECJ version that runs on +- // Java 6. +- // This is checked against the actual version below. +- settings.put(CompilerOptions.OPTION_TargetPlatform, "10"); +- settings.put(CompilerOptions.OPTION_Compliance, "10"); +- } else if(opt.equals("11")) { +- // Constant not available in latest ECJ version that runs on +- // Java 6. +- // This is checked against the actual version below. +- settings.put(CompilerOptions.OPTION_TargetPlatform, "11"); +- settings.put(CompilerOptions.OPTION_Compliance, "11"); +- } else if(opt.equals("12")) { +- // Constant not available in latest ECJ version that runs on +- // Java 6. +- // This is checked against the actual version below. +- settings.put(CompilerOptions.OPTION_TargetPlatform, "12"); +- settings.put(CompilerOptions.OPTION_Compliance, "12"); +- } else if(opt.equals("13")) { +- // Constant not available in latest available ECJ version. +- // May be supported in a snapshot build. +- // This is checked against the actual version below. +- settings.put(CompilerOptions.OPTION_TargetPlatform, "13"); +- settings.put(CompilerOptions.OPTION_Compliance, "13"); +- } else if(opt.equals("14")) { +- // Constant not available in latest ECJ version shipped with +- // Tomcat. May be supported in a snapshot build. +- // This is checked against the actual version below. +- settings.put(CompilerOptions.OPTION_TargetPlatform, "14"); +- settings.put(CompilerOptions.OPTION_Compliance, "14"); +- } else if(opt.equals("15")) { +- // Constant not available in latest ECJ version shipped with +- // Tomcat. May be supported in a snapshot build. +- // This is checked against the actual version below. +- settings.put(CompilerOptions.OPTION_TargetPlatform, "15"); +- settings.put(CompilerOptions.OPTION_Compliance, "15"); + } else { + log.warn(Localizer.getMessage("jsp.warning.unknown.targetVM", opt)); + settings.put(CompilerOptions.OPTION_TargetPlatform, +@@ -491,7 +398,6 @@ public class JDTCompiler extends org.apache.jasper.compiler.Compiler { + new DefaultProblemFactory(Locale.getDefault()); + + final ICompilerRequestor requestor = new ICompilerRequestor() { +- @Override + public void acceptResult(CompilationResult result) { + try { + if (result.hasProblems()) { diff --git a/tomcat-7.0.94-RemoveCompilerOptions.patch b/tomcat-7.0.94-RemoveCompilerOptions.patch deleted file mode 100644 index ea4d12f..0000000 --- a/tomcat-7.0.94-RemoveCompilerOptions.patch +++ /dev/null @@ -1,162 +0,0 @@ ---- java/org/apache/jasper/compiler/JDTCompiler.java.orig 2019-06-18 10:38:02.381894455 -0400 -+++ java/org/apache/jasper/compiler/JDTCompiler.java 2019-06-18 10:39:28.932684377 -0400 -@@ -95,7 +95,6 @@ public class JDTCompiler extends org.apa - /** - * Compile the servlet from .java file to .class file - */ -- @Override - protected void generateClass(String[] smap) - throws FileNotFoundException, JasperException, Exception { - -@@ -126,12 +125,10 @@ public class JDTCompiler extends org.apa - this.sourceFile = sourceFile; - } - -- @Override - public char[] getFileName() { - return sourceFile.toCharArray(); - } - -- @Override - public char[] getContents() { - char[] result = null; - FileInputStream is = null; -@@ -173,7 +170,6 @@ public class JDTCompiler extends org.apa - return result; - } - -- @Override - public char[] getMainTypeName() { - int dot = className.lastIndexOf('.'); - if (dot > 0) { -@@ -182,7 +178,6 @@ public class JDTCompiler extends org.apa - return className.toCharArray(); - } - -- @Override - public char[][] getPackageName() { - StringTokenizer izer = - new StringTokenizer(className, "."); -@@ -194,7 +189,6 @@ public class JDTCompiler extends org.apa - return result; - } - -- @Override - public boolean ignoreOptionalProblems() { - return false; - } -@@ -202,7 +196,6 @@ public class JDTCompiler extends org.apa - - final INameEnvironment env = new INameEnvironment() { - -- @Override - public NameEnvironmentAnswer - findType(char[][] compoundTypeName) { - StringBuilder result = new StringBuilder(); -@@ -215,7 +208,6 @@ public class JDTCompiler extends org.apa - return findType(result.toString()); - } - -- @Override - public NameEnvironmentAnswer - findType(char[] typeName, - char[][] packageName) { -@@ -297,7 +289,6 @@ public class JDTCompiler extends org.apa - } - } - -- @Override - public boolean isPackage(char[][] parentPackageName, - char[] packageName) { - StringBuilder result = new StringBuilder(); -@@ -319,7 +310,6 @@ public class JDTCompiler extends org.apa - return isPackage(result.toString()); - } - -- @Override - public void cleanup() { - } - -@@ -368,33 +358,6 @@ public class JDTCompiler extends org.apa - } else if(opt.equals("1.7")) { - settings.put(CompilerOptions.OPTION_Source, - CompilerOptions.VERSION_1_7); -- } else if(opt.equals("1.8")) { -- settings.put(CompilerOptions.OPTION_Source, -- CompilerOptions.VERSION_1_8); -- // Support old format that was used in EA implementation as well -- } else if(opt.equals("9") || opt.equals("1.9")) { -- settings.put(CompilerOptions.OPTION_Source, -- JDT_JAVA_9_VERSION); -- } else if(opt.equals("10")) { -- // Constant not available in latest ECJ version that runs on -- // Java 6. -- // This is checked against the actual version below. -- settings.put(CompilerOptions.OPTION_Source, "10"); -- } else if(opt.equals("11")) { -- // Constant not available in latest ECJ version that runs on -- // Java 6. -- // This is checked against the actual version below. -- settings.put(CompilerOptions.OPTION_Source, "11"); -- } else if(opt.equals("12")) { -- // Constant not available in latest available ECJ version. -- // May be supported in a snapshot build. -- // This is checked against the actual version below. -- settings.put(CompilerOptions.OPTION_Source, "12"); -- } else if(opt.equals("13")) { -- // Constant not available in latest available ECJ version. -- // May be supported in a snapshot build. -- // This is checked against the actual version below. -- settings.put(CompilerOptions.OPTION_Source, "13"); - } else { - log.warn(Localizer.getMessage("jsp.warning.unknown.sourceVM", opt)); - settings.put(CompilerOptions.OPTION_Source, -@@ -436,40 +399,6 @@ public class JDTCompiler extends org.apa - CompilerOptions.VERSION_1_7); - settings.put(CompilerOptions.OPTION_Compliance, - CompilerOptions.VERSION_1_7); -- } else if(opt.equals("1.8")) { -- settings.put(CompilerOptions.OPTION_TargetPlatform, -- CompilerOptions.VERSION_1_8); -- settings.put(CompilerOptions.OPTION_Compliance, -- CompilerOptions.VERSION_1_8); -- } else if(opt.equals("9") || opt.equals("1.9")) { -- settings.put(CompilerOptions.OPTION_TargetPlatform, -- JDT_JAVA_9_VERSION); -- settings.put(CompilerOptions.OPTION_Compliance, -- JDT_JAVA_9_VERSION); -- } else if(opt.equals("10")) { -- // Constant not available in latest ECJ version that runs on -- // Java 6. -- // This is checked against the actual version below. -- settings.put(CompilerOptions.OPTION_TargetPlatform, "10"); -- settings.put(CompilerOptions.OPTION_Compliance, "10"); -- } else if(opt.equals("11")) { -- // Constant not available in latest ECJ version that runs on -- // Java 6. -- // This is checked against the actual version below. -- settings.put(CompilerOptions.OPTION_TargetPlatform, "11"); -- settings.put(CompilerOptions.OPTION_Compliance, "11"); -- } else if(opt.equals("12")) { -- // Constant not available in latest available ECJ version. -- // May be supported in a snapshot build. -- // This is checked against the actual version below. -- settings.put(CompilerOptions.OPTION_TargetPlatform, "12"); -- settings.put(CompilerOptions.OPTION_Compliance, "12"); -- } else if(opt.equals("13")) { -- // Constant not available in latest available ECJ version. -- // May be supported in a snapshot build. -- // This is checked against the actual version below. -- settings.put(CompilerOptions.OPTION_TargetPlatform, "13"); -- settings.put(CompilerOptions.OPTION_Compliance, "13"); - } else { - log.warn(Localizer.getMessage("jsp.warning.unknown.targetVM", opt)); - settings.put(CompilerOptions.OPTION_TargetPlatform, -@@ -487,7 +416,6 @@ public class JDTCompiler extends org.apa - new DefaultProblemFactory(Locale.getDefault()); - - final ICompilerRequestor requestor = new ICompilerRequestor() { -- @Override - public void acceptResult(CompilationResult result) { - try { - if (result.hasProblems()) { diff --git a/tomcat.spec b/tomcat.spec index 814084f..3ce8a84 100644 --- a/tomcat.spec +++ b/tomcat.spec @@ -81,7 +81,7 @@ Source16: %{name}-%{major_version}.%{minor_version}-jsvc.wrapper Patch0: %{name}-%{major_version}.%{minor_version}-bootstrap-MANIFEST.MF.patch Patch1: %{name}-%{major_version}.%{minor_version}-tomcat-users-webapp.patch # Adding patch to remove java 1.8 compiler options due to outdated ecj version in el6 -Patch2: %{name}-7.0.94-RemoveCompilerOptions.patch +Patch2: %{name}-7.0.104-RemoveCompilerOptions.patch # Adding patch to remove unsupport ant tasks/attributes Patch3: %{name}-7.0.99-build.patch Patch4: %{name}-7.0-catalina-policy.patch