Skip to content
This repository has been archived by the owner on Feb 13, 2019. It is now read-only.

Commit

Permalink
fix execution-environment in MANIFEST
Browse files Browse the repository at this point in the history
  • Loading branch information
heydenb committed Mar 3, 2017
1 parent 65d30cb commit b82915f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 1 addition & 2 deletions META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-SymbolicName: com.realdolmen.dynatrace.restmonitor;singleton:=t
rue
Bundle-Name: REST Monitor
Bundle-Version: 1.0.0
Bundle-Version: 1.2.0
Bundle-ClassPath: .,lib/json-smart-2.2.1.jar,lib/slf4j-api-1.7.16.jar,lib/asm-5.0.3.jar,lib/json-path-2.2.0.jar,lib/accessors-smart-1.1.jar
Require-Bundle: com.dynatrace.diagnostics.sdk,
com.dynatrace.diagnostics.httpclient,com.dynatrace.diagnostics.util
Expand All @@ -11,4 +11,3 @@ Bundle-Vendor: Realdolmen
Bundle-Localization: plugin
Built-By: builduser
Implementation-Version: 6.5.0.1289
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public class MeasureCapturedValues {
private static final String PARAM_CONVERSIONMAP = "conversionMap";

private static final Logger log = Logger.getLogger(RestMonitor.class.getName());
private static final String DEFAULT_RESULT = "0.0";

private MonitorEnvironment monitorEnvironment;

Expand Down Expand Up @@ -166,14 +167,17 @@ Double extractXPathValue(String xmlBody, String xPathExpression, Map<String, Dou
InputSource inputSource = new InputSource( new StringReader(xmlBody));
XPathFactory xPathfactory = XPathFactory.newInstance();
XPath xpath = xPathfactory.newXPath();
String result = "0.0";
String result = DEFAULT_RESULT;
try {
XPathExpression expr = xpath.compile(xPathExpression);
result = expr.evaluate(inputSource);
} catch (XPathExpressionException e) {
throw new RestMonitorConfigurationException("XPath Expression error: " + e.getMessage(), e);
}
if (conversionMap == null){
if (result==null || result.length()==0){
result = DEFAULT_RESULT;
}
try {
return Double.parseDouble(result);
}
Expand Down

0 comments on commit b82915f

Please sign in to comment.