olabusayoT commented on code in PR #1479:
URL: https://github.com/apache/daffodil/pull/1479#discussion_r2208184302


##########
daffodil-core/src/main/java/org/apache/daffodil/api/validation/Validators.java:
##########
@@ -15,49 +15,61 @@
  * limitations under the License.
  */
 
-package org.apache.daffodil.lib.validation
+package org.apache.daffodil.api.validation;
 
-import org.apache.daffodil.lib.api.ValidatorFactory
-import org.apache.daffodil.lib.util.SimpleNamedServiceLoader
+import org.apache.daffodil.util.SimpleNamedServiceLoader;
+
+import java.util.Optional;
 
 /**
- * Access SPI registered [[org.apache.daffodil.lib.api.ValidatorFactory]] 
instances.
- *
+ * Access SPI registered 
[[org.apache.daffodil.api.validation.ValidatorFactory]] instances.
+ * <p>
  * Registered instances provide a unique name for lookup.
  */
-object Validators {
-  private lazy val impls: Map[String, ValidatorFactory] = {
-    
SimpleNamedServiceLoader.loadClass[ValidatorFactory](classOf[ValidatorFactory])
+public class Validators {
+  private static final Validators INSTANCE = new Validators();
+  private final java.util.Map<String, ValidatorFactory> impls =
+      SimpleNamedServiceLoader.loadClass(ValidatorFactory.class);
+
+  private Validators() {
+  } // private constructor
+
+  public static Validators getInstance() {

Review Comment:
   We actually don't need INSTANCE/getInstance anymore since all the classes 
are static



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to