You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by an...@apache.org on 2007/07/10 23:45:11 UTC

svn commit: r555089 - in /cocoon/branches/BRANCH_2_1_X: ./ lib/ lib/core/ src/blocks/xsp/conf/ src/blocks/xsp/java/org/apache/cocoon/components/language/programming/java/ src/blocks/xsp/samples/ src/blocks/xsp/samples/java/

Author: anathaniel
Date: Tue Jul 10 14:45:10 2007
New Revision: 555089

URL: http://svn.apache.org/viewvc?view=rev&rev=555089
Log:
XSP block: Upgrade Eclipse compiler to version 3.1.0 to allow the use of Java5 syntax in XSPs.

Added:
    cocoon/branches/BRANCH_2_1_X/lib/core/jdtcore-3.1.0.jar   (with props)
    cocoon/branches/BRANCH_2_1_X/src/blocks/xsp/samples/java/java5.xsp
Removed:
    cocoon/branches/BRANCH_2_1_X/lib/core/jdtcore-3.0.2.jar
Modified:
    cocoon/branches/BRANCH_2_1_X/lib/jars.xml
    cocoon/branches/BRANCH_2_1_X/src/blocks/xsp/conf/xsp-program-language.xconf
    cocoon/branches/BRANCH_2_1_X/src/blocks/xsp/java/org/apache/cocoon/components/language/programming/java/EclipseJavaCompiler.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/xsp/samples/samples.xml
    cocoon/branches/BRANCH_2_1_X/status.xml

Added: cocoon/branches/BRANCH_2_1_X/lib/core/jdtcore-3.1.0.jar
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/lib/core/jdtcore-3.1.0.jar?view=auto&rev=555089
==============================================================================
Binary file - no diff available.

Propchange: cocoon/branches/BRANCH_2_1_X/lib/core/jdtcore-3.1.0.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: cocoon/branches/BRANCH_2_1_X/lib/jars.xml
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/lib/jars.xml?view=diff&rev=555089&r1=555088&r2=555089
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/lib/jars.xml (original)
+++ cocoon/branches/BRANCH_2_1_X/lib/jars.xml Tue Jul 10 14:45:10 2007
@@ -671,7 +671,7 @@
     <title>Eclipse Java Development Tools Core</title>
     <description>Eclipse Java Compiler</description>
     <used-by>XSP</used-by>
