← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19452: Codestyle

 

------------------------------------------------------------
revno: 19452
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2015-06-18 14:59:02 +0200
message:
  Codestyle
modified:
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/adx/ADXConstants.java
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/adx/DefaultADXDataService.java
  dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/adx/DefaultADXDataServiceTest.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/adx/ADXConstants.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/adx/ADXConstants.java	2015-06-18 12:42:19 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/adx/ADXConstants.java	2015-06-18 12:59:02 +0000
@@ -32,36 +32,35 @@
  *
  * @author bobj
  */
-public class ADXConstants
+public interface ADXConstants
 {
     //--------------------------------------------------------------------------
     // These are defined in the ADX standard
     //--------------------------------------------------------------------------
 
-    public static final String NAMESPACE = "urn:ihe:qrph:adx:2015";
-    
-    public static final String ROOT = "adx";
-
-    public static final String GROUP = "group";
-    
-    public static final String PERIOD = "period";
-    
-    public static final String ORGUNIT = "orgUnit";
-    
-    public static final String DATAELEMENT = "dataelement";
-
-    public static final String DATAVALUE = "dataValue";
-
-    public static final String VALUE = "value";
-
-    public static final String ANNOTATION = "annotation";
+    final String NAMESPACE = "urn:ihe:qrph:adx:2015";
+    
+    final String ROOT = "adx";
+
+    final String GROUP = "group";
+    
+    final String PERIOD = "period";
+    
+    final String ORGUNIT = "orgUnit";
+    
+    final String DATAELEMENT = "dataelement";
+
+    final String DATAVALUE = "dataValue";
+
+    final String VALUE = "value";
+
+    final String ANNOTATION = "annotation";
     
     //--------------------------------------------------------------------------
     // DHIS2 specific
     //--------------------------------------------------------------------------
 
-    public static final String CATOPTCOMBO = "categoryOptionCombo";
+    final String CATOPTCOMBO = "categoryOptionCombo";
     
-    public static final String ATTOPTCOMBO = "attributeOptionCombo";
-
+    final String ATTOPTCOMBO = "attributeOptionCombo";
 }

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/adx/DefaultADXDataService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/adx/DefaultADXDataService.java	2015-06-18 12:42:19 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/adx/DefaultADXDataService.java	2015-06-18 12:59:02 +0000
@@ -65,7 +65,6 @@
 public class DefaultADXDataService
     implements ADXDataService
 {
-
     protected DataValueSetService dataValueSetService;
 
     @Override
@@ -78,7 +77,6 @@
     public ImportSummaries postData( InputStream in, ImportOptions importOptions )
         throws IOException
     {
-
         XMLReader reader = XMLFactory.getXMLReader( in );
 
         ImportSummaries importSummaries = new ImportSummaries();
@@ -110,7 +108,8 @@
                 
                 // pass off to the dxf2 datavalueset service
                 importSummaries.addImportSummary( dataValueSetService.saveDataValueSet( dxfIn, importOptions ) );
-            } catch ( Exception ex )
+            } 
+            catch ( Exception ex )
             {
                 ImportSummary importSummary = new ImportSummary();
                 importSummary.setStatus( ImportStatus.ERROR );
@@ -179,6 +178,7 @@
         {
             attributes.put( reader.getAttributeLocalName( i ), reader.getAttributeValue( i ) );
         }
+        
         return attributes;
     }
 }

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/adx/DefaultADXDataServiceTest.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/adx/DefaultADXDataServiceTest.java	2015-06-18 12:42:19 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/adx/DefaultADXDataServiceTest.java	2015-06-18 12:59:02 +0000
@@ -52,7 +52,6 @@
  */
 public class DefaultADXDataServiceTest
 {
-
     protected static final String SIMPLE_ADX_SAMPLE = "adx/adx_data_sample1.xml";
 
     public DefaultADXDataServiceTest()
@@ -87,10 +86,8 @@
     {
         try
         {
-            System.out.println( "parseADXGroup" );
             XMLReader reader = XMLFactory.getXMLReader( new ClassPathResource( SIMPLE_ADX_SAMPLE ).getInputStream() );
             reader.moveToStartElement( ADXConstants.ROOT, ADXConstants.NAMESPACE );
-            System.out.println( "Parsing adx, exported: " + reader.getAttributeValue( "exported" ) );
 
             DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
             DocumentBuilder docBuilder;
@@ -100,7 +97,6 @@
 
             while ( reader.moveToStartElement( ADXConstants.GROUP, ADXConstants.NAMESPACE ) )
             {
-                System.out.println( "Parsing new group" );
                 Document dxf = docBuilder.newDocument();
                 instance.parseADXGroupToDxf( reader, dxf );
 
@@ -110,7 +106,6 @@
                 StreamResult result = new StreamResult( System.out );
 
                 transformer.transform( source, result );
-                System.out.println();
             }
         } 
         catch ( Exception ex )
@@ -118,5 +113,4 @@
             fail( ex.toString() );
         }
     }
-
 }