cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 33189] New: - Does not compile under Java 1.5 because enum is a keyword
Date Fri, 21 Jan 2005 05:14:52 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=33189>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33189

           Summary: Does not compile under Java 1.5 because enum is a
                    keyword
           Product: Cocoon 2
           Version: 2.1.6
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Keywords: JDK1.5
          Severity: normal
          Priority: P2
         Component: core
        AssignedTo: dev@cocoon.apache.org
        ReportedBy: wchao@yahoo.com


In addition to the enum problem, the source.vm and target.vm are not dynamically
set properly for Java 1.5. Applying the following diffs to the source code
allows Cocoon to compile under Java 1.5:

---
../cocoon-2.1.6-original/src/java/org/apache/cocoon/components/modules/input/DateMetaInputModule.java
      Fri Nov 19 03:51:37 2004
+++ src/java/org/apache/cocoon/components/modules/input/DateMetaInputModule.java
       Thu Jan 20 22:11:11 2005
@@ -133,10 +133,10 @@

         // done reading configuration
         // setup modules and read values
-        Iterator enum = getNames(objectModel,
+        Iterator enumeration = getNames(objectModel,
                                  this.input, this.defaultInput, inputConfig,
                                  null, inputName, mConf);
-        return enum;
+        return enumeration;
      }

---
../cocoon-2.1.6-original/src/java/org/apache/cocoon/components/modules/input/IteratorHelper.java
   Fri Nov 19 03:52:22 2004
+++ src/java/org/apache/cocoon/components/modules/input/IteratorHelper.java    
Thu Jan 20 22:11:37 2005
@@ -24,10 +24,10 @@
  * @version CVS $Id: IteratorHelper.java 30932 2004-07-29 17:35:38Z vgritsenko $
  */
 class IteratorHelper implements Iterator {
-    Enumeration enum = null;
-    public IteratorHelper( Enumeration e ) { this.enum = e; }
-    public boolean hasNext() { return this.enum.hasMoreElements(); }
-    public Object next() { return this.enum.nextElement(); }
+    Enumeration enumeration = null;
+    public IteratorHelper( Enumeration e ) { this.enumeration = e; }
+    public boolean hasNext() { return this.enumeration.hasMoreElements(); }
+    public Object next() { return this.enumeration.nextElement(); }
     /** ignored */
     public void remove() {}
 }

---
../cocoon-2.1.6-original/src/java/org/apache/cocoon/components/xpointer/parser/XPointerFrameworkParser.java
Fri Nov 19 03:53:18 2004
+++
src/java/org/apache/cocoon/components/xpointer/parser/XPointerFrameworkParser.java
 Thu Jan 20 22:12:05 2005
@@ -506,10 +506,10 @@
                 jj_expentry[i] = jj_lasttokens[i];
             }
             boolean exists = false;
-            for (java.util.Enumeration enum = jj_expentries.elements();
-                enum.hasMoreElements();
+            for (java.util.Enumeration enumeration = jj_expentries.elements();
+                enumeration.hasMoreElements();
                 ) {
-                int[] oldentry = (int[]) (enum.nextElement());
+                int[] oldentry = (int[]) (enumeration.nextElement());
                 if (oldentry.length == jj_expentry.length) {
                     exists = true;
                     for (int i = 0; i < jj_expentry.length; i++) {

---
../cocoon-2.1.6-original/src/java/org/apache/cocoon/generation/StatusGenerator.java
Fri Nov 19 03:52:52 2004
+++ src/java/org/apache/cocoon/generation/StatusGenerator.java  Thu Jan 20
22:10:44 2005
@@ -271,11 +271,11 @@
             atts.clear();
             atts.addAttribute(namespace, "name", "name", "CDATA", "cached");
             ch.startElement(namespace, "value", "value", atts);
-            Enumeration enum = this.store_persistent.keys();
-            while (enum.hasMoreElements()) {
+            Enumeration enumeration = this.store_persistent.keys();
+            while (enumeration.hasMoreElements()) {
                 size++;

-                Object key  = enum.nextElement();
+                Object key  = enumeration.nextElement();
                 Object val  = store_persistent.get (key);
                 String line = null;
                 if (val == null) {

---
../cocoon-2.1.6-original/src/java/org/apache/cocoon/util/EnumerationFactory.java
   Fri Nov 19 03:52:57 2004
+++ src/java/org/apache/cocoon/util/EnumerationFactory.java     Thu Jan 20
22:09:40 2005
@@ -135,17 +135,17 @@
    * Object op OtherObject.
    * @param enum the right operand
    */
-  public boolean lt (EnumerationFactory enum) {                   // "<"
-    return this.getPos() < enum.getPos ();
+  public boolean lt (EnumerationFactory enumeration) {                   // "<"
+    return this.getPos() < enumeration.getPos ();
   }
-  public boolean le (EnumerationFactory enum) {                   // "<="
-    return this.getPos() <= enum.getPos ();
+  public boolean le (EnumerationFactory enumeration) {                   // "<="
+    return this.getPos() <= enumeration.getPos ();
   }
-  public boolean gt (EnumerationFactory enum) {                   // ">"
-    return this.getPos() > enum.getPos ();
+  public boolean gt (EnumerationFactory enumeration) {                   // ">"
+    return this.getPos() > enumeration.getPos ();
   }
-  public boolean ge (EnumerationFactory enum) {                   // ">="
-    return this.getPos() >= enum.getPos ();
+  public boolean ge (EnumerationFactory enumeration) {                   // ">="
+    return this.getPos() >= enumeration.getPos ();
   }

   // "==" and "equals" are inherited.

--- ../cocoon-2.1.6-original/tools/targets/init-build.xml       Fri Nov 19
03:48:22 2004
+++ tools/targets/init-build.xml        Thu Jan 20 23:52:59 2005
@@ -29,6 +29,20 @@
     <property file="src/java/org/apache/cocoon/cocoon.properties"/>

     <!-- Detecting the current jvm -->
+    <condition property="source.vm" value="1.5">
+      <equals arg1="1.5" arg2="${ant.java.version}"/>
+    </condition>
+    <condition property="source.vm" value="1.4">
+      <equals arg1="1.4" arg2="${ant.java.version}"/>
+    </condition>
+    <condition property="source.vm" value="1.3">
+      <not>
+        <or>
+          <equals arg1="1.4" arg2="${ant.java.version}"/>
+          <equals arg1="1.5" arg2="${ant.java.version}"/>
+        </or>
+      </not>
+    </condition>
     <condition property="target.vm" value="1.5">
       <equals arg1="1.5" arg2="${ant.java.version}"/>
     </condition>
@@ -153,7 +167,7 @@
            debug="off"
            optimize="on"
            deprecation="on"
-           target="1.3"
+           target="${target.vm}"
            nowarn="on"
            compiler="${compiler}"
            classpathref="tasks.classpath"/>
@@ -179,7 +193,7 @@
            debug="off"
            optimize="on"
            deprecation="on"
-           target="1.3"
+           target="${target.vm}"
            nowarn="on"
            compiler="${compiler}"/>

--- ../cocoon-2.1.6-original/build.properties   Fri Nov 19 03:53:52 2004
+++ build.properties    Thu Jan 20 23:52:16 2005
@@ -122,8 +122,6 @@
 compiler.optimize=on
 compiler.deprecation=off
 compiler.nowarn=on
-source.vm=1.3
-

 # ------ System Properties -----------------------------------------------------

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

Mime
View raw message