sis-commits mailing list archives

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

URL: http://svn.apache.org/r1585003
Log:
Merge from the JDK8 branch.

Modified:
    sis/branches/JDK7/   (props changed)
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/RangeFormat.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/measure/RangeFormatTest.java
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/collection/RangeSetTest.java
    sis/branches/JDK7/ide-project/NetBeans/nbproject/project.properties

Propchange: sis/branches/JDK7/
------------------------------------------------------------------------------
  Merged /sis/branches/JDK8:r1584987-1585002

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/RangeFormat.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/RangeFormat.java?rev=1585003&r1=1585002&r2=1585003&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/RangeFormat.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/RangeFormat.java
[UTF-8] Sat Apr  5 06:16:38 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/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java?rev=1585003&r1=1585002&r2=1585003&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java [UTF-8]
(original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java [UTF-8]
Sat Apr  5 06:16:38 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/JDK7/core/sis-utility/src/test/java/org/apache/sis/measure/RangeFormatTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/measure/RangeFormatTest.java?rev=1585003&r1=1585002&r2=1585003&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/measure/RangeFormatTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/measure/RangeFormatTest.java
[UTF-8] Sat Apr  5 06:16:38 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/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/collection/RangeSetTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/collection/RangeSetTest.java?rev=1585003&r1=1585002&r2=1585003&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/collection/RangeSetTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/collection/RangeSetTest.java
[UTF-8] Sat Apr  5 06:16:38 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());
     }
 

Modified: sis/branches/JDK7/ide-project/NetBeans/nbproject/project.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/ide-project/NetBeans/nbproject/project.properties?rev=1585003&r1=1585002&r2=1585003&view=diff
==============================================================================
--- sis/branches/JDK7/ide-project/NetBeans/nbproject/project.properties [ISO-8859-1] (original)
+++ sis/branches/JDK7/ide-project/NetBeans/nbproject/project.properties [ISO-8859-1] Sat Apr
 5 06:16:38 2014
@@ -116,6 +116,7 @@ javac.processorpath=\
 javac.test.classpath=\
     ${javac.classpath}:\
     ${maven.repository}/junit/junit/${junit.version}/junit-${junit.version}.jar:\
+    ${maven.repository}/org/hamcrest/hamcrest-core/${hamcrest.version}/hamcrest-core-${hamcrest.version}.jar:\
     ${maven.repository}/gov/nist/math/jama/${jama.version}/jama-${jama.version}.jar:\
     ${project.GeoAPI}/dist/geoapi-tests.jar:\
     ${build.classes.dir}
@@ -127,7 +128,6 @@ run.classpath=\
 run.test.classpath=\
     ${javac.test.classpath}:\
     ${build.test.classes.dir}:\
-    ${maven.repository}/org/hamcrest/hamcrest-core/${hamcrest.version}/hamcrest-core-${hamcrest.version}.jar:\
     ${maven.repository}/org/jdom/jdom2/${jdom2.version}/jdom2-${jdom2.version}.jar:\
     ${maven.repository}/edu/ucar/udunits/${netcdf.version}/udunits-${netcdf.version}.jar:\
     ${maven.repository}/joda-time/joda-time/${joda-time.version}/joda-time-${joda-time.version}.jar:\



Mime
View raw message