dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #16811
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6493: minor change
------------------------------------------------------------
revno: 6493
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2012-04-05 16:15:06 +0200
message:
minor change
modified:
dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/AbstractImporter.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-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/AbstractImporter.java'
--- dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/AbstractImporter.java 2012-04-05 11:56:10 +0000
+++ dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/AbstractImporter.java 2012-04-05 14:15:06 +0000
@@ -112,14 +112,15 @@
@Override
public List<ImportConflict> importCollection( List<T> objects, ImportOptions options )
{
- if ( !objects.isEmpty() )
- {
- T object = objects.get( 0 );
- reset( object );
- }
-
List<ImportConflict> conflicts = new ArrayList<ImportConflict>();
+ if ( objects.isEmpty() )
+ {
+ return conflicts;
+ }
+
+ reset( objects.get( 0 ) );
+
for ( T object : objects )
{
ImportConflict importConflict = importObjectLocal( object, options );
@@ -136,7 +137,7 @@
@Override
public ImportConflict importObject( T object, ImportOptions options )
{
- if ( object != null )
+ if ( object == null )
{
reset( object );
}
@@ -165,7 +166,7 @@
imports = 0;
updates = 0;
ignores = 0;
-
+
uidMap = manager.getIdMap( (Class<T>) type.getClass(), IdentifiableObject.IdentifiableProperty.UID );
nameMap = manager.getIdMap( (Class<T>) type.getClass(), IdentifiableObject.IdentifiableProperty.NAME );
codeMap = manager.getIdMap( (Class<T>) type.getClass(), IdentifiableObject.IdentifiableProperty.CODE );