harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r449876 - /incubator/harmony/enhanced/classlib/trunk/modules/accessibility/src/main/java/javax/accessibility/
Date Tue, 26 Sep 2006 00:54:35 GMT
Author: ndbeyer
Date: Mon Sep 25 17:54:34 2006
New Revision: 449876

URL: http://svn.apache.org/viewvc?view=rev&rev=449876
Log:
Compiler warning cleanup
* Add if/else braces
* Generification
* Add Override annotations


Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/accessibility/src/main/java/javax/accessibility/AccessibleBundle.java
    incubator/harmony/enhanced/classlib/trunk/modules/accessibility/src/main/java/javax/accessibility/AccessibleContext.java
    incubator/harmony/enhanced/classlib/trunk/modules/accessibility/src/main/java/javax/accessibility/AccessibleRelation.java
    incubator/harmony/enhanced/classlib/trunk/modules/accessibility/src/main/java/javax/accessibility/AccessibleRelationSet.java
    incubator/harmony/enhanced/classlib/trunk/modules/accessibility/src/main/java/javax/accessibility/AccessibleResourceBundle.java
    incubator/harmony/enhanced/classlib/trunk/modules/accessibility/src/main/java/javax/accessibility/AccessibleStateSet.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/accessibility/src/main/java/javax/accessibility/AccessibleBundle.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/accessibility/src/main/java/javax/accessibility/AccessibleBundle.java?view=diff&rev=449876&r1=449875&r2=449876
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/accessibility/src/main/java/javax/accessibility/AccessibleBundle.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/accessibility/src/main/java/javax/accessibility/AccessibleBundle.java
Mon Sep 25 17:54:34 2006
@@ -41,6 +41,7 @@
         return displayString(resourceBundleName, locale);
     }
 
+    @Override
     public String toString() {
         return toDisplayString();
     }