-    <lib>core/jdtcore-3.0.2.jar</lib>
+    <lib>core/jdtcore-3.1.0.jar</lib>
     <homepage>http://www.eclipse.org/jdt/</homepage>
   </file>
 

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/xsp/conf/xsp-program-language.xconf
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/xsp/conf/xsp-program-language.xconf?view=diff&rev=555089&r1=555088&r2=555089
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/xsp/conf/xsp-program-language.xconf (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/xsp/conf/xsp-program-language.xconf Tue Jul 10 14:45:10 2007
@@ -34,12 +34,12 @@
       <!--+
           | Specifies which Java compiler to use. Possible variants are:
           |
-          |  - EclipseJavaCompiler: the Eclipse JTD java compiler
+          |  - EclipseJavaCompiler: the Eclipse JDT java compiler
           |  - Javac: the java compiler that comes with JDK
           |  - Jikes: the Jikes java compiler
           |  - Pizza: the Pizza java compiler (deprecated. Support will be removed in 2.2)
           |
-          | NOTE: the Eclipse JTD is the only java compiler that is capable
+          | NOTE: the Eclipse JDT is the only java compiler that is capable
           |       of imports classes thru the context classloader. All other
           |       compilers import classes from the JVM classpath and might
           |       normally result in ClassNotFound problems at compilation
@@ -61,8 +61,7 @@
           | auto = The version of the JVM where cocoon is running. (Default value).
           |
           | NOTE: The parameter is optional to keep backward compatibility.
-          |       The parameter currently works only with Sun Javac compiler.
-          |       The eclipse compiler version 3.0.1 currently does not support java 1.5.
+          |       The parameter works with Sun Javac compiler and the Eclipse compiler.
           |       The pizza compiler does not support java 1.5.
           +-->
       <!-- <parameter name="compiler-compliance-level" value="auto"/> -->

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/xsp/java/org/apache/cocoon/components/language/programming/java/EclipseJavaCompiler.java
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/xsp/java/org/apache/cocoon/components/language/programming/java/EclipseJavaCompiler.java?view=diff&rev=555089&r1=555088&r2=555089
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/xsp/java/org/apache/cocoon/components/language/programming/java/EclipseJavaCompiler.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/xsp/java/org/apache/cocoon/components/language/programming/java/EclipseJavaCompiler.java Tue Jul 10 14:45:10 2007
@@ -57,7 +57,7 @@
 /**
  * Eclipse Java Compiler
  *
- * @version CVS $Id$
+ * @version $Id$
  */
 public class EclipseJavaCompiler implements LanguageCompiler, Recyclable {
 
@@ -251,7 +251,7 @@
                             ICompilationUnit compilationUnit = 
                                 new CompilationUnit(sourceFile, className);
                             return 
-                                new NameEnvironmentAnswer(compilationUnit);
+                                new NameEnvironmentAnswer(compilationUnit, null);
                         }
                         String resourceName = 
                             className.replace('.', '/') + ".class";
@@ -273,7 +273,7 @@
                                 new ClassFileReader(classBytes, fileName, 
                                                     true);
                             return 
-                                new NameEnvironmentAnswer(classFileReader);
+                                new NameEnvironmentAnswer(classFileReader, null);
                         }
                     } catch (IOException exc) {
                         handleError(className, -1, -1, 

Added: cocoon/branches/BRANCH_2_1_X/src/blocks/xsp/samples/java/java5.xsp
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/xsp/samples/java/java5.xsp?view=auto&rev=555089
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/xsp/samples/java/java5.xsp (added)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/xsp/samples/java/java5.xsp Tue Jul 10 14:45:10 2007
@@ -0,0 +1,38 @@
+<?xml version="1.0"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  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.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!-- CVS $Id: hello.xsp 433543 2006-08-22 06:22:54Z crossley $ -->
+
+<xsp:page language="java"
+          xmlns:xsp="http://apache.org/xsp">
+
+  <page>
+    <title>Java5</title>
+    <content>
+      <para>
+        <xsp:logic>
+          String text = "XSP allows to use Java5 syntax, if running under a 1.5+ JVM.";
+          for ( String word : text.split(" ") ) {
+            <span><xsp:expr>word+" "</xsp:expr></span>
+          }
+        </xsp:logic>
+      </para>
+    </content>
+  </page>
+
+</xsp:page>

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/xsp/samples/samples.xml
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/xsp/samples/samples.xml?view=diff&rev=555089&r1=555088&r2=555089
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/xsp/samples/samples.xml (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/xsp/samples/samples.xml Tue Jul 10 14:45:10 2007
@@ -77,6 +77,9 @@
    <sample name="Zipping" href="java/zipping.zip" xlink:role="dynamic">
     On-the-fly zipping of filtered files.
    </sample>
+   <sample name="Java5" href="java/java5" xlink:role="dynamic">
+    Java5 syntax allowed, if running under a 1.5+ JVM.
+   </sample>
   </group>
 
   <group name="eXtensible Server Pages in Javascript">

Modified: cocoon/branches/BRANCH_2_1_X/status.xml
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/status.xml?view=diff&rev=555089&r1=555088&r2=555089
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/status.xml (original)
+++ cocoon/branches/BRANCH_2_1_X/status.xml Tue Jul 10 14:45:10 2007
@@ -182,6 +182,11 @@
 
   <changes>
   <release version="2.1.11" date="TBD">
+    <action dev="AN" type="update">
+      XSP block: Upgrade Eclipse compiler to version 3.1.0 to allow the use of Java5 syntax in XSPs.
+      (Latest released Eclipse version is 3.2.2 but use 3.1.0 to be consistent with the version
+      picked up by the Maven build in trunk.)
+    </action>
     <action dev="JH" type="fix" fixes-bug="COCOON-2077" due-to="Ellis Pritchard">
       Core, QDox: Fixed getInputStream() in XModuleSource and QDoxSource:
       Set up XMLSerializer in a component way, i.e. retrieve it from ServiceManager.