dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #32222
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16457: Removed unused code
------------------------------------------------------------
revno: 16457
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2014-08-20 16:33:02 +0200
message:
Removed unused code
modified:
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.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-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java 2014-08-15 07:40:20 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java 2014-08-20 14:33:02 +0000
@@ -28,7 +28,27 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import com.csvreader.CsvReader;
+import static com.google.common.collect.Sets.newHashSet;
+import static org.apache.commons.lang.StringUtils.trimToNull;
+import static org.hisp.dhis.common.IdentifiableObject.IdentifiableProperty.UUID;
+import static org.hisp.dhis.system.notification.NotificationLevel.ERROR;
+import static org.hisp.dhis.system.notification.NotificationLevel.INFO;
+import static org.hisp.dhis.system.util.ConversionUtils.wrap;
+import static org.hisp.dhis.system.util.DateUtils.getDefaultDate;
+import static org.hisp.dhis.system.util.DateUtils.parseDate;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.Writer;
+import java.nio.charset.Charset;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
import org.amplecode.quick.BatchHandler;
import org.amplecode.quick.BatchHandlerFactory;
import org.amplecode.staxwax.factory.XMLFactory;
@@ -72,26 +92,7 @@
import org.hisp.dhis.user.CurrentUserService;
import org.springframework.beans.factory.annotation.Autowired;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.Writer;
-import java.nio.charset.Charset;
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import static com.google.common.collect.Sets.newHashSet;
-import static org.apache.commons.lang.StringUtils.trimToNull;
-import static org.hisp.dhis.common.IdentifiableObject.IdentifiableProperty.UUID;
-import static org.hisp.dhis.system.notification.NotificationLevel.ERROR;
-import static org.hisp.dhis.system.notification.NotificationLevel.INFO;
-import static org.hisp.dhis.system.util.ConversionUtils.wrap;
-import static org.hisp.dhis.system.util.DateUtils.getDefaultDate;
-import static org.hisp.dhis.system.util.DateUtils.parseDate;
+import com.csvreader.CsvReader;
/**
* @author Lars Helge Overland
@@ -107,8 +108,6 @@
private static final String ERROR_INVALID_ORG_UNIT = "Invalid org unit: ";
- private static final String ERROR_INVALID_START_END_DATE = "Invalid start and/or end date: ";
-
private static final String ERROR_OBJECT_NEEDED_TO_COMPLETE = "Must be provided to complete data set";
@Autowired
@@ -722,42 +721,6 @@
summary.setDataSetComplete( DateUtils.getMediumDateString( completeDate ) );
}
- private Set<DataElement> getDataElements( Set<String> dataSets )
- {
- Set<DataElement> dataElements = new HashSet<>();
-
- for ( String ds : dataSets )
- {
- DataSet dataSet = dataSetService.getDataSet( ds );
-
- if ( dataSet == null )
- {
- throw new IllegalArgumentException( ERROR_INVALID_DATA_SET + ds );
- }
-
- dataElements.addAll( dataSet.getDataElements() );
- }
-
- return dataElements;
- }
-
- private Set<Period> getPeriods( Date startDate, Date endDate )
- {
- if ( startDate == null || endDate == null || endDate.before( startDate ) )
- {
- throw new IllegalArgumentException( ERROR_INVALID_START_END_DATE + startDate + ", " + endDate );
- }
-
- Set<Period> periods = new HashSet<>( periodService.getPeriodsBetweenDates( startDate, endDate ) );
-
- if ( periods.isEmpty() )
- {
- throw new IllegalArgumentException( "No periods exist for start/end date: " + startDate + ", " + endDate );
- }
-
- return periods;
- }
-
private Set<OrganisationUnit> getOrgUnits( Set<String> orgUnits )
{
Set<OrganisationUnit> organisationUnits = new HashSet<>();