← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12655: minor changes, make some fields final

 

------------------------------------------------------------
revno: 12655
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-10-15 09:40:07 +0200
message:
  minor changes, make some fields final
modified:
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/DefaultInputValidationService.java
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/AbstractEnrollmentService.java
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/JacksonEnrollmentService.java
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/AbstractEventService.java
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/JacksonEventService.java
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/person/DateOfBirth.java
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/person/JacksonPersonService.java
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/ExchangeClasses.java
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/pdfform/DefaultPdfDataEntryFormService.java
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/pdfform/PdfFormFontSettings.java
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/utils/JacksonUtils.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/DefaultInputValidationService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/DefaultInputValidationService.java	2013-10-07 17:58:57 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/DefaultInputValidationService.java	2013-10-15 07:40:07 +0000
@@ -59,7 +59,7 @@
         this._format = format;
     }
 
-    public I18nFormat getFormat()
+    I18nFormat getFormat()
     {
         if ( _format != null )
         {

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/AbstractEnrollmentService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/AbstractEnrollmentService.java	2013-10-07 17:58:57 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/AbstractEnrollmentService.java	2013-10-15 07:40:07 +0000
@@ -81,7 +81,7 @@
         this._format = format;
     }
 
-    public I18nFormat getFormat()
+    I18nFormat getFormat()
     {
         if ( _format != null )
         {

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/JacksonEnrollmentService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/JacksonEnrollmentService.java	2013-09-20 15:12:37 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/JacksonEnrollmentService.java	2013-10-15 07:40:07 +0000
@@ -50,8 +50,9 @@
     // EnrollmentService Impl
     // -------------------------------------------------------------------------
 
-    private static ObjectMapper xmlMapper = new XmlMapper();
-    private static ObjectMapper jsonMapper = new ObjectMapper();
+    private final static ObjectMapper xmlMapper = new XmlMapper();
+
+    private final static ObjectMapper jsonMapper = new ObjectMapper();
 
     @SuppressWarnings("unchecked")
     private static <T> T fromXml( InputStream inputStream, Class<?> clazz ) throws IOException

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/AbstractEventService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/AbstractEventService.java	2013-09-27 12:47:27 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/AbstractEventService.java	2013-10-15 07:40:07 +0000
@@ -121,7 +121,7 @@
         this._format = format;
     }
 
-    public I18nFormat getFormat()
+    I18nFormat getFormat()
     {
         if ( _format != null )
         {

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/JacksonEventService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/JacksonEventService.java	2013-09-20 15:12:37 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/JacksonEventService.java	2013-10-15 07:40:07 +0000
@@ -60,8 +60,9 @@
     // EventService Impl
     // -------------------------------------------------------------------------
 
-    private static ObjectMapper xmlMapper = new XmlMapper();
-    private static ObjectMapper jsonMapper = new ObjectMapper();
+    private final static ObjectMapper xmlMapper = new XmlMapper();
+
+    private final static ObjectMapper jsonMapper = new ObjectMapper();
 
     @SuppressWarnings( "unchecked" )
     private static <T> T fromXml( InputStream inputStream, Class<?> clazz ) throws IOException

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/person/DateOfBirth.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/person/DateOfBirth.java	2013-09-18 12:19:37 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/person/DateOfBirth.java	2013-10-15 07:40:07 +0000
@@ -42,16 +42,17 @@
 @JacksonXmlRootElement( localName = "dateOfBirth", namespace = DxfNamespaces.DXF_2_0 )
 public class DateOfBirth
 {
-    private Date date;
-
-    private DateOfBirthType type;
-
-    private Integer age;
+    private final Date date;
+
+    private final DateOfBirthType type;
+
+    private final Integer age;
 
     public DateOfBirth()
     {
         this.type = DateOfBirthType.APPROXIMATE;
         this.age = 0;
+        this.date = Patient.getBirthFromAge( age, Patient.AGE_TYPE_YEAR );
     }
 
     public DateOfBirth( Date date )

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/person/JacksonPersonService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/person/JacksonPersonService.java	2013-09-20 15:12:37 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/person/JacksonPersonService.java	2013-10-15 07:40:07 +0000
@@ -55,8 +55,9 @@
     // Implementation
     // -------------------------------------------------------------------------
 
-    private static ObjectMapper xmlMapper = new XmlMapper();
-    private static ObjectMapper jsonMapper = new ObjectMapper();
+    private final static ObjectMapper xmlMapper = new XmlMapper();
+
+    private final static ObjectMapper jsonMapper = new ObjectMapper();
 
     @SuppressWarnings( "unchecked" )
     private static <T> T fromXml( InputStream inputStream, Class<?> clazz ) throws IOException

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/ExchangeClasses.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/ExchangeClasses.java	2013-10-08 10:20:06 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/ExchangeClasses.java	2013-10-15 07:40:07 +0000
@@ -89,16 +89,13 @@
 final public class ExchangeClasses
 {
     // all available classes for export, used for controllers etc
-    private static Map<Class<? extends IdentifiableObject>, String> allExportClasses;
+    private final static Map<Class<? extends IdentifiableObject>, String> allExportClasses;
 
     // these are the ones that are available for dxf2 export
-    private static Map<Class<? extends IdentifiableObject>, String> exportClasses;
+    private final static Map<Class<? extends IdentifiableObject>, String> exportClasses;
 
     // these are the ones that are available for dxf2 import
-    private static Map<Class<? extends IdentifiableObject>, String> importClasses;
-
-    // these will be listed on the global resource page
-    private static Map<Class<? extends IdentifiableObject>, String> publicResourceClasses;
+    private final static Map<Class<? extends IdentifiableObject>, String> importClasses;
 
     static
     {

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/pdfform/DefaultPdfDataEntryFormService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/pdfform/DefaultPdfDataEntryFormService.java	2013-10-02 06:24:18 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/pdfform/DefaultPdfDataEntryFormService.java	2013-10-15 07:40:07 +0000
@@ -93,9 +93,9 @@
 
     private static final int PERIODRANGE_FUTUREYEARS = 2;
 
-    private static Integer MAX_OPTIONS_DISPLAYED = 30;
+    private static final Integer MAX_OPTIONS_DISPLAYED = 30;
 
-    private static Integer PROGRAM_FORM_ROW_NUMBER = 10;
+    private static final Integer PROGRAM_FORM_ROW_NUMBER = 10;
 
     private PdfFormFontSettings pdfFormFontSettings;
 

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/pdfform/PdfFormFontSettings.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/pdfform/PdfFormFontSettings.java	2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/pdfform/PdfFormFontSettings.java	2013-10-15 07:40:07 +0000
@@ -61,7 +61,7 @@
 
     private final static String FONTFAMILY = "HELVETICA";
 
-    private Map<Integer, Font> fontTypeMap = new HashMap<Integer, Font>();
+    private final Map<Integer, Font> fontTypeMap = new HashMap<Integer, Font>();
 
     public PdfFormFontSettings()
     {

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/utils/JacksonUtils.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/utils/JacksonUtils.java	2013-09-25 12:30:15 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/utils/JacksonUtils.java	2013-10-15 07:40:07 +0000
@@ -57,11 +57,11 @@
  */
 public class JacksonUtils
 {
-    private static ObjectMapper jsonMapper = new ObjectMapper();
-
-    private static XmlMapper xmlMapper = new XmlMapper();
-
-    private static Map<String, Class<?>> viewClasses = new HashMap<String, Class<?>>();
+    private final static ObjectMapper jsonMapper = new ObjectMapper();
+
+    private final static XmlMapper xmlMapper = new XmlMapper();
+
+    private final static Map<String, Class<?>> viewClasses = new HashMap<String, Class<?>>();
 
     static
     {