harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r823777 - /harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/geom/CrossingHelper.java
Date Sat, 10 Oct 2009 03:38:18 GMT
Author: ndbeyer
Date: Sat Oct 10 03:38:17 2009
New Revision: 823777

URL: http://svn.apache.org/viewvc?rev=823777&view=rev
Log:
add generic types, simplify static inner type

Modified:
    harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/geom/CrossingHelper.java

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/geom/CrossingHelper.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/geom/CrossingHelper.java?rev=823777&r1=823776&r2=823777&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/geom/CrossingHelper.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/geom/CrossingHelper.java
Sat Oct 10 03:38:17 2009
@@ -145,8 +145,8 @@
         	areaOfEdge1 = 1;
         }
  
-        for (Iterator iter = edges.iterator(); iter.hasNext(); ) {
-        	edge = (Edge) iter.next();
+        for (Iterator<Edge> iter = edges.iterator(); iter.hasNext(); ) {
+        	edge = iter.next();
         	
             if (edge.areaNumber == 0) {
                 x3 = coords1[2* edge.begIndex];
@@ -200,8 +200,8 @@
                 }
      
                 IntersectPoint ip;
-                for (Iterator i = isectPoints.iterator(); i.hasNext(); ) {
-                	ip = (IntersectPoint)i.next();
+                for (Iterator<IntersectPoint> i = isectPoints.iterator(); i.hasNext();
) {
+                	ip = i.next();
                 	
                     if ((initBegin == ip.getBegIndex(true)) && 
                     	(initEnd == ip.getEndIndex(true))) {
@@ -287,8 +287,8 @@
     public boolean containsPoint(double[] point) {
     	IntersectPoint ipoint;
     	
-    	for (Iterator i = isectPoints.iterator(); i.hasNext(); ) {
-        	ipoint = (IntersectPoint)i.next();
+    	for (Iterator<IntersectPoint> i = isectPoints.iterator(); i.hasNext(); ) {
+        	ipoint = i.next();
         	
         	if (ipoint.getX() == point[0] && ipoint.getY() == point[1]) {
         		return true;
@@ -309,18 +309,18 @@
         return -1;
     }
 
-    private static class Edge {
-        int begIndex;
-        int endIndex;
-        int areaNumber;
+    private static final class Edge {
+        final int begIndex;
+        final int endIndex;
+        final int areaNumber;
 
-        public Edge(int begIndex, int endIndex, int areaNumber) {
+        Edge(int begIndex, int endIndex, int areaNumber) {
             this.begIndex = begIndex;
             this.endIndex = endIndex;
             this.areaNumber = areaNumber;
         }
 
-        public boolean reverseCompare (int begIndex, int endIndex) {
+        boolean reverseCompare (int begIndex, int endIndex) {
             return this.begIndex == endIndex && this.endIndex == begIndex;
         }
     }



Mime
View raw message