You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cz...@apache.org on 2019/06/24 11:37:54 UTC
[sling-org-apache-sling-installer-factory-configuration] branch
master updated: SLING-8523 : Minor code clean up
This is an automated email from the ASF dual-hosted git repository.
cziegeler pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-installer-factory-configuration.git
The following commit(s) were added to refs/heads/master by this push:
new 2a16c35 SLING-8523 : Minor code clean up
2a16c35 is described below
commit 2a16c35dc1ec5f60c437853535c843121e706bf4
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Jun 24 13:37:47 2019 +0200
SLING-8523 : Minor code clean up
---
.../factories/configuration/impl/ConfigUpdateHandler.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/main/java/org/apache/sling/installer/factories/configuration/impl/ConfigUpdateHandler.java b/src/main/java/org/apache/sling/installer/factories/configuration/impl/ConfigUpdateHandler.java
index ee013b8..64eeca0 100644
--- a/src/main/java/org/apache/sling/installer/factories/configuration/impl/ConfigUpdateHandler.java
+++ b/src/main/java/org/apache/sling/installer/factories/configuration/impl/ConfigUpdateHandler.java
@@ -110,9 +110,9 @@ public class ConfigUpdateHandler implements ResourceUpdater {
// extract factory id for these cases where alias is not available and factoryId and pid need to be separated from the old id string itself
//format assumption ::: "factory_pid.factory_pid.pid"
// split pid with lastIndexOf('.') then remove the duplicate factory_pid part from the remaining string using the middle dot split index
- int lastDotIndex = oldId.lastIndexOf('.');
+ final int lastDotIndex = oldId.lastIndexOf('.');
String factoryIdString = oldId.substring(0,lastDotIndex+1); // keep it +1 to have last dot intact so that we always have even dots in the string
- factoryPid = oldId.substring(0,getMiddleDotSplitIndex(factoryIdString,'.'));
+ factoryPid = oldId.substring(0, getMiddleDotSplitIndex(factoryIdString));
pid = oldId.substring(lastDotIndex+1);
}
@@ -120,14 +120,14 @@ public class ConfigUpdateHandler implements ResourceUpdater {
return new String[] { factoryPid, pid };
}
- private int getMiddleDotSplitIndex(final String strId, char dot){
+ private int getMiddleDotSplitIndex(final String strId) {
int dotCount = 0;
int[] dotIndexArray = new int[strId.length()];
for (int i=0;i<strId.length();i++)
- if (strId.charAt(i)==dot) {
+ if (strId.charAt(i) == '.') {
dotCount++;
dotIndexArray[dotCount] = i;
}