sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1737805 - in /sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/geometry: AbstractEnvelope.java ArrayEnvelope.java Envelope2D.java Envelopes.java GeneralDirectPosition.java GeneralEnvelope.java SubEnvelope.java
Date Tue, 05 Apr 2016 09:07:57 GMT
Author: desruisseaux
Date: Tue Apr  5 09:07:56 2016
New Revision: 1737805

URL: http://svn.apache.org/viewvc?rev=1737805&view=rev
Log:
Code formatting and addition of @SuppressWarnings annotation.
There is no code change in this commit.

Modified:
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/geometry/ArrayEnvelope.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/geometry/Envelope2D.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/geometry/Envelopes.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralDirectPosition.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/geometry/SubEnvelope.java

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java?rev=1737805&r1=1737804&r2=1737805&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java
[UTF-8] Tue Apr  5 09:07:56 2016
@@ -197,7 +197,7 @@ public abstract class AbstractEnvelope i
     static CoordinateSystemAxis getAxis(final CoordinateReferenceSystem crs, final int dimension)
{
         if (crs != null) {
             final CoordinateSystem cs = crs.getCoordinateSystem();
-            if (cs != null) {   // Paranoiac check (should never be null).
+            if (cs != null) {                                       // Paranoiac check (should
never be null).
                 return cs.getAxis(dimension);
             }
         }
@@ -350,7 +350,7 @@ public abstract class AbstractEnvelope i
     @Override
     public double getMinimum(final int dimension) throws IndexOutOfBoundsException {
         double lower = getLower(dimension);
-        if (isNegative(getUpper(dimension) - lower)) { // Special handling for -0.0
+        if (isNegative(getUpper(dimension) - lower)) {              // Special handling for
-0.0
             final CoordinateSystemAxis axis = getAxis(getCoordinateReferenceSystem(), dimension);
             lower = (axis != null) ? axis.getMinimumValue() : Double.NEGATIVE_INFINITY;
         }
@@ -371,7 +371,7 @@ public abstract class AbstractEnvelope i
     @Override
     public double getMaximum(final int dimension) throws IndexOutOfBoundsException {
         double upper = getUpper(dimension);
-        if (isNegative(upper - getLower(dimension))) { // Special handling for -0.0
+        if (isNegative(upper - getLower(dimension))) {              // Special handling for
-0.0
             final CoordinateSystemAxis axis = getAxis(getCoordinateReferenceSystem(), dimension);
             upper = (axis != null) ? axis.getMaximumValue() : Double.POSITIVE_INFINITY;
         }
@@ -406,7 +406,7 @@ public abstract class AbstractEnvelope i
         final double lower = getLower(dimension);
         final double upper = getUpper(dimension);
         double median = 0.5 * (lower + upper);
-        if (isNegative(upper - lower)) { // Special handling for -0.0
+        if (isNegative(upper - lower)) {                            // Special handling for
-0.0
             median = fixMedian(getAxis(getCoordinateReferenceSystem(), dimension), median);
         }
         return median;
@@ -453,7 +453,7 @@ public abstract class AbstractEnvelope i
     @Override
     public double getSpan(final int dimension) {
         double span = getUpper(dimension) - getLower(dimension);
-        if (isNegative(span)) { // Special handling for -0.0
+        if (isNegative(span)) {                                     // Special handling for
-0.0
             span = fixSpan(getAxis(getCoordinateReferenceSystem(), dimension), span);
         }
         return span;
@@ -534,14 +534,14 @@ public abstract class AbstractEnvelope i
      */
     @SuppressWarnings("ReturnOfCollectionOrArrayField")
     public Envelope[] toSimpleEnvelopes() {
-        long isWrapAround = 0; // A bitmask of the dimensions having a "wrap around" behavior.
+        long isWrapAround = 0;                              // A bitmask of the dimensions
having a "wrap around" behavior.
         CoordinateReferenceSystem crs = null;
         final int dimension = getDimension();
         for (int i=0; i!=dimension; i++) {
-            final double span = getUpper(i) - getLower(i); // Do not use getSpan(i).
-            if (!(span > 0)) { // Use '!' for catching NaN.
+            final double span = getUpper(i) - getLower(i);  // Do not use getSpan(i).
+            if (!(span > 0)) {                              // Use '!' for catching NaN.
                 if (!isNegative(span)) {
-                    return EMPTY; // Span is positive zero.
+                    return EMPTY;                           // Span is positive zero.
                 }
                 if (crs == null) {
                     crs = getCoordinateReferenceSystem();
@@ -591,9 +591,9 @@ public abstract class AbstractEnvelope i
              * Assign the minimum and maximum ordinate values in the dimension where a wraparound
has been found.
              * The 'for' loop below iterates only over the 'i' values for which the 'isWrapAround'
bit is set to 1.
              */
-            int mask = 1; // For identifying whether we need to set the lower or the upper
ordinate.
+            int mask = 1;               // For identifying whether we need to set the lower
or the upper ordinate.
             @SuppressWarnings("null")
-            final CoordinateSystem cs = crs.getCoordinateSystem(); // Should not be null
at this point.
+            final CoordinateSystem cs = crs.getCoordinateSystem();            // Should not
be null at this point.
             for (int i; (i = Long.numberOfTrailingZeros(isWrapAround)) != Long.SIZE; isWrapAround
&= ~(1L << i)) {
                 final CoordinateSystemAxis axis = cs.getAxis(i);
                 final double min = axis.getMinimumValue();
@@ -637,7 +637,7 @@ public abstract class AbstractEnvelope i
             return true;
         }
         for (int i=0; i<dimension; i++) {
-            if (!(getSpan(i) > 0)) { // Use '!' in order to catch NaN
+            if (!(getSpan(i) > 0)) {                            // Use '!' in order to
catch NaN
                 return true;
             }
         }
@@ -710,7 +710,7 @@ public abstract class AbstractEnvelope i
             final boolean c1   = (value >= lower);
             final boolean c2   = (value <= upper);
             if (c1 & c2) {
-                continue; // Point inside the range, check other dimensions.
+                continue;               // Point inside the range, check other dimensions.
             }
             if (c1 | c2) {
                 if (isNegative(upper - lower)) {
@@ -1136,7 +1136,7 @@ public abstract class AbstractEnvelope i
             final DirectPosition lowerCorner = envelope.getLowerCorner();
             final DirectPosition upperCorner = envelope.getUpperCorner();
             boolean isUpper = false;
-            do { // Executed exactly twice.
+            do {                                                        // Executed exactly
twice.
                 for (int i=0; i<dimension; i++) {
                     buffer.append(i == 0 && !isUpper ? '(' : ' ');
                     final double ordinate = (isUpper ? upperCorner : lowerCorner).getOrdinate(i);

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/geometry/ArrayEnvelope.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/geometry/ArrayEnvelope.java?rev=1737805&r1=1737804&r2=1737805&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/geometry/ArrayEnvelope.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/geometry/ArrayEnvelope.java
[UTF-8] Tue Apr  5 09:07:56 2016
@@ -109,7 +109,7 @@ class ArrayEnvelope extends AbstractEnve
     public ArrayEnvelope(final DirectPosition lowerCorner, final DirectPosition upperCorner)
             throws MismatchedDimensionException, MismatchedReferenceSystemException
     {
-        crs = getCommonCRS(lowerCorner, upperCorner); // This performs also an argument check.
+        crs = getCommonCRS(lowerCorner, upperCorner);           // This performs also an
argument check.
         final int dimension = lowerCorner.getDimension();
         ensureDimensionMatches("crs", dimension, crs);
         ensureSameDimension(dimension, upperCorner.getDimension());
@@ -222,10 +222,10 @@ class ArrayEnvelope extends AbstractEnve
      */
     public ArrayEnvelope(final CharSequence wkt) throws IllegalArgumentException {
         ensureNonNull("wkt", wkt);
-        int levelParenth = 0; // Number of opening parenthesis: (
-        int levelBracket = 0; // Number of opening brackets: [
-        int dimLimit     = 4; // The length of minimum and maximum arrays.
-        int maxDimension = 0; // The number of valid entries in the minimum and maximum arrays.
+        int levelParenth = 0;               // Number of opening parenthesis: (
+        int levelBracket = 0;               // Number of opening brackets: [
+        int dimLimit     = 4;               // The length of minimum and maximum arrays.
+        int maxDimension = 0;               // The number of valid entries in the minimum
and maximum arrays.
         final int length = CharSequences.skipTrailingWhitespaces(wkt, 0, wkt.length());
         double[] minimum = new double[dimLimit];
         double[] maximum = new double[dimLimit];
@@ -369,7 +369,7 @@ scanNumber: while ((i += Character.charC
     {
         Object name = IdentifiedObjects.getName(getAxis(crs, dimension), null);
         if (name == null) {
-            name = dimension; // Paranoiac fallback (name should never be null).
+            name = dimension;       // Paranoiac fallback (name should never be null).
         }
         return Errors.format(Errors.Keys.IllegalOrdinateRange_3, lower, upper, name);
     }
@@ -414,7 +414,7 @@ scanNumber: while ((i += Character.charC
      *
      * @return The dimensionality of this envelope.
      */
-    @Override // Must also be overridden in SubEnvelope
+    @Override                                       // Must also be overridden in SubEnvelope
     public int getDimension() {
         return ordinates.length >>> 1;
     }
@@ -435,7 +435,7 @@ scanNumber: while ((i += Character.charC
     /**
      * {@inheritDoc}
      */
-    @Override // Must also be overridden in SubEnvelope
+    @Override                                       // Must also be overridden in SubEnvelope
     public double getLower(final int dimension) throws IndexOutOfBoundsException {
         ensureValidIndex(ordinates.length >>> 1, dimension);
         return ordinates[dimension];
@@ -444,7 +444,7 @@ scanNumber: while ((i += Character.charC
     /**
      * {@inheritDoc}
      */
-    @Override // Must also be overridden in SubEnvelope
+    @Override                                       // Must also be overridden in SubEnvelope
     public double getUpper(final int dimension) throws IndexOutOfBoundsException {
         final int d = ordinates.length >>> 1;
         ensureValidIndex(d, dimension);
@@ -459,7 +459,7 @@ scanNumber: while ((i += Character.charC
         ensureValidIndex(endIndex(), dimension);
         final int i = dimension + beginIndex();
         double lower = ordinates[i];
-        if (isNegative(ordinates[i + (ordinates.length >>> 1)] - lower)) { // Special
handling for -0.0
+        if (isNegative(ordinates[i + (ordinates.length >>> 1)] - lower)) {     
// Special handling for -0.0
             final CoordinateSystemAxis axis = getAxis(crs, dimension);
             lower = (axis != null) ? axis.getMinimumValue() : Double.NEGATIVE_INFINITY;
         }
@@ -474,7 +474,7 @@ scanNumber: while ((i += Character.charC
         ensureValidIndex(endIndex(), dimension);
         final int i = dimension + beginIndex();
         double upper = ordinates[i + (ordinates.length >>> 1)];
-        if (isNegative(upper - ordinates[i])) { // Special handling for -0.0
+        if (isNegative(upper - ordinates[i])) {                                 // Special
handling for -0.0
             final CoordinateSystemAxis axis = getAxis(crs, dimension);
             upper = (axis != null) ? axis.getMaximumValue() : Double.POSITIVE_INFINITY;
         }
@@ -491,7 +491,7 @@ scanNumber: while ((i += Character.charC
         final double minimum = ordinates[i];
         final double maximum = ordinates[i + (ordinates.length >>> 1)];
         double median = 0.5 * (minimum + maximum);
-        if (isNegative(maximum - minimum)) { // Special handling for -0.0
+        if (isNegative(maximum - minimum)) {                                    // Special
handling for -0.0
             median = fixMedian(getAxis(crs, dimension), median);
         }
         return median;
@@ -505,7 +505,7 @@ scanNumber: while ((i += Character.charC
         ensureValidIndex(endIndex(), dimension);
         final int i = dimension + beginIndex();
         double span = ordinates[i + (ordinates.length >>> 1)] - ordinates[i];
-        if (isNegative(span)) { // Special handling for -0.0
+        if (isNegative(span)) {                                                 // Special
handling for -0.0
             span = fixSpan(getAxis(crs, dimension), span);
         }
         return span;
@@ -524,7 +524,7 @@ scanNumber: while ((i += Character.charC
         final int d = ordinates.length >>> 1;
         for (int i=beginIndex; i<endIndex; i++) {
             final double span = ordinates[i+d] - ordinates[i];
-            if (!(span > 0)) { // Use '!' in order to catch NaN
+            if (!(span > 0)) {                                                  // Use
'!' in order to catch NaN
                 if (!(isNegative(span) && isWrapAround(crs, i - beginIndex))) {
                     return true;
                 }
@@ -537,7 +537,7 @@ scanNumber: while ((i += Character.charC
     /**
      * {@inheritDoc}
      */
-    @Override // Must also be overridden in SubEnvelope
+    @Override                                       // Must also be overridden in SubEnvelope
     public boolean isAllNaN() {
         for (int i=0; i<ordinates.length; i++) {
             if (!Double.isNaN(ordinates[i])) {
@@ -551,7 +551,7 @@ scanNumber: while ((i += Character.charC
     /**
      * {@inheritDoc}
      */
-    @Override // Must also be overridden in SubEnvelope
+    @Override                                       // Must also be overridden in SubEnvelope
     public int hashCode() {
         int code = Arrays.hashCode(ordinates);
         if (crs != null) {
@@ -572,7 +572,7 @@ scanNumber: while ((i += Character.charC
     /**
      * {@inheritDoc}
      */
-    @Override // Must also be overridden in SubEnvelope
+    @Override                                       // Must also be overridden in SubEnvelope
     public boolean equals(final Object object) {
         if (object != null && object.getClass() == getClass()) {
             final ArrayEnvelope that = (ArrayEnvelope) object;

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/geometry/Envelope2D.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/geometry/Envelope2D.java?rev=1737805&r1=1737804&r2=1737805&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/geometry/Envelope2D.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/geometry/Envelope2D.java
[UTF-8] Tue Apr  5 09:07:56 2016
@@ -233,7 +233,7 @@ public class Envelope2D extends Rectangl
     public Envelope2D(final CoordinateReferenceSystem crs, final Rectangle2D rect)
             throws MismatchedDimensionException
     {
-        super(rect.getX(), rect.getY(), rect.getWidth(), rect.getHeight()); // Really 'super',
not 'this'.
+        super(rect.getX(), rect.getY(), rect.getWidth(), rect.getHeight());     // Really
'super', not 'this'.
         ensureDimensionMatches("crs", DIMENSION, crs);
         this.crs = crs;
     }
@@ -256,7 +256,7 @@ public class Envelope2D extends Rectangl
     public Envelope2D(final CoordinateReferenceSystem crs, final double x, final double y,
             final double width, final double height) throws MismatchedDimensionException
     {
-        super(x, y, width, height); // Really 'super', not 'this'.
+        super(x, y, width, height);                             // Really 'super', not 'this'.
         ensureDimensionMatches("crs", DIMENSION, crs);
         this.crs = crs;
     }
@@ -364,7 +364,7 @@ public class Envelope2D extends Rectangl
             case 1:  value=y; span=height; break;
             default: throw indexOutOfBounds(dimension);
         }
-        if (isNegative(span)) { // Special handling for -0.0
+        if (isNegative(span)) {                                         // Special handling
for -0.0
             final CoordinateSystemAxis axis = getAxis(crs, dimension);
             return (axis != null) ? axis.getMinimumValue() : NEGATIVE_INFINITY;
         }
@@ -388,7 +388,7 @@ public class Envelope2D extends Rectangl
             case 1:  value=y; span=height; break;
             default: throw indexOutOfBounds(dimension);
         }
-        if (isNegative(span)) { // Special handling for -0.0
+        if (isNegative(span)) {                                         // Special handling
for -0.0
             final CoordinateSystemAxis axis = getAxis(crs, dimension);
             return (axis != null) ? axis.getMaximumValue() : POSITIVE_INFINITY;
         }
@@ -413,7 +413,7 @@ public class Envelope2D extends Rectangl
             default: throw indexOutOfBounds(dimension);
         }
         value += 0.5*span;
-        if (isNegative(span)) { // Special handling for -0.0
+        if (isNegative(span)) {                                         // Special handling
for -0.0
             value = fixMedian(getAxis(crs, dimension), value);
         }
         return value;
@@ -435,7 +435,7 @@ public class Envelope2D extends Rectangl
             case 1:  span=height; break;
             default: throw indexOutOfBounds(dimension);
         }
-        if (isNegative(span)) { // Special handling for -0.0
+        if (isNegative(span)) {                                         // Special handling
for -0.0
             span = fixSpan(getAxis(crs, dimension), span);
         }
         return span;
@@ -570,11 +570,12 @@ public class Envelope2D extends Rectangl
      *
      * @since 0.4
      */
+    @SuppressWarnings("ReturnOfCollectionOrArrayField")
     public Rectangle2D.Double[] toRectangles() {
-        int isWrapAround = 0; // A bitmask of the dimensions having a "wrap around" behavior.
+        int isWrapAround = 0;                   // A bitmask of the dimensions having a "wrap
around" behavior.
         for (int i=0; i!=DIMENSION; i++) {
             final double span = (i == 0) ? width : height;
-            if (!(span > 0)) { // Use '!' for catching NaN.
+            if (!(span > 0)) {                                                      //
Use '!' for catching NaN.
                 if (!isNegative(span) || !isWrapAround(crs, i)) {
                     return EMPTY;
                 }
@@ -614,7 +615,7 @@ public class Envelope2D extends Rectangl
              */
             final CoordinateSystemAxis axis = getAxis(crs, 1);
             final Rectangle2D.Double start = rect[0];
-            final Rectangle2D.Double next  = rect[isWrapAround - 1]; // == 1 if y is the
only wraparound axis, or 2 otherwise.
+            final Rectangle2D.Double next  = rect[isWrapAround - 1];    // == 1 if y is the
only wraparound axis, or 2 otherwise.
             start.height = axis.getMaximumValue() - y;
             next.y       = axis.getMinimumValue();
             next.height += y - next.y;
@@ -839,14 +840,14 @@ public class Envelope2D extends Rectangl
             /*
              * See GeneralEnvelope.intersect(Envelope) for an explanation of the algorithm
applied below.
              */
-            if (isSameSign(span0, span1)) { // Always 'false' if any value is NaN.
+            if (isSameSign(span0, span1)) {                 // Always 'false' if any value
is NaN.
                 if ((min1 > max0 || max1 < min0) && !isNegativeUnsafe(span0))
{
-                    continue; // No intersection: leave ordinate values to NaN
+                    continue;                               // No intersection: leave ordinate
values to NaN
                 }
             } else if (isNaN(span0) || isNaN(span1)) {
-                continue; // Leave ordinate values to NaN
+                continue;                                   // Leave ordinate values to NaN
             } else {
-                int intersect = 0; // A bitmask of intersections (two bits).
+                int intersect = 0;                          // A bitmask of intersections
(two bits).
                 if (isNegativeUnsafe(span0)) {
                     if (min1 <= max0) {min = min1; intersect  = 1;}
                     if (max1 >= min0) {max = max1; intersect |= 2;}
@@ -863,7 +864,7 @@ public class Envelope2D extends Rectangl
                         min = min1;
                         max = max1;
                     } else {
-                        continue; // Leave ordinate values to NaN
+                        continue;                           // Leave ordinate values to NaN
                     }
                 }
             }
@@ -931,7 +932,7 @@ public class Envelope2D extends Rectangl
             final boolean sp1 = isNegative(span1);
             if (sp0 == sp1) {
                 if (sp0 && !isNegativeUnsafe(max - min)) {
-                    continue; // Leave ordinates to NaN.
+                    continue;                                   // Leave ordinates to NaN.
                 }
             } else if (sp0) {
                 if (max1 <= max0 || min1 >= min0) {
@@ -941,7 +942,7 @@ public class Envelope2D extends Rectangl
                     final double left  = min1 - max0;
                     final double right = min0 - max1;
                     if (!(left > 0 || right > 0)) {
-                        continue; // Leave ordinates to NaN.
+                        continue;                               // Leave ordinates to NaN.
                     }
                     if (left > right) {min = min1; max = max0;}
                     if (right > left) {min = min0; max = max1;}
@@ -954,7 +955,7 @@ public class Envelope2D extends Rectangl
                     final double left  = min0 - max1;
                     final double right = min1 - max0;
                     if (!(left > 0 || right > 0)) {
-                        continue; // Leave ordinates to NaN.
+                        continue;                               // Leave ordinates to NaN.
                     }
                     if (left > right) {min = min0; max = max1;}
                     if (right > left) {min = min1; max = max0;}
@@ -1001,7 +1002,7 @@ public class Envelope2D extends Rectangl
     @Override
     public void add(final double px, final double py) {
         double off = px - x;
-        if (!isNegative(width)) { // Standard case, or NaN.
+        if (!isNegative(width)) {                           // Standard case, or NaN.
             if (off < 0) {x=px; width -= off;}
             if (off > width)   {width  = off;}
         } else if (off < 0) {

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/geometry/Envelopes.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/geometry/Envelopes.java?rev=1737805&r1=1737804&r2=1737805&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/geometry/Envelopes.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/geometry/Envelopes.java
[UTF-8] Tue Apr  5 09:07:56 2016
@@ -292,11 +292,11 @@ public final class Envelopes extends Sta
                         sourcePt, ordinates, offset, isDerivativeSupported);
             } catch (TransformException e) {
                 if (!isDerivativeSupported) {
-                    throw e; // Derivative were already disabled, so something went wrong.
+                    throw e;                    // Derivative were already disabled, so something
went wrong.
                 }
                 isDerivativeSupported = false;
                 transform.transform(sourcePt, 0, ordinates, offset, 1);
-                recoverableException(e); // Log only if the above call was successful.
+                recoverableException(e);        // Log only if the above call was successful.
             }
             /*
              * The transformed point has been saved for future reuse after the enclosing
@@ -324,10 +324,10 @@ public final class Envelopes extends Sta
             int indexBase3 = ++pointIndex;
             for (int dim=sourceDim; --dim>=0; indexBase3 /= 3) {
                 switch (indexBase3 % 3) {
-                    case 0:  sourcePt[dim] = envelope.getMinimum(dim); break; // Continue
the loop.
+                    case 0:  sourcePt[dim] = envelope.getMinimum(dim); break;   // Continue
the loop.
                     case 1:  sourcePt[dim] = envelope.getMaximum(dim); continue transformPoint;
                     case 2:  sourcePt[dim] = envelope.getMedian (dim); continue transformPoint;
-                    default: throw new AssertionError(indexBase3); // Should never happen
+                    default: throw new AssertionError(indexBase3);     // Should never happen
                 }
             }
             break;
@@ -691,9 +691,9 @@ public final class Envelopes extends Sta
                          * or skip c={2,3}.
                          */
                         double value = max;
-                        if ((c & 1) == 0) { // 'true' if we are testing "wrapAroundMin".
+                        if ((c & 1) == 0) {         // 'true' if we are testing "wrapAroundMin".
                             if (((c == 0 ? includedMinValue : includedMaxValue) & bm)
== 0) {
-                                c++; // Skip also the case for "wrapAroundMax".
+                                c++;                // Skip also the case for "wrapAroundMax".
                                 continue;
                             }
                             targetPt.setOrdinate(axisIndex, (c == 0) ? axis.getMinimumValue()
: axis.getMaximumValue());

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralDirectPosition.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralDirectPosition.java?rev=1737805&r1=1737804&r2=1737805&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralDirectPosition.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralDirectPosition.java
[UTF-8] Tue Apr  5 09:07:56 2016
@@ -127,7 +127,7 @@ public class GeneralDirectPosition exten
      * @param point The position to copy.
      */
     public GeneralDirectPosition(final DirectPosition point) {
-        ordinates = point.getCoordinate(); // Should already be cloned.
+        ordinates = point.getCoordinate();                              // Should already
be cloned.
         crs = point.getCoordinateReferenceSystem();
         ensureDimensionMatches("crs", ordinates.length, crs);
     }

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java?rev=1737805&r1=1737804&r2=1737805&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java
[UTF-8] Tue Apr  5 09:07:56 2016
@@ -313,7 +313,7 @@ public class GeneralEnvelope extends Arr
                 }
             }
         }
-        this.crs = crs; // Set only on success.
+        this.crs = crs;                                             // Set only on success.
     }
 
     /**
@@ -326,7 +326,7 @@ public class GeneralEnvelope extends Arr
      * @throws IllegalArgumentException If {@code lower > upper} and the axis range meaning
at the given dimension
      *         is not "wraparound". See <cite>Envelope validation</cite> in class
javadoc for more details.
      */
-    @Override // Must also be overridden in SubEnvelope
+    @Override                                                           // Must also be overridden
in SubEnvelope
     public void setRange(final int dimension, final double lower, final double upper)
             throws IndexOutOfBoundsException
     {
@@ -433,8 +433,7 @@ public class GeneralEnvelope extends Arr
      *
      * @see #isAllNaN()
      */
-    // Must be overridden in SubEnvelope
-    public void setToNaN() {
+    public void setToNaN() {                   // Must be overridden in SubEnvelope
         Arrays.fill(ordinates, Double.NaN);
         assert isAllNaN() : this;
     }
@@ -523,7 +522,7 @@ public class GeneralEnvelope extends Arr
             final double value = position.getOrdinate(i);
             final double min = ordinates[iLower];
             final double max = ordinates[iUpper];
-            if (!isNegative(max - min)) { // Standard case, or NaN.
+            if (!isNegative(max - min)) {                       // Standard case, or NaN.
                 if (value < min) ordinates[iLower] = value;
                 if (value > max) ordinates[iUpper] = value;
             } else {
@@ -622,7 +621,7 @@ public class GeneralEnvelope extends Arr
                 if (min1 < min0) ordinates[iLower] = min1;
                 if (max1 > max0) ordinates[iUpper] = max1;
                 if (!sp0 || isNegativeUnsafe(ordinates[iUpper] - ordinates[iLower])) {
-                    continue; // We are done, go to the next dimension.
+                    continue;               // We are done, go to the next dimension.
                 }
                 // If we were spanning the anti-meridian before the union but
                 // are not anymore after the union, we actually merged to two
@@ -638,8 +637,8 @@ public class GeneralEnvelope extends Arr
                  *     └────┘  │  │
                  *   ──────────┘  └─────
                  */
-                if (max1 <= max0) continue;  // This is the case of above picture.
-                if (min1 >= min0) continue;  // Like above picture, but on the right side.
+                if (max1 <= max0) continue;             // This is the case of above picture.
+                if (min1 >= min0) continue;             // Like above picture, but on
the right side.
                 /*
                  * At this point, the given envelope partially overlaps the "exclusion area"
                  * of this envelope or has NaN values. We will move at most one edge of this
@@ -655,8 +654,8 @@ public class GeneralEnvelope extends Arr
                     // The < and > checks below are not completly redundant.
                     // The difference is when a value is NaN.
                     if (left > right) ordinates[iLower] = min1;
-                    if (right > left) ordinates[iUpper] = max1; // This is the case illustrated
above.
-                    continue; // We are done, go to the next dimension.
+                    if (right > left) ordinates[iUpper] = max1;     // This is the case
illustrated above.
+                    continue;                                       // We are done, go to
the next dimension.
                 }
                 // If we reach this point, the given envelope fills completly the "exclusion
area"
                 // of this envelope. As a consequence this envelope is now spanning to infinities.
@@ -729,7 +728,7 @@ public class GeneralEnvelope extends Arr
             final double max1  = upper.getOrdinate(i);
             final double span0 = max0 - min0;
             final double span1 = max1 - min1;
-            if (isSameSign(span0, span1)) { // Always 'false' if any value is NaN.
+            if (isSameSign(span0, span1)) {                 // Always 'false' if any value
is NaN.
                 /*
                  * First, verify that the two envelopes intersect.
                  *     ┌──────────┐             ┌─────────────┐
@@ -757,7 +756,7 @@ public class GeneralEnvelope extends Arr
                     continue;
                 }
             } else {
-                int intersect = 0; // A bitmask of intersections (two bits).
+                int intersect = 0;                          // A bitmask of intersections
(two bits).
                 if (!Double.isNaN(span0) && !Double.isNaN(span1)) {
                     if (isNegativeUnsafe(span0)) {
                         /*

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/geometry/SubEnvelope.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/geometry/SubEnvelope.java?rev=1737805&r1=1737804&r2=1737805&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/geometry/SubEnvelope.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/geometry/SubEnvelope.java
[UTF-8] Tue Apr  5 09:07:56 2016
@@ -207,6 +207,7 @@ final class SubEnvelope extends GeneralE
      * If the user wants a clone, copy only the relevant part of the ordinates array.
      */
     @Override
+    @SuppressWarnings("CloneDoesntCallSuperClone")
     public GeneralEnvelope clone() {
         final int d = ordinates.length >>> 1;
         final int dimension = endIndex - beginIndex;



Mime
View raw message