← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3846: Code style fixed.

 

------------------------------------------------------------
revno: 3846
committer: Hieu <hieu.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2011-06-07 12:46:18 +0700
message:
  Code style fixed.
modified:
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/hibernate/HibernateDataElementStore.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/indicator/hibernate/HibernateIndicatorStore.java
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetPeriodTypesAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lock/GetPeriodsForLockAction.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-core/src/main/java/org/hisp/dhis/dataelement/hibernate/HibernateDataElementStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/hibernate/HibernateDataElementStore.java	2011-04-24 15:50:02 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/hibernate/HibernateDataElementStore.java	2011-06-07 05:46:18 +0000
@@ -57,7 +57,8 @@
  *          larshelg $
  */
 public class HibernateDataElementStore
-    extends HibernateGenericStore<DataElement> implements DataElementStore
+    extends HibernateGenericStore<DataElement>
+    implements DataElementStore
 {
     // -------------------------------------------------------------------------
     // Dependencies
@@ -334,7 +335,7 @@
     {
         return getLikeName( name );
     }
-    
+
     public Collection<DataElement> getDataElementsBetween( int first, int max )
     {
         return getBetween( first, max );
@@ -354,7 +355,7 @@
     {
         return getCountByName( name );
     }
-    
+
     // -------------------------------------------------------------------------
     // DataElementOperand
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/indicator/hibernate/HibernateIndicatorStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/indicator/hibernate/HibernateIndicatorStore.java	2011-05-20 08:01:23 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/indicator/hibernate/HibernateIndicatorStore.java	2011-06-07 05:46:18 +0000
@@ -41,15 +41,16 @@
  * @author Lars Helge Overland
  * @version $Id: HibernateIndicatorStore.java 3287 2007-05-08 00:26:53Z larshelg $
  */
-public class HibernateIndicatorStore 
-    extends HibernateGenericStore<Indicator> implements IndicatorStore
+public class HibernateIndicatorStore
+    extends HibernateGenericStore<Indicator>
+    implements IndicatorStore
 {
     // -------------------------------------------------------------------------
     // Indicator
     // -------------------------------------------------------------------------
 
     public int addIndicator( Indicator indicator )
-    {        
+    {
         Session session = sessionFactory.getCurrentSession();
 
         return (Integer) session.save( indicator );
@@ -79,21 +80,21 @@
     public Indicator getIndicator( String uuid )
     {
         Session session = sessionFactory.getCurrentSession();
-        
+
         Criteria criteria = session.createCriteria( Indicator.class );
         criteria.add( Restrictions.eq( "uuid", uuid ) );
-        
+
         return (Indicator) criteria.uniqueResult();
     }
 
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings( "unchecked" )
     public Collection<Indicator> getAllIndicators()
     {
         Session session = sessionFactory.getCurrentSession();
 
         Criteria criteria = session.createCriteria( Indicator.class );
         criteria.setCacheable( true );
-        
+
         return criteria.list();
     }
 
@@ -145,7 +146,7 @@
     public Collection<Indicator> getIndicatorsWithGroupSets()
     {
         final String hql = "from Indicator d where d.groupSets.size > 0";
-        
+
         return sessionFactory.getCurrentSession().createQuery( hql ).list();
     }
 
@@ -153,7 +154,7 @@
     public Collection<Indicator> getIndicatorsWithoutGroups()
     {
         final String hql = "from Indicator d where d.groups.size = 0";
-        
+
         return sessionFactory.getCurrentSession().createQuery( hql ).list();
     }
 
@@ -161,7 +162,7 @@
     {
         return getCount();
     }
-    
+
     public int getIndicatorCountByName( String name )
     {
         return getCountByName( name );
@@ -171,7 +172,7 @@
     {
         return getLikeName( name );
     }
-    
+
     public Collection<Indicator> getIndicatorsBetween( int first, int max )
     {
         return getBetween( first, max );
@@ -180,5 +181,5 @@
     public Collection<Indicator> getIndicatorsBetweenByName( String name, int first, int max )
     {
         return getBetweenByName( name, first, max );
-    }    
+    }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetPeriodTypesAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetPeriodTypesAction.java	2011-05-06 10:49:36 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetPeriodTypesAction.java	2011-06-07 05:46:18 +0000
@@ -40,9 +40,9 @@
 public class GetPeriodTypesAction
     extends ActionPagingSupport<PeriodType>
 {
-    // -------------------------------------------
+    // -------------------------------------------------------------------------
     // Dependency
-    // -------------------------------------------
+    // -------------------------------------------------------------------------
 
     private PeriodService periodService;
 
@@ -51,9 +51,9 @@
         this.periodService = periodService;
     }
 
-    // -------------------------------------------
+    // -------------------------------------------------------------------------
     // Output
-    // -------------------------------------------
+    // -------------------------------------------------------------------------
 
     private List<PeriodType> periodTypes;
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lock/GetPeriodsForLockAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lock/GetPeriodsForLockAction.java	2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lock/GetPeriodsForLockAction.java	2011-06-07 05:46:18 +0000
@@ -45,7 +45,8 @@
  * @author Brajesh Murari
  * @version $Id$
  */
-public class GetPeriodsForLockAction implements Action
+public class GetPeriodsForLockAction
+    implements Action
 {
     private final static String ALL = "ALL";
 
@@ -66,18 +67,23 @@
     {
         this.format = format;
     }
-    
+
     // -------------------------------------------------------------------------
     // Input & output
     // -------------------------------------------------------------------------
 
     private String name;
 
+    public String getName()
+    {
+        return name;
+    }
+
     public void setName( String name )
     {
         this.name = name;
     }
-    
+
     private List<Period> periods = new ArrayList<Period>();
 
     public List<Period> getPeriods()
@@ -90,40 +96,41 @@
     // -------------------------------------------------------------------------
 
     public String execute()
-    throws Exception
-	{
-	    if ( name == null || name.equals( ALL ) )
-	    {
+        throws Exception
+    {
+        if ( name == null || name.equals( ALL ) )
+        {
             Collection<PeriodType> periodTypes = periodService.getAllPeriodTypes();
-            
+
             for ( PeriodType type : periodTypes )
             {
                 periods.addAll( periodService.getPeriodsByPeriodType( type ) );
             }
         }
-	    else
-	    {	     
-		    PeriodType periodType = periodService.getPeriodTypeByName( name );
-			
-	        ArrayList<Period> allPeriodsOfSelectedPeriodType = new ArrayList<Period>( periodService.getPeriodsByPeriodType( periodType ) ); 
-	                   
-		    for ( Period p : allPeriodsOfSelectedPeriodType )
-		    {
-		    	if(!(p.getStartDate().compareTo( new Date() ) > 0 ))
-				{
-		    		periods.add(p);
-				}	   
-		    }
-	    }
-	    
-	    for ( Period period : periods )
-	    {
-	        period.setName( format.formatPeriod( period ) );
-	    }
-	    
-	    Collections.sort( periods, new PeriodComparator() );
-	
-	    return SUCCESS;
-	}
+        else
+        {
+            PeriodType periodType = periodService.getPeriodTypeByName( name );
+
+            List<Period> allPeriodsOfSelectedPeriodType = new ArrayList<Period>( periodService
+                .getPeriodsByPeriodType( periodType ) );
+
+            for ( Period p : allPeriodsOfSelectedPeriodType )
+            {
+                if ( !(p.getStartDate().compareTo( new Date() ) > 0) )
+                {
+                    periods.add( p );
+                }
+            }
+        }
+
+        for ( Period period : periods )
+        {
+            period.setName( format.formatPeriod( period ) );
+        }
+
+        Collections.sort( periods, new PeriodComparator() );
+
+        return SUCCESS;
+    }
+
 }
-