← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15484: minor cleanup

 

------------------------------------------------------------
revno: 15484
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2014-05-31 15:34:18 +0200
message:
  minor cleanup
modified:
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/utils/WebUtils.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-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/utils/WebUtils.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/utils/WebUtils.java	2014-05-22 12:40:24 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/utils/WebUtils.java	2014-05-31 13:34:18 +0000
@@ -28,28 +28,26 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static org.hisp.dhis.system.util.PredicateUtils.alwaysTrue;
-
-import java.lang.reflect.Field;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.hisp.dhis.webapi.controller.WebMetaData;
 import org.hisp.dhis.common.DimensionalObject;
 import org.hisp.dhis.common.IdentifiableObject;
 import org.hisp.dhis.common.Pager;
 import org.hisp.dhis.system.util.ReflectionUtils;
 import org.hisp.dhis.user.UserCredentials;
+import org.hisp.dhis.webapi.controller.WebMetaData;
+
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import static org.hisp.dhis.system.util.PredicateUtils.alwaysTrue;
 
 /**
- * TODO too many inner classes, need to be split up
- *
  * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
  */
-public class WebUtils
+final public class WebUtils
 {
     private static final Log log = LogFactory.getLog( WebUtils.class );
 
@@ -68,7 +66,7 @@
             if ( ReflectionUtils.isCollection( field.getName(), metaData, IdentifiableObject.class ) ||
                 ReflectionUtils.isCollection( field.getName(), metaData, DimensionalObject.class ) )
             {
-                List<Object> objects = new ArrayList<Object>( (Collection<?>) ReflectionUtils.getFieldObject( field, metaData ) );
+                List<Object> objects = new ArrayList<>( (Collection<?>) ReflectionUtils.getFieldObject( field, metaData ) );
 
                 if ( !objects.isEmpty() )
                 {
@@ -143,7 +141,7 @@
             identifiableObject.setHref( ContextUtils.getPathWithUid( identifiableObject ) );
         }
 
-        List<Field> fields = new ArrayList<Field>();
+        List<Field> fields = new ArrayList<>();
         fields.addAll( ReflectionUtils.collectFields( object.getClass() ) );
 
         if ( !deep )
@@ -183,4 +181,7 @@
         }
     }
 
+    private WebUtils()
+    {
+    }
 }