From b0145fa7f7afb7b809e2b546af12f359d14f60d9 Mon Sep 17 00:00:00 2001 From: lopez Date: Mon, 5 Feb 2024 13:34:02 +0100 Subject: [PATCH] cleaning; review instance --- .../org/grobid/core/engines/LicenseClassifier.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/grobid-core/src/main/java/org/grobid/core/engines/LicenseClassifier.java b/grobid-core/src/main/java/org/grobid/core/engines/LicenseClassifier.java index 1035057019..0672d994e8 100644 --- a/grobid-core/src/main/java/org/grobid/core/engines/LicenseClassifier.java +++ b/grobid-core/src/main/java/org/grobid/core/engines/LicenseClassifier.java @@ -26,7 +26,6 @@ public class LicenseClassifier { private DeLFTClassifierModel classifierLicense = null; // binary classifiers to be added if used - private Boolean useBinary = false; private JsonParser parser; @@ -35,7 +34,11 @@ public class LicenseClassifier { public static LicenseClassifier getInstance() { if (instance == null) { - getNewInstance(); + synchronized (LicenseClassifier.class) { + if (instance == null) { + getNewInstance(); + } + } } return instance; } @@ -48,10 +51,6 @@ private static synchronized void getNewInstance() { } private LicenseClassifier() { - //this.useBinary = configuration.getUseBinaryContextClassifiers(); - //if (this.useBinary == null) - // this.useBinary = false; - this.classifierCopyrightsOwner = new DeLFTClassifierModel("copyright", GrobidProperties.getDelftArchitecture("copyright")); this.classifierLicense = new DeLFTClassifierModel("license", GrobidProperties.getDelftArchitecture("license")); }