=== 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 */ -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 objects = new ArrayList( (Collection) ReflectionUtils.getFieldObject( field, metaData ) ); + List objects = new ArrayList<>( (Collection) ReflectionUtils.getFieldObject( field, metaData ) ); if ( !objects.isEmpty() ) { @@ -143,7 +141,7 @@ identifiableObject.setHref( ContextUtils.getPathWithUid( identifiableObject ) ); } - List fields = new ArrayList(); + List fields = new ArrayList<>(); fields.addAll( ReflectionUtils.collectFields( object.getClass() ) ); if ( !deep ) @@ -183,4 +181,7 @@ } } + private WebUtils() + { + } }