← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2896: Fixed ide warnings

 

------------------------------------------------------------
revno: 2896
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2011-02-23 00:17:50 +0100
message:
  Fixed ide warnings
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java
  dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/databrowser/jdbc/StatementManagerDataBrowserStore.java
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/xml/exporter/DefaultDhis14XMLExportService.java
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/mapping/DefaultObjectMappingGenerator.java
  dhis-2/dhis-services/dhis-service-importexport/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-services/dhis-service-importexport/src/test/java/org/hisp/dhis/importexport/dxf2/service/DataSetMappingTest.java
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/deletion/DefaultDeletionManager.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/resources/OrgUnitResource.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ValidateValueAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/state/DefaultSelectedStateManager.java
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/oust/manager/DefaultSelectionTreeManager.java
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/ouwt/manager/DefaultOrganisationUnitSelectionManager.java
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/ouwt/manager/DefaultTreeStateManager.java
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/util/CollectionUtils.java
  dhis-2/dhis-web/dhis-web-commons/src/test/java/org/hisp/dhis/ouwt/manager/SessionReplacerOUSManager.java
  dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/GetReportParamsAction.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/program/Program.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java	2011-01-14 16:14:22 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java	2011-02-22 23:17:50 +0000
@@ -281,7 +281,7 @@
 
                 // Compare property value with compare value
 
-                int i = ((Comparable) propertyValue).compareTo( (Comparable) criteria.getValue() );
+                int i = ((Comparable<Object>) propertyValue).compareTo( (Comparable<Object>) criteria.getValue() );
 
                 // Return validation criteria if criteria is not met
 

=== modified file 'dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/databrowser/jdbc/StatementManagerDataBrowserStore.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/databrowser/jdbc/StatementManagerDataBrowserStore.java	2011-02-22 05:38:30 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/databrowser/jdbc/StatementManagerDataBrowserStore.java	2011-02-22 23:17:50 +0000
@@ -1,22 +1,18 @@
 package org.hisp.dhis.databrowser.jdbc;
 
-
 import java.sql.Connection;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Statement;
-import java.util.List;
 import java.util.ArrayList;
 import java.util.Iterator;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.hisp.dhis.jdbc.StatementBuilder;
+import java.util.List;
+
 import org.amplecode.quick.StatementHolder;
 import org.amplecode.quick.StatementManager;
 import org.hisp.dhis.databrowser.DataBrowserStore;
 import org.hisp.dhis.databrowser.DataBrowserTable;
+import org.hisp.dhis.jdbc.StatementBuilder;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
 import org.hisp.dhis.system.util.Timer;
 
@@ -33,8 +29,6 @@
 
     private StatementManager statementManager;
 
-    private static final Log log = LogFactory.getLog( StatementManagerDataBrowserStore.class );
-
     public void setStatementManager( StatementManager statementManager )
     {
         this.statementManager = statementManager;

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/xml/exporter/DefaultDhis14XMLExportService.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/xml/exporter/DefaultDhis14XMLExportService.java	2011-02-22 23:05:45 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/xml/exporter/DefaultDhis14XMLExportService.java	2011-02-22 23:17:50 +0000
@@ -67,7 +67,6 @@
 import org.hisp.dhis.importexport.dhis14.xml.converter.xsd.UserRoleXSDConverter;
 import org.hisp.dhis.importexport.dhis14.xml.converter.xsd.UserXSDConverter;
 import org.hisp.dhis.indicator.IndicatorService;
-import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
 import org.hisp.dhis.period.PeriodService;
 
@@ -137,13 +136,6 @@
     {
         this.organisationUnitService = organisationUnitService;
     }
-
-    private OrganisationUnitGroupService organisationUnitGroupService;
-
-    public void setOrganisationUnitGroupService( OrganisationUnitGroupService organisationUnitGroupService )
-    {
-        this.organisationUnitGroupService = organisationUnitGroupService;
-    }
     
     // -------------------------------------------------------------------------
     // ExportService implementation

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/mapping/DefaultObjectMappingGenerator.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/mapping/DefaultObjectMappingGenerator.java	2011-02-02 17:56:01 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/mapping/DefaultObjectMappingGenerator.java	2011-02-22 23:17:50 +0000
@@ -391,8 +391,7 @@
     // Supportive methods
     // -------------------------------------------------------------------------
 
-    @SuppressWarnings( "unchecked" )
-    private Map<Object, Integer> getMapping( BatchHandler batchHandler, Map<Object, String> nameMap, boolean skipMapping )
+    private Map<Object, Integer> getMapping( BatchHandler<?> batchHandler, Map<Object, String> nameMap, boolean skipMapping )
     {
         batchHandler.init();
 

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/resources/META-INF/dhis/beans.xml	2011-02-21 10:32:35 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/resources/META-INF/dhis/beans.xml	2011-02-22 23:17:50 +0000
@@ -347,9 +347,7 @@
 		class="org.hisp.dhis.importexport.dhis14.xml.exporter.DefaultDhis14XMLExportService">
 		<property name="sessionFactory" ref="sessionFactory"/>
 		<property name="statementManager" ref="statementManager"/>
-                <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
-                <property name="organisationUnitGroupService"
-                  ref="org.hisp.dhis.organisationunit.OrganisationUnitGroupService" />
+		<property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
 		<property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
 		<property name="indicatorService" ref="org.hisp.dhis.indicator.IndicatorService" />
 		<property name="periodService" ref="org.hisp.dhis.period.PeriodService" />

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/test/java/org/hisp/dhis/importexport/dxf2/service/DataSetMappingTest.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/test/java/org/hisp/dhis/importexport/dxf2/service/DataSetMappingTest.java	2011-02-21 10:32:35 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/test/java/org/hisp/dhis/importexport/dxf2/service/DataSetMappingTest.java	2011-02-22 23:17:50 +0000
@@ -39,7 +39,6 @@
 import org.hisp.dhis.dataelement.DataElementCategoryService;
 import org.hisp.dhis.dataelement.DataElementService;
 import org.hisp.dhis.dataset.DataSetService;
-import org.hisp.dhis.datavalue.DataValue;
 import org.hisp.dhis.datavalue.DataValueService;
 import org.hisp.dhis.importexport.ImportException;
 import org.hisp.dhis.importexport.ImportParams;
@@ -109,5 +108,4 @@
     {
         return true;
     }
-
 }

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/deletion/DefaultDeletionManager.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/deletion/DefaultDeletionManager.java	2010-10-22 06:43:14 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/deletion/DefaultDeletionManager.java	2011-02-22 23:17:50 +0000
@@ -67,10 +67,9 @@
         this.handlers.addAll( deletionHandlers );
     }
     
