You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by vo...@apache.org on 2020/06/03 08:50:58 UTC

[fineract] branch develop updated (97cbb13 -> 3521b0e)

This is an automated email from the ASF dual-hosted git repository.

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


    from 97cbb13  FINERACT-1004 Resolved NPE in AddressWritePlatformServiceImpl.updateClientAddress()
     new 8d7fa73  FINERACT-933 Suggestion to fix ArrayIndexOutOfBoundsException
     new 3521b0e  FINERACT-933 Fixed ArrayIndexOutOfBoundsException at ClientPersonImportHandler

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../client/ClientPersonImportHandler.java          | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)


[fineract] 02/02: FINERACT-933 Fixed ArrayIndexOutOfBoundsException at ClientPersonImportHandler

Posted by vo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 3521b0ed334831dbb4ab0db9216a493c532982db
Author: nnatarajan <na...@gmail.com>
AuthorDate: Mon Jun 1 20:10:10 2020 -0600

    FINERACT-933 Fixed ArrayIndexOutOfBoundsException at ClientPersonImportHandler
---
 .../client/ClientPersonImportHandler.java            | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/client/ClientPersonImportHandler.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/client/ClientPersonImportHandler.java
index 15a54d0..e52bd98 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/client/ClientPersonImportHandler.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/client/ClientPersonImportHandler.java
@@ -105,7 +105,7 @@ public class ClientPersonImportHandler implements ImportHandler {
         Long clientTypeId = null;
         if (clientType!=null) {
             String[] clientTypeAr = clientType.split("-");
-            if (clientTypeAr[1] != null) {
+            if (clientTypeAr.length > 1 && clientTypeAr[1] != null) {
                 clientTypeId = Long.parseLong(clientTypeAr[1]);
             }
         }
@@ -113,16 +113,16 @@ public class ClientPersonImportHandler implements ImportHandler {
         Long genderId = null;
         if (gender!=null) {
             String[] genderAr = gender.split("-");
-            if (genderAr[1] != null) {
+            if (genderAr.length > 1 && genderAr[1] != null) {
                 genderId = Long.parseLong(genderAr[1]);
             }
         }
         String clientClassification= ImportHandlerUtils.readAsString(ClientPersonConstants.CLIENT_CLASSIFICATION_COL, row);
-        Long clientClassicationId = null;
+        Long clientClassificationId = null;
         if (clientClassification!=null) {
             String[] clientClassificationAr = clientClassification.split("-");
-            if (clientClassificationAr[1] != null) {
-                clientClassicationId = Long.parseLong(clientClassificationAr[1]);
+            if (clientClassificationAr.length > 1 && clientClassificationAr[1] != null) {
+                clientClassificationId = Long.parseLong(clientClassificationAr[1]);
             }
         }
         Boolean isStaff = ImportHandlerUtils.readAsBoolean(ClientPersonConstants.IS_STAFF_COL, row);
@@ -135,7 +135,7 @@ public class ClientPersonImportHandler implements ImportHandler {
             if (addressType!=null) {
                 String[] addressTypeAr = addressType.split("-");
 
-                if (addressTypeAr[1] != null) {
+                if (addressTypeAr.length > 1 && addressTypeAr[1] != null) {
                     addressTypeId = Long.parseLong(addressTypeAr[1]);
                 }
             }
@@ -150,11 +150,11 @@ public class ClientPersonImportHandler implements ImportHandler {
 
             String stateProvince=ImportHandlerUtils.readAsString(ClientPersonConstants.STATE_PROVINCE_COL, row);
             Long stateProvinceId = null;
-            if (stateProvince!=null && stateProvince.isBlank()) {
+            if (stateProvince != null) {
                 String[] stateProvinceAr = stateProvince.split("-");
                 // Arkansas-AL <-- expected format of the cell
                 // but probably it's either an empty cell or it is missing a hyphen
-                if (stateProvinceAr[1] != null) {
+                if (stateProvinceAr.length > 1 && stateProvinceAr[1] != null) {
                     stateProvinceId = Long.parseLong(stateProvinceAr[1]);
                 }
             }
@@ -162,7 +162,7 @@ public class ClientPersonImportHandler implements ImportHandler {
             Long countryId=null;
             if (country!=null) {
                 String[] countryAr = country.split("-");
-                if (countryAr[1] != null) {
+                if (countryAr.length > 1 && countryAr[1] != null) {
                     countryId = Long.parseLong(countryAr[1]);
                 }
             }
@@ -171,7 +171,7 @@ public class ClientPersonImportHandler implements ImportHandler {
              addressList = new ArrayList<AddressData>(Arrays.asList(addressDataObj));
         }
         return ClientData.importClientPersonInstance(legalFormId,row.getRowNum(),firstName,lastName,middleName,submittedOn,activationDate,active,externalId,
-                officeId, staffId, mobileNo, dob, clientTypeId, genderId, clientClassicationId, isStaff,
+                officeId, staffId, mobileNo, dob, clientTypeId, genderId, clientClassificationId, isStaff,
                 addressList, locale, dateFormat);
 
     }


[fineract] 01/02: FINERACT-933 Suggestion to fix ArrayIndexOutOfBoundsException

Posted by vo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 8d7fa73b4621763437f293d81863606ff8d8b5fe
Author: nnatarajan <na...@gmail.com>
AuthorDate: Thu May 28 17:38:30 2020 -0600

    FINERACT-933 Suggestion to fix ArrayIndexOutOfBoundsException
---
 .../bulkimport/importhandler/client/ClientPersonImportHandler.java    | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/client/ClientPersonImportHandler.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/client/ClientPersonImportHandler.java
index 85cf95f..15a54d0 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/client/ClientPersonImportHandler.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/client/ClientPersonImportHandler.java
@@ -150,8 +150,10 @@ public class ClientPersonImportHandler implements ImportHandler {
 
             String stateProvince=ImportHandlerUtils.readAsString(ClientPersonConstants.STATE_PROVINCE_COL, row);
             Long stateProvinceId = null;
-            if (stateProvince!=null) {
+            if (stateProvince!=null && stateProvince.isBlank()) {
                 String[] stateProvinceAr = stateProvince.split("-");
+                // Arkansas-AL <-- expected format of the cell
+                // but probably it's either an empty cell or it is missing a hyphen
                 if (stateProvinceAr[1] != null) {
                     stateProvinceId = Long.parseLong(stateProvinceAr[1]);
                 }