@@ -50,9 +51,8 @@
         try {
             if (locale == null) {
                 return ResourceBundle.getBundle(bundleName).getString(key);
-            } else {
-                return ResourceBundle.getBundle(bundleName, locale).getString(key);
             }
+            return ResourceBundle.getBundle(bundleName, locale).getString(key);
         } catch (MissingResourceException e) {
             return key;
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/accessibility/src/main/java/javax/accessibility/AccessibleContext.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/accessibility/src/main/java/javax/accessibility/AccessibleContext.java?view=diff&rev=449876&r1=449875&r2=449876
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/accessibility/src/main/java/javax/accessibility/AccessibleContext.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/accessibility/src/main/java/javax/accessibility/AccessibleContext.java
Mon Sep 25 17:54:34 2006
@@ -56,7 +56,7 @@
     protected String accessibleDescription;
 
     private AccessibleRelationSet accessibleRelationSet;
-    private SwingPropertyChangeSupport propertyChangeSupport = new SwingPropertyChangeSupport(this);
+    private final SwingPropertyChangeSupport propertyChangeSupport = new SwingPropertyChangeSupport(this);
 
     public String getAccessibleName() {
         return accessibleName;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/accessibility/src/main/java/javax/accessibility/AccessibleRelation.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/accessibility/src/main/java/javax/accessibility/AccessibleRelation.java?view=diff&rev=449876&r1=449875&r2=449876
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/accessibility/src/main/java/javax/accessibility/AccessibleRelation.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/accessibility/src/main/java/javax/accessibility/AccessibleRelation.java
Mon Sep 25 17:54:34 2006
@@ -70,7 +70,7 @@
     }
 
     public Object[] getTarget() {
-        return (Object[])targets.clone();
+        return targets.clone();
     }
 
     public void setTarget(final Object target) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/accessibility/src/main/java/javax/accessibility/AccessibleRelationSet.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/accessibility/src/main/java/javax/accessibility/AccessibleRelationSet.java?view=diff&rev=449876&r1=449875&r2=449876
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/accessibility/src/main/java/javax/accessibility/AccessibleRelationSet.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/accessibility/src/main/java/javax/accessibility/AccessibleRelationSet.java
Mon Sep 25 17:54:34 2006
@@ -25,7 +25,7 @@
 import java.util.Vector;
 
 public class AccessibleRelationSet {
-    protected Vector relations;
+    protected Vector<AccessibleRelation> relations;
 
     public AccessibleRelationSet() {
         initStorage();
@@ -47,8 +47,8 @@
 
     public void addAll(final AccessibleRelation[] relations) {
         initStorage(relations.length);
-        for(int i = 0; i < relations.length; i++) {
-            add(relations[i]);
+        for (AccessibleRelation element : relations) {
+            add(element);
         }
     }
 
@@ -74,8 +74,7 @@
         if (relations == null) {
             return null;
         }
-        for (Iterator i = relations.iterator(); i.hasNext();) {
-            AccessibleRelation rel = (AccessibleRelation)i.next();
+        for (AccessibleRelation rel : relations) {
             if(key.equals(rel.key)) {
                 return rel;
             }
@@ -85,15 +84,16 @@
 
     public AccessibleRelation[] toArray() {
         return relations == null ? new AccessibleRelation[0] :
-            (AccessibleRelation[])relations.toArray(new AccessibleRelation[relations.size()]);
+            relations.toArray(new AccessibleRelation[relations.size()]);
     }
 
+    @Override
     public String toString() {
         if (relations == null) {
             return "";
         }
         StringBuffer result = new StringBuffer();
-        for (Iterator it = relations.iterator(); it.hasNext(); ) {
+        for (Iterator<AccessibleRelation> it = relations.iterator(); it.hasNext();
) {
             result.append(it.next());
             if (it.hasNext()) {
                 result.append(",");
@@ -105,13 +105,13 @@
 
     private void initStorage(final int capacity) {
         if(relations == null) {
-            relations = new Vector(capacity);
+            relations = new Vector<AccessibleRelation>(capacity);
         }
     }
 
     private void initStorage() {
         if(relations == null) {
-            relations = new Vector();
+            relations = new Vector<AccessibleRelation>();
         }
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/accessibility/src/main/java/javax/accessibility/AccessibleResourceBundle.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/accessibility/src/main/java/javax/accessibility/AccessibleResourceBundle.java?view=diff&rev=449876&r1=449875&r2=449876
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/accessibility/src/main/java/javax/accessibility/AccessibleResourceBundle.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/accessibility/src/main/java/javax/accessibility/AccessibleResourceBundle.java
Mon Sep 25 17:54:34 2006
@@ -132,6 +132,7 @@
         {"truncated", "truncated"},
     };
 
+    @Override
     public Object[][] getContents() {
         return contents;
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/accessibility/src/main/java/javax/accessibility/AccessibleStateSet.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/accessibility/src/main/java/javax/accessibility/AccessibleStateSet.java?view=diff&rev=449876&r1=449875&r2=449876
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/accessibility/src/main/java/javax/accessibility/AccessibleStateSet.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/accessibility/src/main/java/javax/accessibility/AccessibleStateSet.java
Mon Sep 25 17:54:34 2006
@@ -25,7 +25,7 @@
 import java.util.Vector;
 
 public class AccessibleStateSet {
-    protected Vector states;
+    protected Vector<AccessibleState> states;
 
     public AccessibleStateSet() {
         initStorage();
@@ -47,8 +47,8 @@
 
     public void addAll(final AccessibleState[] states) {
         initStorage(states.length);
-        for (int i = 0; i < states.length; i++) {
-            add(states[i]);
+        for (AccessibleState element : states) {
+            add(element);
         }
     }
 
@@ -68,13 +68,16 @@
 
     public AccessibleState[] toArray() {
         return states == null ? new AccessibleState[0] :
-            (AccessibleState[])states.toArray(new AccessibleState[states.size()]);
+            states.toArray(new AccessibleState[states.size()]);
     }
 
+    @Override
     public String toString() {
-        if (states == null) return "";
+        if (states == null) {
+            return "";
+        }
         StringBuffer str = new StringBuffer();
-        for (Iterator it = states.iterator(); it.hasNext(); ) {
+        for (Iterator<AccessibleState> it = states.iterator(); it.hasNext(); ) {
             str.append(it.next());
             if (it.hasNext()) {
                 str.append(",");
@@ -85,13 +88,13 @@
 
     private void initStorage(final int capacity) {
         if (states == null) {
-            states = new Vector(capacity);
+            states = new Vector<AccessibleState>(capacity);
         }
     }
 
     private void initStorage() {
         if (states == null) {
-            states = new Vector();
+            states = new Vector<AccessibleState>();
         }
     }
 }



Mime
View raw message