Skip to content

Commit 0d45cea

Browse files
authored
Add logging to detect nullpointers if plan variable is not initialized (#3)
1 parent 6a3bbce commit 0d45cea

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

bpel-rest-extensions/src/main/java/org/apache/ode/bpel/extension/bpel4restlight/Bpel4RestLightUtil.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ public static String getMethodAttributeValue(ExtensionContext context, Element e
260260
public static String resolveVariableValueReference(ExtensionContext context,
261261
String variableValueReference) throws FaultException {
262262
String variableValue = variableValueReference;
263+
logger.debug("Resolving variable value reference for: {}", variableValueReference);
263264

264265
// Check if a concrete variable name ("varName") or a reference to the value of
265266
// a variable is specified ("$bpelVar[varName]")
@@ -268,6 +269,7 @@ public static String resolveVariableValueReference(ExtensionContext context,
268269
int endIndexOfVarReference = variableValue.indexOf("]");
269270

270271
String variableName = variableValue.substring(startIndexOfVarReference + VARIABLE_VALUE_REFERENCE.length(), endIndexOfVarReference);
272+
logger.debug("Found variable name to resolve: {}", variableName);
271273

272274
String prefix = variableValue.startsWith(VARIABLE_VALUE_REFERENCE) ? "" : variableValue.substring(0, startIndexOfVarReference);
273275
String suffix = variableValue.length() > endIndexOfVarReference + 1 ? variableValue.substring(endIndexOfVarReference + 1) : "";
@@ -277,10 +279,12 @@ public static String resolveVariableValueReference(ExtensionContext context,
277279
// We only support simple type variables, therefore the value of the variable is
278280
// directly provided within a <temporary-simple-type-wrapper/> element.
279281
if (variable != null && isSimpleType(variable.type)) {
282+
logger.debug("Variable is of simple type and can be resolved!");
280283
Node variableContent = context.readVariable(variableName);
281284

282285
if (variableContent.getTextContent() != null) {
283-
// Return the value of the variable plus the optionally specified prefix and suffix as result
286+
// Return the value of the variable plus the optionally specified prefix and suffix as result
287+
logger.debug("Replacing variable with following value: {}", variableContent.getTextContent());
284288
variableValue = prefix + variableContent.getTextContent() + suffix;
285289
}
286290
} else {

pom.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -256,17 +256,17 @@
256256
<repository>
257257
<id>1_wso2</id>
258258
<name>WSO2 Repository</name>
259-
<url>http://dist.wso2.org/maven2/</url>
259+
<url>https://dist.wso2.org/maven2/</url>
260260
</repository>
261261
<repository>
262262
<id>2_central</id>
263263
<name>Maven Central Repository</name>
264-
<url>http://central.maven.org/maven2/</url>
264+
<url>https://central.maven.org/maven2/</url>
265265
</repository>
266266
<repository>
267267
<id>3_vanto</id>
268268
<name>Vanto Maven Repository</name>
269-
<url>http://people.apache.org/~vanto/m2/</url>
269+
<url>https://people.apache.org/~vanto/m2/</url>
270270
</repository>
271271
</repositories>
272272

repositories.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16-
repositories.remote << "http://repo1.maven.org/maven2"
17-
repositories.remote << "http://people.apache.org/~vanto/m2/"
16+
repositories.remote << "https://repo1.maven.org/maven2"
17+
repositories.remote << "https://people.apache.org/~vanto/m2/"
1818

0 commit comments

Comments
 (0)