zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ph...@apache.org
Subject svn commit: r1164710 - in /zookeeper/trunk: CHANGES.txt src/java/main/org/apache/jute/compiler/JBuffer.java src/java/main/org/apache/jute/compiler/JRecord.java src/java/main/org/apache/jute/compiler/generated/rcc.jj
Date Fri, 02 Sep 2011 20:53:59 GMT
Author: phunt
Date: Fri Sep  2 20:53:58 2011
New Revision: 1164710

URL: http://svn.apache.org/viewvc?rev=1164710&view=rev
Log:
ZOOKEEPER-1169. Fix compiler (eclipse) warnings in (generated) jute code (Thomas Koch via
phunt)

Modified:
    zookeeper/trunk/CHANGES.txt
    zookeeper/trunk/src/java/main/org/apache/jute/compiler/JBuffer.java
    zookeeper/trunk/src/java/main/org/apache/jute/compiler/JRecord.java
    zookeeper/trunk/src/java/main/org/apache/jute/compiler/generated/rcc.jj

Modified: zookeeper/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/zookeeper/trunk/CHANGES.txt?rev=1164710&r1=1164709&r2=1164710&view=diff
==============================================================================
--- zookeeper/trunk/CHANGES.txt (original)
+++ zookeeper/trunk/CHANGES.txt Fri Sep  2 20:53:58 2011
@@ -405,7 +405,11 @@ IMPROVEMENTS:
   ZOOKEEPER-1034. perl bindings should automatically find the zookeeper
   c-client headers (nicholas harteau via mahadev)
 
-  ZOOKEEPER-1166 Please add a few svn:ignore properties (via phunt)
+  ZOOKEEPER-1166. Please add a few svn:ignore properties (via phunt)
+
+  ZOOKEEPER-1169. Fix compiler (eclipse) warnings in (generated) jute
+  code (Thomas Koch via phunt)
+ 
 
 NEW FEATURES:
   ZOOKEEPER-729. Java client API to recursively delete a subtree.

