This is an automated email from the ASF dual-hosted git repository.

mibo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/olingo-odata2.git


The following commit(s) were added to refs/heads/master by this push:
     new 157d058  [OLINGO-1487] Minor rework
157d058 is described below

commit 157d058839c71e70e8becda66e4548e586e5c21b
Author: mibo <[email protected]>
AuthorDate: Sun Mar 6 09:25:56 2022 +0100

    [OLINGO-1487] Minor rework
---
 .../jpa/processor/api/factory/ODataJPAFactory.java      | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git 
a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/factory/ODataJPAFactory.java
 
b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/factory/ODataJPAFactory.java
index 6ad4e00..f5c5ee8 100644
--- 
a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/factory/ODataJPAFactory.java
+++ 
b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/factory/ODataJPAFactory.java
@@ -51,6 +51,7 @@ public abstract class ODataJPAFactory {
   public static void setImplementation(Class<?> clazz) {
       IMPLEMENTATION = clazz.getName();
   }
+
   /**
    * Method creates a factory instance. The instance returned is singleton.
    * The instance of this factory can be used for creating other factory
@@ -59,22 +60,17 @@ public abstract class ODataJPAFactory {
    * @return instance of type {@link 
org.apache.olingo.odata2.jpa.processor.api.factory.ODataJPAFactory} .
    */
   public static ODataJPAFactory createFactory() {
-
-    if (factoryImpl != null) {
-      return factoryImpl;
-    } else {
+    if (factoryImpl == null) {
       try {
         Class<?> clazz = Class.forName(ODataJPAFactory.IMPLEMENTATION);
 
         Object object = clazz.newInstance();
         factoryImpl = (ODataJPAFactory) object;
-
       } catch (Exception e) {
         throw new RuntimeException(e);
       }
-
-      return factoryImpl;
     }
+    return factoryImpl;
   }
 
   /**
@@ -86,7 +82,7 @@ public abstract class ODataJPAFactory {
    */
   public JPQLBuilderFactory getJPQLBuilderFactory() {
     return null;
-  };
+  }
 
   /**
    * The method returns a null reference to JPA Access Factory. Override this
@@ -97,7 +93,7 @@ public abstract class ODataJPAFactory {
    */
   public JPAAccessFactory getJPAAccessFactory() {
     return null;
-  };
+  }
 
   /**
    * The method returns a null reference to OData JPA Access Factory. Override
@@ -108,6 +104,5 @@ public abstract class ODataJPAFactory {
    */
   public ODataJPAAccessFactory getODataJPAAccessFactory() {
     return null;
-  };
-
+  }
 }

Reply via email to