< prev index next >

src/java.desktop/share/classes/java/awt/geom/Path2D.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -185,11 +185,11 @@
      * coordinates stored in single precision floating point.
      *
      * @since 1.6
      */
     public static class Float extends Path2D implements Serializable {
-        transient float floatCoords[];
+        transient float[] floatCoords;
 
         /**
          * Constructs a new empty single precision {@code Path2D} object
          * with a default winding rule of {@link #WIND_NON_ZERO}.
          *

@@ -288,11 +288,11 @@
         }
 
         @Override
         float[] cloneCoordsFloat(AffineTransform at) {
             // trim arrays:
-            float ret[];
+            float[] ret;
             if (at == null) {
                 ret = Arrays.copyOf(floatCoords, numCoords);
             } else {
                 ret = new float[numCoords];
                 at.transform(floatCoords, 0, ret, 0, numCoords / 2);

@@ -301,11 +301,11 @@
         }
 
         @Override
         double[] cloneCoordsDouble(AffineTransform at) {
             // trim arrays:
-            double ret[] = new double[numCoords];
+            double[] ret = new double[numCoords];
             if (at == null) {
                 for (int i = 0; i < numCoords; i++) {
                     ret[i] = floatCoords[i];
                 }
             } else {

@@ -553,11 +553,11 @@
         int pointCrossings(double px, double py) {
             if (numTypes == 0) {
                 return 0;
             }
             double movx, movy, curx, cury, endx, endy;
-            float coords[] = floatCoords;
+            float[] coords = floatCoords;
             curx = movx = coords[0];
             cury = movy = coords[1];
             int crossings = 0;
             int ci = 2;
             for (int i = 1; i < numTypes; i++) {

@@ -632,11 +632,11 @@
                           double rxmax, double rymax)
         {
             if (numTypes == 0) {
                 return 0;
             }
-            float coords[] = floatCoords;
+            float[] coords = floatCoords;
             double curx, cury, movx, movy, endx, endy;
             curx = movx = coords[0];
             cury = movy = coords[1];
             int crossings = 0;
             int ci = 2;

@@ -734,11 +734,11 @@
         /**
          * {@inheritDoc}
          * @since 1.6
          */
         public final void append(PathIterator pi, boolean connect) {
-            float coords[] = new float[6];
+            float[] coords = new float[6];
             while (!pi.isDone()) {
                 switch (pi.currentSegment(coords)) {
                 case SEG_MOVETO:
                     if (!connect || numTypes < 1 || numCoords < 1) {
                         moveTo(coords[0], coords[1]);

@@ -1002,11 +1002,11 @@
         {
             super.readObject(s, false);
         }
 
         static class CopyIterator extends Path2D.Iterator {
-            float floatCoords[];
+            float[] floatCoords;
 
             CopyIterator(Path2D.Float p2df) {
                 super(p2df);
                 this.floatCoords = p2df.floatCoords;
             }

@@ -1032,11 +1032,11 @@
                 return type;
             }
         }
 
         static class TxIterator extends Path2D.Iterator {
-            float floatCoords[];
+            float[] floatCoords;
             AffineTransform affine;
 
             TxIterator(Path2D.Float p2df, AffineTransform at) {
                 super(p2df);
                 this.floatCoords = p2df.floatCoords;

@@ -1071,11 +1071,11 @@
      * coordinates stored in double precision floating point.
      *
      * @since 1.6
      */
     public static class Double extends Path2D implements Serializable {
-        transient double doubleCoords[];
+        transient double[] doubleCoords;
 
         /**
          * Constructs a new empty double precision {@code Path2D} object
          * with a default winding rule of {@link #WIND_NON_ZERO}.
          *

@@ -1174,11 +1174,11 @@
         }
 
         @Override
         float[] cloneCoordsFloat(AffineTransform at) {
             // trim arrays:
-            float ret[] = new float[numCoords];
+            float[] ret = new float[numCoords];
             if (at == null) {
                 for (int i = 0; i < numCoords; i++) {
                     ret[i] = (float) doubleCoords[i];
                 }
             } else {

@@ -1188,11 +1188,11 @@
         }
 
         @Override
         double[] cloneCoordsDouble(AffineTransform at) {
             // trim arrays:
-            double ret[];
+            double[] ret;
             if (at == null) {
                 ret = Arrays.copyOf(doubleCoords, numCoords);
             } else {
                 ret = new double[numCoords];
                 at.transform(doubleCoords, 0, ret, 0, numCoords / 2);

@@ -1328,11 +1328,11 @@
         int pointCrossings(double px, double py) {
             if (numTypes == 0) {
                 return 0;
             }
             double movx, movy, curx, cury, endx, endy;
-            double coords[] = doubleCoords;
+            double[] coords = doubleCoords;
             curx = movx = coords[0];
             cury = movy = coords[1];
             int crossings = 0;
             int ci = 2;
             for (int i = 1; i < numTypes; i++) {

@@ -1407,11 +1407,11 @@
                           double rxmax, double rymax)
         {
             if (numTypes == 0) {
                 return 0;
             }
-            double coords[] = doubleCoords;
+            double[] coords = doubleCoords;
             double curx, cury, movx, movy, endx, endy;
             curx = movx = coords[0];
             cury = movy = coords[1];
             int crossings = 0;
             int ci = 2;

@@ -1510,11 +1510,11 @@
         /**
          * {@inheritDoc}
          * @since 1.6
          */
         public final void append(PathIterator pi, boolean connect) {
-            double coords[] = new double[6];
+            double[] coords = new double[6];
             while (!pi.isDone()) {
                 switch (pi.currentSegment(coords)) {
                 case SEG_MOVETO:
                     if (!connect || numTypes < 1 || numCoords < 1) {
                         moveTo(coords[0], coords[1]);

@@ -1777,11 +1777,11 @@
         {
             super.readObject(s, true);
         }
 
         static class CopyIterator extends Path2D.Iterator {
-            double doubleCoords[];
+            double[] doubleCoords;
 
             CopyIterator(Path2D.Double p2dd) {
                 super(p2dd);
                 this.doubleCoords = p2dd.doubleCoords;
             }

@@ -1807,11 +1807,11 @@
                 return type;
             }
         }
 
         static class TxIterator extends Path2D.Iterator {
-            double doubleCoords[];
+            double[] doubleCoords;
             AffineTransform affine;
 
             TxIterator(Path2D.Double p2dd, AffineTransform at) {
                 super(p2dd);
                 this.doubleCoords = p2dd.doubleCoords;

@@ -2535,12 +2535,12 @@
     final void writeObject(java.io.ObjectOutputStream s, boolean isdbl)
         throws java.io.IOException
     {
         s.defaultWriteObject();
 
-        float fCoords[];
-        double dCoords[];
+        float[] fCoords;
+        double[] dCoords;
 
         if (isdbl) {
             dCoords = ((Path2D.Double) this).doubleCoords;
             fCoords = null;
         } else {

@@ -2724,11 +2724,11 @@
     abstract static class Iterator implements PathIterator {
         int typeIdx;
         int pointIdx;
         Path2D path;
 
-        static final int curvecoords[] = {2, 2, 4, 6, 0};
+        static final int[] curvecoords = {2, 2, 4, 6, 0};
 
         Iterator(Path2D path) {
             this.path = path;
         }
 
< prev index next >