-    @SuppressWarnings( "unchecked" )
     public void execute( Object object )
     {
-        Class clazz = object.getClass();
+        Class<?> clazz = object.getClass();
 
         if ( object instanceof OrganisationUnit )
         {

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/resources/OrgUnitResource.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/resources/OrgUnitResource.java	2011-02-21 06:51:20 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/resources/OrgUnitResource.java	2011-02-22 23:17:50 +0000
@@ -47,7 +47,6 @@
 import org.apache.commons.logging.LogFactory;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
-import org.hisp.dhis.web.api.model.ActivityPlan;
 import org.hisp.dhis.web.api.model.ActivityValue;
 import org.hisp.dhis.web.api.model.DataSet;
 import org.hisp.dhis.web.api.model.DataSetList;

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ValidateValueAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ValidateValueAction.java	2010-05-14 04:13:36 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ValidateValueAction.java	2011-02-22 23:17:50 +0000
@@ -282,7 +282,7 @@
                         String dbValue = patientDataValue.getValue();
                         Object compareValue = getObject( rightSide.getDataElement().getType(), dbValue );
 
-                        i = ((Comparable) objectValue).compareTo( (Comparable) compareValue );
+                        i = ((Comparable<Object>) objectValue).compareTo( (Comparable<Object>) compareValue );
                     }
 
                 }
@@ -302,7 +302,7 @@
                         String dbValue = patientDataValue.getValue();
                         Object compareValue = getObject( leftSide.getDataElement().getType(), dbValue );
 
-                        i = ((Comparable) compareValue).compareTo( (Comparable) objectValue );
+                        i = ((Comparable<Object>) compareValue).compareTo( (Comparable<Object>) objectValue );
                     }
                 }
                 

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/state/DefaultSelectedStateManager.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/state/DefaultSelectedStateManager.java	2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/state/DefaultSelectedStateManager.java	2011-02-22 23:17:50 +0000
@@ -95,7 +95,6 @@
         return selectionManager.getSelectedOrganisationUnit();
     }
 
-    @SuppressWarnings( "unchecked" )
     public void setSelectedPatient( Patient patient )
     {
         getSession().put( SESSION_KEY_SELECTED_PATIENT_ID, patient.getId() );
@@ -118,7 +117,6 @@
         getSession().remove( SESSION_KEY_SELECTED_PATIENT_ID );
     }
 
-    @SuppressWarnings( "unchecked" )
     public void setSelectedProgram( Program program )
     {
         getSession().put( SESSION_KEY_SELECTED_PROGRAM_ID, program.getId() );
@@ -141,7 +139,6 @@
         getSession().remove( SESSION_KEY_SELECTED_PROGRAM_ID );
     }
 
-    @SuppressWarnings( "unchecked" )
     public void setSelectedProgramStage( ProgramStage programStage )
     {
         getSession().put( SESSION_KEY_SELECTED_PROGRAMSTAGE_ID, programStage.getId() );
@@ -202,19 +199,16 @@
         return (Integer) getSession().get( SESSION_KEY_SELECTED_SEARCHING_ATTRIBUTE_ID );
     }
 
