sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1585001 - in /sis/branches/JDK8/core/sis-utility/src: main/java/org/apache/sis/measure/ main/java/org/apache/sis/util/ test/java/org/apache/sis/measure/ test/java/org/apache/sis/util/collection/
Date Sat, 05 Apr 2014 06:06:34 GMT
Author: desruisseaux
Date: Sat Apr  5 06:06:34 2014
New Revision: 1585001

URL: http://svn.apache.org/r1585001
Log:
Fixed compilation errors.

Modified:
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/RangeFormat.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java
    sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/measure/RangeFormatTest.java
    sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/util/collection/RangeSetTest.java

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/RangeFormat.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/RangeFormat.java?rev=1585001&r1=1585000&r2=1585001&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/RangeFormat.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/RangeFormat.java
[UTF-8] Sat Apr  5 06:06:34 2014
@@ -771,6 +771,7 @@ public class RangeFormat extends Format 
      * need to be reset to -1.  In case of failure (including an exception being thrown),
the
      * parse index is undetermined and need to be reset to its initial value.
      */
+    @SuppressWarnings({"unchecked","rawtypes"})
     private Range<?> tryParse(final String source, final ParsePosition pos)
             throws UnconvertibleObjectException
     {
@@ -971,7 +972,6 @@ public class RangeFormat extends Format 
          * than a more specialized type, the finest suitable type will be determined.
          */
         if (Number.class.isAssignableFrom(elementType)) {
-            @SuppressWarnings({"unchecked","rawtypes"})
             Class<? extends Number> type = (Class) elementType;
             Number min = (Number) minValue;
             Number max = (Number) maxValue;
@@ -983,25 +983,16 @@ public class RangeFormat extends Format 
             if (min.doubleValue() == Double.NEGATIVE_INFINITY) min = null;
             if (max.doubleValue() == Double.POSITIVE_INFINITY) max = null;
             if (unit != null) {
-                @SuppressWarnings({"unchecked","rawtypes"})
                 final MeasurementRange<?> range = new MeasurementRange(type, min, isMinIncluded,
max, isMaxIncluded, unit);
                 return range;
             }
-            @SuppressWarnings({"unchecked","rawtypes"})
-            final NumberRange<?> range = new NumberRange(type, min, isMinIncluded,
max, isMaxIncluded);
-            return range;
+            return new NumberRange(type, min, isMinIncluded, max, isMaxIncluded);
         } else if (Date.class.isAssignableFrom(elementType)) {
-            final Date min = (Date) minValue;
-            final Date max = (Date) maxValue;
-            return new Range<>(Date.class, min, isMinIncluded, max, isMaxIncluded);
+            return new Range(Date.class, (Date) minValue, isMinIncluded, (Date) maxValue,
isMaxIncluded);
         } else {
-            @SuppressWarnings({"unchecked","rawtypes"})
-            final Class<? extends Comparable<?>> type = (Class) elementType;
-            final Comparable<?> min = (Comparable<?>) minValue;
-            final Comparable<?> max = (Comparable<?>) maxValue;
-            @SuppressWarnings({"unchecked","rawtypes"})
-            final Range<?> range = new Range(type, min, isMinIncluded, max, isMaxIncluded);
-            return range;
+            return new Range(elementType,
+                    (Comparable<?>) minValue, isMinIncluded,
+                    (Comparable<?>) maxValue, isMaxIncluded);
         }
     }
 

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java?rev=1585001&r1=1585000&r2=1585001&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java [UTF-8]
(original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java [UTF-8]
Sat Apr  5 06:06:34 2014
@@ -58,7 +58,8 @@ public final class Classes extends Stati
     /**
      * An empty array of classes.
      */
-    private static final Class<?>[] EMPTY_ARRAY = new Class<?>[0];
+    @SuppressWarnings({"unchecked","rawtypes"})
+    private static final Class<Object>[] EMPTY_ARRAY = new Class[0];
 
     /**
      * Methods to be rejected by {@link #isPossibleGetter(Method)}. They are mostly methods
inherited

Modified: sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/measure/RangeFormatTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/measure/RangeFormatTest.java?rev=1585001&r1=1585000&r2=1585001&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/measure/RangeFormatTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/measure/RangeFormatTest.java
[UTF-8] Sat Apr  5 06:06:34 2014
@@ -166,14 +166,14 @@ public final strictfp class RangeFormatT
         assertEquals("maxPos.endIndex",   7, maxPos.getEndIndex());
 
         // Positive infinity with integers
-        assertEquals("[50 … ∞)", format(new NumberRange<>(Integer.class, 50, true,
null, true)));
+        assertEquals("[50 … ∞)", format(new NumberRange<Integer>(Integer.class,
50, true, null, true)));
         assertEquals("minPos.beginIndex", 1, minPos.getBeginIndex());
         assertEquals("minPos.endIndex",   3, minPos.getEndIndex());
         assertEquals("maxPos.beginIndex", 6, maxPos.getBeginIndex());
         assertEquals("maxPos.endIndex",   7, maxPos.getEndIndex());
 
         // Negative infinity with integers
-        assertEquals("(-∞ … 40]", format(new NumberRange<>(Integer.class, null,
true, 40, true)));
+        assertEquals("(-∞ … 40]", format(new NumberRange<Integer>(Integer.class,
null, true, 40, true)));
         assertEquals("minPos.beginIndex", 1, minPos.getBeginIndex());
         assertEquals("minPos.endIndex",   3, minPos.getEndIndex());
         assertEquals("maxPos.beginIndex", 6, maxPos.getBeginIndex());

Modified: sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/util/collection/RangeSetTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/util/collection/RangeSetTest.java?rev=1585001&r1=1585000&r2=1585001&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/util/collection/RangeSetTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/util/collection/RangeSetTest.java
[UTF-8] Sat Apr  5 06:06:34 2014
@@ -159,8 +159,8 @@ public final strictfp class RangeSetTest
          * Verify the RangeSet content.
          */
         final Iterator<Range<Date>> it = ranges.iterator();
-        assertEqual(new Range<>(Date.class, lastWeek,  true, other, false), it.next(),
ranges.first());
-        assertEqual(new Range<>(Date.class, yesterday, true, now,   false), it.next(),
ranges.last());
+        assertEqual(new Range<Date>(Date.class, lastWeek,  true, other, false), it.next(),
ranges.first());
+        assertEqual(new Range<Date>(Date.class, yesterday, true, now,   false), it.next(),
ranges.last());
         assertFalse(it.hasNext());
     }
 
@@ -189,8 +189,8 @@ public final strictfp class RangeSetTest
          * Verify the RangeSet content.
          */
         final Iterator<Range<String>> it = ranges.iterator();
-        assertEqual(new Range<>(String.class, "FAA", true, "FCC", false), it.next(),
ranges.first());
-        assertEqual(new Range<>(String.class, "GAA", true, "GBB", false), it.next(),
ranges.last());
+        assertEqual(new Range<String>(String.class, "FAA", true, "FCC", false), it.next(),
ranges.first());
+        assertEqual(new Range<String>(String.class, "GAA", true, "GBB", false), it.next(),
ranges.last());
         assertFalse(it.hasNext());
     }
 



Mime
View raw message