fineract-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k...@apache.org
Subject [fineract] branch develop updated: minor clean-up to eliminate 'dead code' in CodeValue
Date Tue, 02 Jun 2020 14:36:20 GMT
This is an automated email from the ASF dual-hosted git repository.

kaze pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract.git


The following commit(s) were added to refs/heads/develop by this push:
     new 6f128bf  minor clean-up to eliminate 'dead code' in CodeValue
6f128bf is described below

commit 6f128bf5083ea526e2058b468eb58a14760c302a
Author: Michael Vorburger <mike@vorburger.ch>
AuthorDate: Mon Jun 1 12:14:52 2020 +0200

    minor clean-up to eliminate 'dead code' in CodeValue
    
    This fixes one of too many ;) warnings Eclipse shows.
    
    It is correct that the condition this checked is useless,
    because that is already checked for in the method it calls.
    (BTW it's actually pretty impressive that JDT, the Eclipse
    Java compiler, can figure this out; it's "smarter" than javac).
---
 .../fineract/infrastructure/codes/domain/CodeValue.java     | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/domain/CodeValue.java
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/domain/CodeValue.java
index 6f882b4..93b9d63 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/domain/CodeValue.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/domain/CodeValue.java
@@ -93,18 +93,13 @@ public class CodeValue extends AbstractPersistableCustom {
             isActive = isActiveObj;
         }
         if (position == null) {
-            position = Integer.valueOf(0);
+            position = 0;
         }
 
         Boolean mandatory = command.booleanPrimitiveValueOfParameterNamed(
                 CodevalueJSONinputParams.IS_MANDATORY.getValue());
 
-        // if the "mandatory" Boolean object is null, then set it to false by default
-        if (mandatory == null) {
-            mandatory = false;
-        }
-
-        return new CodeValue(code, label, position.intValue(), description, isActive, mandatory);
+        return new CodeValue(code, label, position, description, isActive, mandatory);
     }
 
     public Map<String, Object> update(final JsonCommand command) {
@@ -129,14 +124,14 @@ public class CodeValue extends AbstractPersistableCustom {
         if (command.isChangeInIntegerSansLocaleParameterNamed(positionParamName, this.position))
{
             final Integer newValue = command.integerValueSansLocaleOfParameterNamed(positionParamName);
             actualChanges.put(positionParamName, newValue);
-            this.position = newValue.intValue();
+            this.position = newValue;
         }
 
         final String isActiveParamName = CodevalueJSONinputParams.IS_ACTIVE.getValue();
         if (command.isChangeInBooleanParameterNamed(isActiveParamName, this.isActive)) {
             final Boolean newValue = command.booleanPrimitiveValueOfParameterNamed(isActiveParamName);
             actualChanges.put(isActiveParamName, newValue);
-            this.isActive = newValue.booleanValue();
+            this.isActive = newValue;
         }
 
         return actualChanges;


Mime
View raw message