-    @SuppressWarnings( "unchecked" )
     public void setListAll( boolean listAll )
     {
         getSession().put( SESSION_KEY_LISTALL, listAll );
     }
 
-    @SuppressWarnings( "unchecked" )
     public void setSearchText( String searchText )
     {
         getSession().put( SESSION_KEY_SPECIFIED_SEARCH_TEXT, searchText );
     }
 
-    @SuppressWarnings( "unchecked" )
     public void setSearchingAttributeId( int searchingAttributeId )
     {
         getSession().put( SESSION_KEY_SELECTED_SEARCHING_ATTRIBUTE_ID, searchingAttributeId );
@@ -224,8 +218,7 @@
     // Support methods
     // -------------------------------------------------------------------------
 
-    @SuppressWarnings( "unchecked" )
-    private static final Map getSession()
+    private static final Map<String, Object> getSession()
     {
         return ActionContext.getContext().getSession();
     }

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/oust/manager/DefaultSelectionTreeManager.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/oust/manager/DefaultSelectionTreeManager.java	2011-02-18 20:20:07 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/oust/manager/DefaultSelectionTreeManager.java	2011-02-22 23:17:50 +0000
@@ -203,12 +203,11 @@
     // Session methods
     // -------------------------------------------------------------------------
 
-    protected Map getSession()
+    protected Map<String, Object> getSession()
     {
         return ActionContext.getContext().getSession();
     }
 
-    @SuppressWarnings( "unchecked" )
     private final void saveToSession( String key, Object object )
     {
         getSession().put( key, object );

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/ouwt/manager/DefaultOrganisationUnitSelectionManager.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/ouwt/manager/DefaultOrganisationUnitSelectionManager.java	2011-02-18 20:20:07 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/ouwt/manager/DefaultOrganisationUnitSelectionManager.java	2011-02-22 23:17:50 +0000
@@ -200,12 +200,11 @@
     // Session methods
     // -------------------------------------------------------------------------
 
-    protected Map getSession()
+    protected Map<String, Object> getSession()
     {
         return ActionContext.getContext().getSession();
     }
 
-    @SuppressWarnings( "unchecked" )
     private final void saveToSession( String key, Object object )
     {
         getSession().put( key, object );

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/ouwt/manager/DefaultTreeStateManager.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/ouwt/manager/DefaultTreeStateManager.java	2011-02-18 20:20:07 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/ouwt/manager/DefaultTreeStateManager.java	2011-02-22 23:17:50 +0000
@@ -143,7 +143,7 @@
         return treeState;
     }
 
-    protected Map getSession()
+    protected Map<String, Object> getSession()
     {
         return ActionContext.getContext().getSession();
     }

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/util/CollectionUtils.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/util/CollectionUtils.java	2010-10-21 14:24:15 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/util/CollectionUtils.java	2011-02-22 23:17:50 +0000
@@ -54,7 +54,7 @@
             return map;
         }
 
-        Class elementClass = collection.iterator().next().getClass();
+        Class<?> elementClass = collection.iterator().next().getClass();
 
         Method getKeyMethod;
 
@@ -99,7 +99,7 @@
             return valueList;
         }
 
-        Class elementClass = list.iterator().next().getClass();
+        Class<?> elementClass = list.iterator().next().getClass();
 
         Method getValueMethod;
 

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/test/java/org/hisp/dhis/ouwt/manager/SessionReplacerOUSManager.java'
--- dhis-2/dhis-web/dhis-web-commons/src/test/java/org/hisp/dhis/ouwt/manager/SessionReplacerOUSManager.java	2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/test/java/org/hisp/dhis/ouwt/manager/SessionReplacerOUSManager.java	2011-02-22 23:17:50 +0000
@@ -37,9 +37,9 @@
 public class SessionReplacerOUSManager
     extends DefaultOrganisationUnitSelectionManager
 {
-    private Map<Object, Object> session = new HashMap<Object, Object>();
+    private Map<String, Object> session = new HashMap<String, Object>();
 
-    protected Map<Object, Object> getSession()
+    protected Map<String, Object> getSession()
     {
         return session;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/GetReportParamsAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/GetReportParamsAction.java	2011-02-22 23:05:45 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/GetReportParamsAction.java	2011-02-22 23:17:50 +0000
@@ -41,7 +41,6 @@
 import org.hisp.dhis.period.Period;
 import org.hisp.dhis.period.PeriodType;
 import org.hisp.dhis.report.Report;
-import org.hisp.dhis.report.ReportService;
 import org.hisp.dhis.reporttable.ReportParams;
 import org.hisp.dhis.reporttable.ReportTable;
 import org.hisp.dhis.reporttable.ReportTableService;