diff --git a/src/main/java/org/auscope/nvcl/server/service/DataAccess.java b/src/main/java/org/auscope/nvcl/server/service/DataAccess.java index 9b8eac4..3f1b44c 100644 --- a/src/main/java/org/auscope/nvcl/server/service/DataAccess.java +++ b/src/main/java/org/auscope/nvcl/server/service/DataAccess.java @@ -143,10 +143,11 @@ public String makeWFSGetFeaturePostMethod(String serviceUrl, String wfsVersion, // this result will not be cached as it will change regularly and is only performed once per serviceUrl anyway int retryCount = 0; boolean isSuccess = false; + String result = ""; while( retryCount < 5 && isSuccess == false) { try{ retryCount += 1; - String result = this.httpServiceCaller.getMethodResponseAsString(method); + result = this.httpServiceCaller.getMethodResponseAsString(method); isSuccess = true; } catch (Exception e) { logger.debug("RETRY: makeWFSGetFeaturePostMethod: "+retryCount); diff --git a/src/main/java/org/auscope/nvcl/server/service/NVCLAnalyticalJobProcessor.java b/src/main/java/org/auscope/nvcl/server/service/NVCLAnalyticalJobProcessor.java index 6ed5f01..d01325d 100644 --- a/src/main/java/org/auscope/nvcl/server/service/NVCLAnalyticalJobProcessor.java +++ b/src/main/java/org/auscope/nvcl/server/service/NVCLAnalyticalJobProcessor.java @@ -158,11 +158,12 @@ public boolean getDownSampledData() { String holeIdentifier = boreholeVo.getHoleIdentifier(); boreholeVo.setStatus(1); //error status; boolean isHit = false; + Float count = 0.0f; + float ratio = (float) 0.0; for(String logid : boreholeVo.logidList) { totalProcessedLogid++; logger.debug("Stage3:process:boreholeid: " + holeIdentifier + " logid: " + logid); try { - String responseString = NVCLAnalyticalRequestSvc.dataAccess.getDownSampledDataMethod(nvclDataServiceUrl, logid, span, startDepth, endDepth, "csv"); String csvLine; @@ -177,35 +178,34 @@ public boolean getDownSampledData() { List cells = Arrays.asList(csvLine.split("\\s*,\\s*")); String depth = cells.get(0); - Float count = 0.0f; + Float count0 = 0.0f; String csvClassfication; if (this.isdecimalTypeScalar == false) { - count = Float.parseFloat(cells.get(3)); + count0 = Float.parseFloat(cells.get(3)); csvClassfication = cells.get(1); } else { - count = Float.parseFloat(cells.get(1)); + count0 = Float.parseFloat(cells.get(1)); csvClassfication="averageValue"; //get the float; } Float countSum = 0.0f ; if (depthMap.get(depth) != null) { - countSum= depthMap.get(depth) + count; + countSum= depthMap.get(depth) + count0; } else { - countSum = 0 + count; + countSum = 0 + count0; } depthMap.put(depth, countSum); if( !depthClassificationMap.containsKey(depth)) { depthClassificationMap.put(depth, (float) 0.0); } if (csvClassfication.equalsIgnoreCase(classification)) { - depthClassificationMap.put(depth, count); + depthClassificationMap.put(depth, count0); } } - String depthKey; - Float count = 0.0f; + String depthKey; Float countSum; - float ratio = (float) 0.0; + /* Now, iterate over the map's contents, sorted by key. */ for (Entry entry : depthClassificationMap.entrySet()) { depthKey = entry.getKey();