diff --git a/blocks/cocoon-xsp/cocoon-xsp-impl/pom.xml b/blocks/cocoon-xsp/cocoon-xsp-impl/pom.xml index 285c927e69c..d3b3c6ea960 100644 --- a/blocks/cocoon-xsp/cocoon-xsp-impl/pom.xml +++ b/blocks/cocoon-xsp/cocoon-xsp-impl/pom.xml @@ -47,8 +47,8 @@ provided - eclipse - jdtcore + org.eclipse.jdt + org.eclipse.jdt.core commons-httpclient diff --git a/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/language/markup/xsp/XSPExpressionParser.java b/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/language/markup/xsp/XSPExpressionParser.java index fec0cb9aa16..f9572accd98 100644 --- a/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/language/markup/xsp/XSPExpressionParser.java +++ b/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/language/markup/xsp/XSPExpressionParser.java @@ -216,7 +216,7 @@ public void consume(XSPExpressionParser parser, char ch) throws SAXException { parser.setState(EXPRESSION_CHAR_STATE); break; - case '�': + case '´': parser.append(ch); parser.setState(EXPRESSION_SHELL_STATE); break; diff --git a/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/language/programming/java/EclipseJavaCompiler.java b/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/language/programming/java/EclipseJavaCompiler.java index 5bdb0972a93..88e1aac6e0d 100644 --- a/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/language/programming/java/EclipseJavaCompiler.java +++ b/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/java/org/apache/cocoon/components/language/programming/java/EclipseJavaCompiler.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -64,7 +64,7 @@ public class EclipseJavaCompiler implements LanguageCompiler, Recyclable { boolean debug; String sourceDir; - String sourceFile; + String sourceFile; String destDir; String sourceEncoding; int compilerComplianceLevel; @@ -99,15 +99,15 @@ public void setDestination(String destDir) { } public void setEncoding(String encoding) { - this.sourceEncoding = encoding; + this.sourceEncoding = encoding; } - + /** * Set the version of the java source code to be compiled * * @param compilerComplianceLevel The version of the JVM for which the code was written. * i.e: 130 = Java 1.3, 140 = Java 1.4 and 150 = Java 1.5 - * + * * @since 2.1.7 */ public void setCompilerComplianceLevel(int compilerComplianceLevel) { @@ -132,7 +132,7 @@ private String makeClassName(String fileName) throws IOException { String str = fileName; str = str.replace('\\', '/'); if (sourceDir != null) { - String prefix = + String prefix = new File(sourceDir).getCanonicalPath().replace('\\', '/'); if (canonical != null) { if (canonical.startsWith(prefix)) { @@ -175,7 +175,7 @@ class CompilationUnit implements ICompilationUnit { public char[] getFileName() { return className.toCharArray(); } - + public char[] getContents() { char[] result = null; FileReader fr = null; @@ -201,7 +201,7 @@ public char[] getContents() { } return result; } - + public char[] getMainTypeName() { int dot = className.lastIndexOf('.'); if (dot > 0) { @@ -209,7 +209,7 @@ public char[] getMainTypeName() { } return className.toCharArray(); } - + public char[][] getPackageName() { StringTokenizer izer = new StringTokenizer(className, "."); char[][] result = new char[izer.countTokens()-1][]; @@ -247,24 +247,24 @@ public NameEnvironmentAnswer findType(char[] typeName, char[][] packageName) { result.append(typeName); return findType(result.toString()); } - + private NameEnvironmentAnswer findType(String className) { try { if (className.equals(targetClassName)) { - ICompilationUnit compilationUnit = + ICompilationUnit compilationUnit = new CompilationUnit(sourceFile, className); - return + return new NameEnvironmentAnswer(compilationUnit, null); } - String resourceName = + String resourceName = className.replace('.', '/') + ".class"; - InputStream is = + InputStream is = classLoader.getResourceAsStream(resourceName); if (is != null) { byte[] classBytes; byte[] buf = new byte[8192]; - ByteArrayOutputStream baos = + ByteArrayOutputStream baos = new ByteArrayOutputStream(buf.length); int count; while ((count = is.read(buf, 0, buf.length)) > 0) { @@ -273,17 +273,17 @@ private NameEnvironmentAnswer findType(String className) { baos.flush(); classBytes = baos.toByteArray(); char[] fileName = className.toCharArray(); - ClassFileReader classFileReader = - new ClassFileReader(classBytes, fileName, + ClassFileReader classFileReader = + new ClassFileReader(classBytes, fileName, true); - return + return new NameEnvironmentAnswer(classFileReader, null); } } catch (IOException exc) { - handleError(className, -1, -1, + handleError(className, -1, -1, exc.getMessage()); } catch (org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException exc) { - handleError(className, -1, -1, + handleError(className, -1, -1, exc.getMessage()); } return null; @@ -294,7 +294,7 @@ private boolean isPackage(String result) { return false; } String resourceName = result.replace('.', '/') + ".class"; - InputStream is = + InputStream is = classLoader.getResourceAsStream(resourceName); return is == null; } @@ -322,7 +322,7 @@ public void cleanup() { // EMPTY } }; - final IErrorHandlingPolicy policy = + final IErrorHandlingPolicy policy = DefaultErrorHandlingPolicies.proceedWithAllProblems(); final Map settings = new HashMap(9); settings.put(CompilerOptions.OPTION_LineNumberAttribute, @@ -340,6 +340,18 @@ public void cleanup() { } // Set the sourceCodeVersion switch (this.compilerComplianceLevel) { + case 180: + settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_8); + settings.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_8); + break; + case 170: + settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7); + settings.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7); + break; + case 160: + settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_6); + settings.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_6); + break; case 150: settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5); settings.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5); @@ -352,6 +364,15 @@ public void cleanup() { } // Set the target platform switch (SystemUtils.JAVA_VERSION_INT) { + case 180: + settings.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_8); + break; + case 170: + settings.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7); + break; + case 160: + settings.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_6); + break; case 150: settings.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5); break; @@ -361,7 +382,7 @@ public void cleanup() { default: settings.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_3); } - final IProblemFactory problemFactory = + final IProblemFactory problemFactory = new DefaultProblemFactory(Locale.getDefault()); final ICompilerRequestor requestor = new ICompilerRequestor() { @@ -387,7 +408,7 @@ public void acceptResult(CompilationResult result) { className.append(compoundName[j]); } byte[] bytes = classFile.getBytes(); - String outFile = destDir + "/" + + String outFile = destDir + "/" + className.toString().replace('.', '/') + ".class"; FileOutputStream fout = new FileOutputStream(outFile); BufferedOutputStream bos = new BufferedOutputStream(fout); @@ -400,7 +421,7 @@ public void acceptResult(CompilationResult result) { } } }; - ICompilationUnit[] compilationUnits = + ICompilationUnit[] compilationUnits = new ICompilationUnit[classNames.length]; for (int i = 0; i < compilationUnits.length; i++) { String className = classNames[i]; @@ -416,7 +437,7 @@ public void acceptResult(CompilationResult result) { } void handleError(String className, int line, int column, Object errorMessage) { - String fileName = + String fileName = className.replace('.', File.separatorChar) + ".java"; if (column < 0) column = 0; errors.add(new CompilerError(fileName, diff --git a/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/resources/org/apache/cocoon/components/language/markup/xsp/java/esql.xsl b/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/resources/org/apache/cocoon/components/language/markup/xsp/java/esql.xsl index 1f7e20fb50f..efe98452b7f 100644 --- a/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/resources/org/apache/cocoon/components/language/markup/xsp/java/esql.xsl +++ b/blocks/cocoon-xsp/cocoon-xsp-impl/src/main/resources/org/apache/cocoon/components/language/markup/xsp/java/esql.xsl @@ -248,7 +248,6 @@ Parameter '' missing in dynamic tag < try { _esql_connection = new Cocoon2EsqlConnection( (DataSourceComponent) _esql_get_selector().select(String.valueOf()) ); - setupLogger(_esql_connection); _esql_connection.setMultipleResults(String.valueOf()); @@ -268,7 +267,6 @@ Parameter '' missing in dynamic tag < try { _esql_connection = new Cocoon2EsqlConnection(); - setupLogger(_esql_connection); _esql_connection.setURL(String.valueOf()); diff --git a/parent/pom.xml b/parent/pom.xml index a1930200ad2..6d6dee96f9a 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -360,7 +360,7 @@ http://www.apache.org ASF member - PMC chair + PMC chair PMC member Committer @@ -506,7 +506,7 @@ Emeritus PMC Member Emeritus Committer - + +1 @@ -1751,9 +1751,9 @@ 1.1 - eclipse - jdtcore - 3.1.0 + org.eclipse.jdt + org.eclipse.jdt.core + 3.26.0 net.sourceforge.jena @@ -1970,22 +1970,22 @@ org.springframework spring-context-support ${spring.version} - + org.springframework spring-core ${spring.version} - + org.springframework spring-jdbc ${spring.version} - + org.springframework spring-jms ${spring.version} - + org.springframework spring-test @@ -2001,7 +2001,7 @@ org.springframework spring-tx ${spring.version} - + stax stax-api @@ -2233,7 +2233,7 @@ org.apache.cocoon cocoon-block-deployment 1.1.0 - + org.apache.cocoon cocoon-blocks-fw-demo1 @@ -2773,7 +2773,7 @@ org.apache.cocoon cocoon-servlet-service-components-sample 1.0.0-SNAPSHOT - + org.apache.cocoon cocoon-servlet-service-impl @@ -3056,12 +3056,12 @@ src/site/** - + org.apache.cocoon cocoon-it-fw 1.0.0-M1 - + @@ -3237,7 +3237,7 @@ ${docs.m.site-configuration.relPath}configuration-api/ ${docs.m.site-configuration.relPath}spring-configurator/ subprojects/jnet/ - subprojects/block-deployment/ + subprojects/block-deployment/ 1.0 2.2/blocks/ajax/${docs.m.ajax.version}/ @@ -3329,7 +3329,7 @@ - +