From 0d45cea90cb9383bc874f6479642c91abd06f94b Mon Sep 17 00:00:00 2001 From: Benjamin Weder Date: Fri, 31 Jan 2020 15:34:26 +0100 Subject: [PATCH] Add logging to detect nullpointers if plan variable is not initialized (#3) --- .../bpel/extension/bpel4restlight/Bpel4RestLightUtil.java | 6 +++++- pom.xml | 6 +++--- repositories.rb | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/bpel-rest-extensions/src/main/java/org/apache/ode/bpel/extension/bpel4restlight/Bpel4RestLightUtil.java b/bpel-rest-extensions/src/main/java/org/apache/ode/bpel/extension/bpel4restlight/Bpel4RestLightUtil.java index c12fa93ab..4f46b0bcb 100644 --- a/bpel-rest-extensions/src/main/java/org/apache/ode/bpel/extension/bpel4restlight/Bpel4RestLightUtil.java +++ b/bpel-rest-extensions/src/main/java/org/apache/ode/bpel/extension/bpel4restlight/Bpel4RestLightUtil.java @@ -260,6 +260,7 @@ public static String getMethodAttributeValue(ExtensionContext context, Element e public static String resolveVariableValueReference(ExtensionContext context, String variableValueReference) throws FaultException { String variableValue = variableValueReference; + logger.debug("Resolving variable value reference for: {}", variableValueReference); // Check if a concrete variable name ("varName") or a reference to the value of // a variable is specified ("$bpelVar[varName]") @@ -268,6 +269,7 @@ public static String resolveVariableValueReference(ExtensionContext context, int endIndexOfVarReference = variableValue.indexOf("]"); String variableName = variableValue.substring(startIndexOfVarReference + VARIABLE_VALUE_REFERENCE.length(), endIndexOfVarReference); + logger.debug("Found variable name to resolve: {}", variableName); String prefix = variableValue.startsWith(VARIABLE_VALUE_REFERENCE) ? "" : variableValue.substring(0, startIndexOfVarReference); String suffix = variableValue.length() > endIndexOfVarReference + 1 ? variableValue.substring(endIndexOfVarReference + 1) : ""; @@ -277,10 +279,12 @@ public static String resolveVariableValueReference(ExtensionContext context, // We only support simple type variables, therefore the value of the variable is // directly provided within a element. if (variable != null && isSimpleType(variable.type)) { + logger.debug("Variable is of simple type and can be resolved!"); Node variableContent = context.readVariable(variableName); if (variableContent.getTextContent() != null) { - // Return the value of the variable plus the optionally specified prefix and suffix as result + // Return the value of the variable plus the optionally specified prefix and suffix as result + logger.debug("Replacing variable with following value: {}", variableContent.getTextContent()); variableValue = prefix + variableContent.getTextContent() + suffix; } } else { diff --git a/pom.xml b/pom.xml index d26001f26..07f931084 100644 --- a/pom.xml +++ b/pom.xml @@ -256,17 +256,17 @@ 1_wso2 WSO2 Repository - http://dist.wso2.org/maven2/ + https://dist.wso2.org/maven2/ 2_central Maven Central Repository - http://central.maven.org/maven2/ + https://central.maven.org/maven2/ 3_vanto Vanto Maven Repository - http://people.apache.org/~vanto/m2/ + https://people.apache.org/~vanto/m2/ diff --git a/repositories.rb b/repositories.rb index e4c2af7ee..6452a4d29 100644 --- a/repositories.rb +++ b/repositories.rb @@ -13,6 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -repositories.remote << "http://repo1.maven.org/maven2" -repositories.remote << "http://people.apache.org/~vanto/m2/" +repositories.remote << "https://repo1.maven.org/maven2" +repositories.remote << "https://people.apache.org/~vanto/m2/"