From 81ee077a94fca6870d0c456d4b370ef9c640c5a2 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Tue, 26 Sep 2017 13:32:32 +0000 Subject: [PATCH] Sincronized getInstance() method and fixed error message git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-aggregator-se-plugin@154565 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../accounting/aggregator/persistence/CouchBaseConnector.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/gcube/accounting/aggregator/persistence/CouchBaseConnector.java b/src/main/java/org/gcube/accounting/aggregator/persistence/CouchBaseConnector.java index 87c8ab8..564effc 100644 --- a/src/main/java/org/gcube/accounting/aggregator/persistence/CouchBaseConnector.java +++ b/src/main/java/org/gcube/accounting/aggregator/persistence/CouchBaseConnector.java @@ -85,7 +85,7 @@ public class CouchBaseConnector { protected Map connectionMap; protected Map> recordTypeMap; - public static CouchBaseConnector getInstance() throws Exception{ + public synchronized static CouchBaseConnector getInstance() throws Exception{ if(couchBaseConnector==null){ couchBaseConnector = new CouchBaseConnector(); } @@ -333,7 +333,7 @@ public class CouchBaseConnector { List rows = result.allRows(); if(rows.size()>1){ - String error = String.format("More than one Document found for query %. This is really strange and should not occur. Please contact the Administrator.", statement.toString()); + String error = String.format("More than one Document found for query %s. This is really strange and should not occur. Please contact the Administrator.", statement.toString()); logger.error(error); throw new Exception(error); }