Modified: zookeeper/trunk/src/java/main/org/apache/jute/compiler/JBuffer.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/main/org/apache/jute/compiler/JBuffer.java?rev=1164710&r1=1164709&r2=1164710&view=diff
==============================================================================
--- zookeeper/trunk/src/java/main/org/apache/jute/compiler/JBuffer.java (original)
+++ zookeeper/trunk/src/java/main/org/apache/jute/compiler/JBuffer.java Fri Sep  2 20:53:58
2011
@@ -76,7 +76,7 @@ public class JBuffer extends JCompType {
     }
     
     public String genJavaHashCode(String fname) {
-        return "    ret = Arrays.toString("+fname+").hashCode();\n";
+        return "    ret = java.util.Arrays.toString("+fname+").hashCode();\n";
     }
     
     public String genJavaSlurpBytes(String b, String s, String l) {

Modified: zookeeper/trunk/src/java/main/org/apache/jute/compiler/JRecord.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/main/org/apache/jute/compiler/JRecord.java?rev=1164710&r1=1164709&r2=1164710&view=diff
==============================================================================
--- zookeeper/trunk/src/java/main/org/apache/jute/compiler/JRecord.java (original)
+++ zookeeper/trunk/src/java/main/org/apache/jute/compiler/JRecord.java Fri Sep  2 20:53:58
2011
@@ -349,7 +349,7 @@ public class JRecord extends JCompType {
 
         cc.write("bool "+getCppFQName()+"::validate() const {\n");
         cc.write("  if (bs_.size() != bs_.count()) return false;\n");
-        for (Iterator i = mFields.iterator(); i.hasNext(); fIdx++) {
+        for (Iterator<JField> i = mFields.iterator(); i.hasNext(); fIdx++) {
             JField jf = (JField) i.next();
             JType type = jf.getType();
             if (type instanceof JRecord) {
@@ -425,7 +425,6 @@ public class JRecord extends JCompType {
         jj.write("*/\n");
         jj.write("\n");
         jj.write("package "+getJavaPackage()+";\n\n");
-        jj.write("import java.util.*;\n");
         jj.write("import org.apache.jute.*;\n");
         jj.write("public class "+getName()+" implements Record {\n");
         for (Iterator<JField> i = mFields.iterator(); i.hasNext();) {

Modified: zookeeper/trunk/src/java/main/org/apache/jute/compiler/generated/rcc.jj
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/main/org/apache/jute/compiler/generated/rcc.jj?rev=1164710&r1=1164709&r2=1164710&view=diff
==============================================================================
--- zookeeper/trunk/src/java/main/org/apache/jute/compiler/generated/rcc.jj (original)
+++ zookeeper/trunk/src/java/main/org/apache/jute/compiler/generated/rcc.jj Fri Sep  2 20:53:58
2011
@@ -26,21 +26,21 @@ package org.apache.jute.compiler.generat
 import org.apache.jute.compiler.*;
 import java.util.ArrayList;
 import java.util.Hashtable;
-import java.util.Iterator;
 import java.io.File;
 import java.io.FileReader;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 
+@SuppressWarnings("unused")
 public class Rcc {
-    private static Hashtable recTab = new Hashtable();
+    private static Hashtable<String, JRecord> recTab = new Hashtable<String, JRecord>();
     private static String curDir = System.getProperty("user.dir");
     private static String curFileName;
     private static String curModuleName;
 
     public static void main(String args[]) {
         String language = "java";
-        ArrayList recFiles = new ArrayList();
+        ArrayList<String> recFiles = new ArrayList<String>();
         JFile curFile=null;
         
         for (int i=0; i<args.length; i++) {
@@ -61,18 +61,18 @@ public class Rcc {
             System.exit(1);
         }
         for (int i=0; i<recFiles.size(); i++) {
-            curFileName = (String) recFiles.get(i);
+            curFileName = recFiles.get(i);
             File file = new File(curFileName);
             try {
                 curFile = parseFile(file);
             } catch (FileNotFoundException e) {
-                System.out.println("File " + (String) recFiles.get(i) + " Not found.");
+                System.out.println("File " + recFiles.get(i) + " Not found.");
                 System.exit(1);
             } catch (ParseException e) {
                 System.out.println(e.toString());
                 System.exit(1);
             }
-            System.out.println((String) recFiles.get(i) + " Parsed Successfully");
+            System.out.println(recFiles.get(i) + " Parsed Successfully");
             try {
                 curFile.genCode(language, new File("."));
             } catch (IOException e) {
@@ -88,7 +88,7 @@ public class Rcc {
         FileReader reader = new FileReader(file);
         try {
             Rcc parser = new Rcc(reader);
-            recTab = new Hashtable();
+            recTab = new Hashtable<String, JRecord>();
             return parser.Input();
         } finally {
             try {
@@ -167,10 +167,10 @@ TOKEN :
 
 JFile Input() :
 {
-    ArrayList ilist = new ArrayList();
-    ArrayList rlist = new ArrayList();
+    ArrayList<JFile> ilist = new ArrayList<JFile>();
+    ArrayList<JRecord> rlist = new ArrayList<JRecord>();
     JFile i;
-    ArrayList l;
+    ArrayList <JRecord>l;
 }
 {
     (
@@ -224,10 +224,10 @@ JFile Include() :
     }
 }
 
-ArrayList Module() :
+ArrayList<JRecord> Module() :
 {
     String mName;
-    ArrayList rlist;
+    ArrayList<JRecord> rlist;
 }
 {
     <MODULE_TKN>
@@ -255,9 +255,9 @@ String ModuleName() :
     { return name; }
 }
 
-ArrayList RecordList() :
+ArrayList<JRecord> RecordList() :
 {
-    ArrayList rlist = new ArrayList();
+    ArrayList<JRecord> rlist = new ArrayList<JRecord>();
     JRecord r;
 }
 {
@@ -271,7 +271,7 @@ ArrayList RecordList() :
 JRecord Record() :
 {
     String rname;
-    ArrayList flist = new ArrayList();
+    ArrayList<JField> flist = new ArrayList<JField>();
     Token t;
     JField f;
 }
@@ -337,7 +337,7 @@ JType Type() :
         if (rname.indexOf('.', 0) < 0) {
             rname = curModuleName + "." + rname;
         }
-        JRecord r = (JRecord) recTab.get(rname);
+        JRecord r = recTab.get(rname);
         if (r == null) {
             System.out.println("Type " + rname + " not known. Exiting.");
             System.exit(1);



Mime
View raw message