harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r412734 - in /incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java: java/beans/XMLEncoder.java org/apache/harmony/beans/ObjectNode.java
Date Thu, 08 Jun 2006 12:40:54 GMT
Author: mloenko
Date: Thu Jun  8 05:40:54 2006
New Revision: 412734

URL: http://svn.apache.org/viewvc?rev=412734&view=rev
Log:
cosmetic changes from HARMONY-571
[classlib] [beans]

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/XMLEncoder.java
    incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/ObjectNode.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/XMLEncoder.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/XMLEncoder.java?rev=412734&r1=412733&r2=412734&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/XMLEncoder.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/java/beans/XMLEncoder.java
Thu Jun  8 05:40:54 2006
@@ -153,9 +153,9 @@
             
             printBytes(tabCount, tag.toStringOnOpen());
             
-            Enumeration e = node.statements();
-            while(e.hasMoreElements()) {
-                Statement s = (Statement) e.nextElement();
+            Iterator e = node.statements();
+            while(e.hasNext()) {
+                Statement s = (Statement) e.next();
                 printVoidTag(++tabCount, s);
                 --tabCount;
             }
@@ -173,10 +173,10 @@
             boolean isReferenced = node.getReferencesNumber() > 0;
             
             if(!isReferenced) {
-                Enumeration referencedExpressions = node.referencedExpressions();
-                while(referencedExpressions.hasMoreElements()) {
+                Iterator referencedExpressions = node.referencedExpressions();
+                while(referencedExpressions.hasNext()) {
                     Expression expr =
-                            (Expression) referencedExpressions.nextElement();
+                            (Expression) referencedExpressions.next();
                     
                     //System.out.println("expr.getMethodName() = "
                     //        + expr.getMethodName());
@@ -238,17 +238,17 @@
                     --tabCount;
                 }
                 
-                Enumeration e1 = node.expressions();
-                while(e1.hasMoreElements()) {
-                    Expression e = (Expression) e1.nextElement();
+                Iterator i1 = node.expressions();
+                while(i1.hasNext()) {
+                    Expression e = (Expression) i1.next();
                     
                     printVoidTag(++tabCount, e);
                     --tabCount;
                 }
                 
-                Enumeration e2 = node.statements();
-                while(e2.hasMoreElements()) {
-                    Statement s = (Statement) e2.nextElement();
+                Iterator i2 = node.statements();
+                while(i2.hasNext()) {
+                    Statement s = (Statement) i2.next();
                     
                     printVoidTag(++tabCount, s);
                     --tabCount;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/ObjectNode.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/ObjectNode.java?rev=412734&r1=412733&r2=412734&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/ObjectNode.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/beans/src/main/java/org/apache/harmony/beans/ObjectNode.java
Thu Jun  8 05:40:54 2006
@@ -22,9 +22,9 @@
 
 import java.beans.Expression;
 import java.beans.Statement;
-import java.util.Enumeration;
-import java.util.HashMap;
 import java.util.Iterator;
+import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Vector;
 
 /**
@@ -38,7 +38,7 @@
     private Object objectValue = null;
     private HashMap nodes;
     
-    private Vector statements = new Vector();
+    private HashSet statements = new HashSet();
     private Vector expressions = new Vector();
     private Vector referencedExpressions = new Vector();
     
@@ -123,33 +123,21 @@
     public void addExpression(Expression expression) {
         expressions.add(expression);
     }
-    
+
+    // FIXME should be replaced with HashSet
     public void addStatement(Statement statement) {
-        boolean found = false;
-        Iterator i = statements.iterator();
-        while(i.hasNext()) {
-            Statement s = (Statement) i.next();
-            
-            if(s.equals(statement)) {
-                found = true;
-                break;
-            }
-        }
-        
-        if(!found) {
-            statements.add(statement);
-        }
+        statements.add(statement);
     }
     
-    public Enumeration expressions() {
-        return expressions.elements();
+    public Iterator expressions() {
+        return expressions.iterator();
     }
     
-    public Enumeration referencedExpressions() {
-        return referencedExpressions.elements();
+    public Iterator referencedExpressions() {
+        return referencedExpressions.iterator();
     }
     
-    public Enumeration statements() {
-        return statements.elements();
+    public Iterator statements() {
+        return statements.iterator();
     }
 }



Mime
View raw message