[LIB-9] AssertionError in utils and constants classes
authorgotty <gotty@hedgecode.org>
Sat, 25 Jan 2020 02:58:53 +0000 (05:58 +0300)
committergotty <gotty@hedgecode.org>
Sat, 25 Jan 2020 02:58:53 +0000 (05:58 +0300)
chesshog-core/src/main/java/org/hedgecode/chess/ChessHogConstants.java
chesshog-dbetude/src/main/java/org/hedgecode/chess/EtudeConstants.java
chesshog-dbetude/src/main/java/org/hedgecode/chess/EtudeUtils.java
chesshog-dbetude/src/main/java/org/hedgecode/chess/persistence/PersistenceUtils.java
chesshog-graphics/src/main/java/org/hedgecode/chess/img/FilenameUtils.java
chesshog-graphics/src/main/java/org/hedgecode/chess/img/ImageConstants.java
chesshog-qrcode/src/main/java/org/hedgecode/chess/qrcode/ChessQRCodeConstants.java
chesshog-qrcode/src/main/java/org/hedgecode/chess/qrcode/zip/ZipContentUtils.java
chesshog-uci/src/main/java/org/hedgecode/chess/uci/UCIConstants.java

index f465291..9756c2c 100644 (file)
@@ -33,7 +33,7 @@ public final class ChessHogConstants {
 
     private ChessHogConstants() {
         throw new AssertionError(
-                "No org.hedgecode.chess.ChessHogConstants instances!"
+                String.format("No %s instances!", getClass().getName())
         );
     }
 
index 81570ab..4318426 100644 (file)
@@ -29,7 +29,7 @@ public final class EtudeConstants {
 
     private EtudeConstants() {
         throw new AssertionError(
-                "No org.hedgecode.chess.EtudeConstants instances!"
+                String.format("No %s instances!", getClass().getName())
         );
     }
 
index 268ca54..1a553dc 100644 (file)
@@ -165,7 +165,7 @@ public final class EtudeUtils {
 
     private EtudeUtils() {
         throw new AssertionError(
-                "No org.hedgecode.chess.EtudeUtils instances!"
+                String.format("No %s instances!", getClass().getName())
         );
     }
 
index 5c49ea5..a450a95 100644 (file)
@@ -29,14 +29,20 @@ import org.hedgecode.chess.EtudeConstants;
 public final class PersistenceUtils {
 
     public static EntityManagerFactory createEntityManagerFactory() {
-        return Persistence.createEntityManagerFactory(
+        return createEntityManagerFactory(
                 EtudeConstants.PERSISTENCE_UNIT_NAME
         );
     }
 
+    public static EntityManagerFactory createEntityManagerFactory(String persistenceUnitName) {
+        return Persistence.createEntityManagerFactory(
+                persistenceUnitName
+        );
+    }
+
     private PersistenceUtils() {
         throw new AssertionError(
-                "No org.hedgecode.chess.persistence.PersistenceUtils instances!"
+                String.format("No %s instances!", getClass().getName())
         );
     }
 
index f4f4719..5eb3db7 100644 (file)
@@ -109,7 +109,7 @@ public final class FilenameUtils {
 
     private FilenameUtils() {
         throw new AssertionError(
-                "No org.hedgecode.chess.img.FilenameUtils instances!"
+                String.format("No %s instances!", getClass().getName())
         );
     }
 
index d197d47..4d18ad9 100644 (file)
@@ -37,7 +37,7 @@ public final class ImageConstants {
 
     private ImageConstants() {
         throw new AssertionError(
-                "No ImageConstants instances!"
+                String.format("No %s instances!", getClass().getName())
         );
     }
 
index b208100..3e2e77c 100644 (file)
@@ -32,7 +32,7 @@ public final class ChessQRCodeConstants {
 
     private ChessQRCodeConstants() {
         throw new AssertionError(
-                "No org.hedgecode.chess.qrcode.ChessQRCodeConstants instances!"
+                String.format("No %s instances!", getClass().getName())
         );
     }
 
index dfd7901..a3c9f5c 100644 (file)
@@ -95,7 +95,7 @@ public class ZipContentUtils {
 
     private ZipContentUtils() {
         throw new AssertionError(
-                "No org.hedgecode.chess.qrcode.zip.ZipContentUtils instances!"
+                String.format("No %s instances!", getClass().getName())
         );
     }
 
index 1fb5004..415be72 100644 (file)
@@ -58,7 +58,7 @@ public final class UCIConstants {
 
     private UCIConstants() {
         throw new AssertionError(
-                "No UCIConstants instances!"
+                String.format("No %s instances!", getClass().getName())
         );
     }