--- old/src/share/classes/sun/java2d/Spans.java 2014-03-28 09:48:07.300248745 -0700 +++ new/src/share/classes/sun/java2d/Spans.java 2014-03-28 09:48:07.180248739 -0700 @@ -49,7 +49,7 @@ * Holds a list of individual * Span instances. */ - private List mSpans = new Vector(kMaxAddsSinceSort); + private List mSpans = new Vector<>(kMaxAddsSinceSort); /** * The number of Span @@ -144,7 +144,7 @@ Collections.sort(mSpans); mAddsSinceSort = 0; - Iterator iter = mSpans.iterator(); + Iterator iter = mSpans.iterator(); /* Have 'span' start at the first span in * the collection. The collection may be empty @@ -152,7 +152,7 @@ */ Span span = null; if (iter.hasNext()) { - span = (Span) iter.next(); + span = iter.next(); } /* Loop over the spans collapsing those that intersect @@ -160,7 +160,7 @@ */ while (iter.hasNext()) { - Span nextSpan = (Span) iter.next(); + Span nextSpan = iter.next(); /* The spans are in ascending start position * order and so the next span's starting point @@ -202,9 +202,9 @@ private void printSpans() { System.out.println("----------"); if (mSpans != null) { - Iterator iter = mSpans.iterator(); + Iterator iter = mSpans.iterator(); while (iter.hasNext()) { - Span span = (Span) iter.next(); + Span span = iter.next(); System.out.println(span); } } @@ -216,7 +216,7 @@ /** * Holds a single half-open interval. */ - static class Span implements Comparable { + static class Span implements Comparable { /** * The span includes the starting point. @@ -315,8 +315,7 @@ * position. The end position is ignored * in this ranking. */ - public int compareTo(Object o) { - Span otherSpan = (Span) o; + public int compareTo(Span otherSpan) { float otherStart = otherSpan.getStart(); int result; @@ -345,7 +344,7 @@ * SpanIntersection.instance to * get the single instance of this class. */ - static class SpanIntersection implements Comparator { + static class SpanIntersection implements Comparator { /** * This class is a Singleton and the following @@ -361,10 +360,8 @@ } - public int compare(Object o1, Object o2) { + public int compare(Span span1, Span span2) { int result; - Span span1 = (Span) o1; - Span span2 = (Span) o2; /* Span 1 is entirely to the left of span2. * span1: <-----<