[OpenJDK 2D-Dev] JDK9: RFR: 8039342: Fix raw and unchecked warnings in sun.awt.*

Jim Graham james.graham at oracle.com
Wed Apr 23 21:37:48 UTC 2014


Shouldn't Order2, lines 50,77 be "<Curve>"?
Ditto for Order3, lines 56,108?

I don't think we ever use these methods with any other type of Vector, 
but I guess I can see that the choice you made might be a more general 
choice.

This concludes my review of the geom files per Phil's request.  They 
look fine, other than my suggestions for returning an empty curve list 
from pruneEdges and the above comments...

			...jim

On 4/7/14 1:46 PM, Henry Jen wrote:
> Hi,
>
> Please review the webrev cleans up raw and unchecked warnings in sun.awt,
>
> http://cr.openjdk.java.net/~henryjen/jdk9/8039342/0/webrev/
>
> The following changes in AreaOp::pruneEdges() is particular worth
> attention, when numedges < 2, two different type are mixed up in the
> past with use of rawtypes; However, I think it could only work if the
> Vector is empty?
>
> Cheers,
> Henry
>
>
>> @@ -193,16 +193,20 @@
>>              }
>>              return 1;
>>          }
>>      };
>>
>> -    private Vector pruneEdges(Vector edges) {
>> +    private Vector<Curve> pruneEdges(Vector<Edge> edges) {
>>          int numedges = edges.size();
>>          if (numedges < 2) {
>> -            return edges;
>> +            Vector<Curve> rt = new Vector<>();
>> +            for (Edge edge: edges) {
>> +                rt.add(edge.getCurve());
>>          }
>> -        Edge[] edgelist = (Edge[]) edges.toArray(new Edge[numedges]);
>> +            return rt;
>> +        }
>> +        Edge[] edgelist = edges.toArray(new Edge[numedges]);
>>          Arrays.sort(edgelist, YXTopComparator);
>>          if (false) {
>>              System.out.println("pruning: ");
>>              for (int i = 0; i < numedges; i++) {
>>                  System.out.println("edgelist["+i+"] = "+edgelist[i]);
>



More information about the 2d-dev mailing list