Skip to content

Commit

Permalink
Merge pull request #2224 from nguyenthanhptiter11/release-candidate-2…
Browse files Browse the repository at this point in the history
….3-original

OAI buider fix sonar
  • Loading branch information
dangkhanhtrung authored Mar 6, 2020
2 parents 3004d2c + d6e6d2a commit 1d5af58
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ public Response getOAI(HttpServletRequest request, HttpHeaders header, Company c

_log.debug("oaiQuery=" + query);

OAIBuilderUtils builder = OAIBuilderUtils.getInstance(query);
OAIBuilderUtils builder = new OAIBuilderUtils(query);
OAIPMHtype results = builder.getResults();
builder.destroy();

return Response.status(HttpURLConnection.HTTP_OK).entity(results).build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ public class OAIBuilderUtils {
private static final String M_CALCULATE = "calculate";
private RequestType query;
private OAIPMHtype results;
private static OAIBuilderUtils instance;
// private static OAIBuilderUtils instance;

private OAIBuilderUtils(RequestType query) {
public OAIBuilderUtils(RequestType query) {
super();
this.query = query;
init();
}

public static OAIBuilderUtils getInstance(RequestType query) {
if (instance == null) {
instance = new OAIBuilderUtils(query);
}
return instance;
}
// public static OAIBuilderUtils getInstance(RequestType query) {
// if (instance == null) {
// instance = new OAIBuilderUtils(query);
// }
// return instance;
// }

public RequestType getQuery() {
return query;
Expand All @@ -46,11 +46,11 @@ public void setResults(OAIPMHtype results) {
this.results = results;
}

public void destroy() {
query = null;
results = null;
// public void destroy() {
// query = null;
// results = null;
// instance = null;
}
// }

private void init() {

Expand Down

0 comments on commit 1d5af58

Please sign in to comment.