← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16836: Setting @SafeVarargs

 

------------------------------------------------------------
revno: 16836
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2014-09-28 19:12:48 +0200
message:
  Setting @SafeVarargs
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/CombinationGenerator.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/DimensionalObjectUtils.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/MapMap.java
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/collection/SetBuilder.java
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/CollectionUtils.java
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ConversionUtils.java
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ListUtils.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroupset/AddGroupSetAction.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/CombinationGenerator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/CombinationGenerator.java	2014-08-15 07:40:20 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/CombinationGenerator.java	2014-09-28 17:12:48 +0000
@@ -40,7 +40,8 @@
     private int[] indexes; // Current index for each array
     private int no; // No of arrays
     
-    public CombinationGenerator( T[]... objects )
+    @SafeVarargs
+    public CombinationGenerator( final T[]... objects )
     {
         this.objects = objects;
         this.indexes = new int[objects.length];

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/DimensionalObjectUtils.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/DimensionalObjectUtils.java	2014-09-25 15:46:23 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/DimensionalObjectUtils.java	2014-09-28 17:12:48 +0000
@@ -147,7 +147,8 @@
      * @param elements the elements to put on the map.
      * @return a map.
      */
-    public static <T> Map<T, T> asMap( T... elements )
+    @SafeVarargs
+    public static final <T> Map<T, T> asMap( final T... elements )
     {
         Map<T, T> map = new HashMap<>();
         

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/MapMap.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/MapMap.java	2014-08-15 07:40:20 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/MapMap.java	2014-09-28 17:12:48 +0000
@@ -58,8 +58,9 @@
     {
         return this.get( key ) == null ? null : this.get( key ).get( valueKey );
     }
-
-    public static <T, U, V> MapMap<T, U, V> asMapMap( AbstractMap.SimpleEntry<T, Map<U, V>>... entries )
+    
+    @SafeVarargs
+    public static final <T, U, V> MapMap<T, U, V> asMapMap( final AbstractMap.SimpleEntry<T, Map<U, V>>... entries )
     {
         MapMap<T, U, V> map = new MapMap<>();
 

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/collection/SetBuilder.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/collection/SetBuilder.java	2014-08-15 07:40:20 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/collection/SetBuilder.java	2014-09-28 17:12:48 +0000
@@ -50,7 +50,8 @@
         return this;
     }
     
-    public SetBuilder<E> add( E... elements )
+    @SafeVarargs
+    public final SetBuilder<E> add( final E... elements )
     {
         for ( E element : elements )
         {

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/CollectionUtils.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/CollectionUtils.java	2014-08-15 07:40:20 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/CollectionUtils.java	2014-09-28 17:12:48 +0000
@@ -86,8 +86,9 @@
     {
         return collection != null ? collection : new HashSet<T>();
     }
-    
-    public static <T> Set<T> asSet( T... items )
+
+    @SafeVarargs
+    public static final <T> Set<T> asSet( final T... items )
     {
         Set<T> set = new HashSet<>();
         
@@ -117,7 +118,8 @@
      * @param entries any number of (key, value) pairs
      * @return Map of the entries
      */
-    public static <K, V> Map<K, V> asMap( AbstractMap.SimpleEntry<K, V>... entries )
+    @SafeVarargs
+    public static final <K, V> Map<K, V> asMap( final AbstractMap.SimpleEntry<K, V>... entries )
     {
         Map<K, V> map = new HashMap<>();
 

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ConversionUtils.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ConversionUtils.java	2014-08-15 07:40:20 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ConversionUtils.java	2014-09-28 17:12:48 +0000
@@ -228,9 +228,10 @@
      * @param objects the array of objects.
      * @return a List of objects.
      */
-    public static <T> List<T> getList( T... objects )
+    @SafeVarargs
+    public static final <T> List<T> getList( final T... objects )
     {
-        List<T> list = new ArrayList<>();
+        final List<T> list = new ArrayList<>();
 
         for ( T object : objects )
         {

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ListUtils.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ListUtils.java	2014-09-25 12:50:57 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ListUtils.java	2014-09-28 17:12:48 +0000
@@ -177,7 +177,8 @@
      * @param items the items which should be included in the Collection.
      * @return a Collection.
      */
-    public static <T> Collection<T> getCollection( T... items )
+    @SafeVarargs
+    public static final <T> Collection<T> getCollection( final T... items )
     {
         List<T> list = new ArrayList<>();
         
@@ -195,7 +196,8 @@
      * @param items the items which should be included in the List.
      * @return a List.
      */
-    public static <T> List<T> getList( T... items )
+    @SafeVarargs
+    public static final <T> List<T> getList( final T... items )
     {
         List<T> list = new ArrayList<>();
         
@@ -255,7 +257,7 @@
      * @return a union of the given lists.
      */
     @SafeVarargs
-    public static <T> List<T> union( final List<T>... lists )
+    public static final <T> List<T> union( final List<T>... lists )
     {
         final List<T> union = new ArrayList<>();
         

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroupset/AddGroupSetAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroupset/AddGroupSetAction.java	2014-09-26 10:43:08 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroupset/AddGroupSetAction.java	2014-09-28 17:12:48 +0000
@@ -29,7 +29,6 @@
  */
 
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
@@ -38,9 +37,9 @@
 import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroupSet;
+import org.hisp.dhis.system.util.AttributeUtils;
 
 import com.opensymphony.xwork2.Action;
-import org.hisp.dhis.system.util.AttributeUtils;
 
 /**
  * @author Lars Helge Overland