From 13a027eed48a028caa176bd5c30d703f26d634e7 Mon Sep 17 00:00:00 2001 From: gotty Date: Sat, 25 Jan 2020 05:58:53 +0300 Subject: [PATCH] [LIB-9] AssertionError in utils and constants classes --- .../src/main/java/org/hedgecode/chess/ChessHogConstants.java | 2 +- .../src/main/java/org/hedgecode/chess/EtudeConstants.java | 2 +- .../src/main/java/org/hedgecode/chess/EtudeUtils.java | 2 +- .../java/org/hedgecode/chess/persistence/PersistenceUtils.java | 10 ++++++++-- .../src/main/java/org/hedgecode/chess/img/FilenameUtils.java | 2 +- .../src/main/java/org/hedgecode/chess/img/ImageConstants.java | 2 +- .../java/org/hedgecode/chess/qrcode/ChessQRCodeConstants.java | 2 +- .../java/org/hedgecode/chess/qrcode/zip/ZipContentUtils.java | 2 +- .../src/main/java/org/hedgecode/chess/uci/UCIConstants.java | 2 +- 9 files changed, 16 insertions(+), 10 deletions(-) diff --git a/chesshog-core/src/main/java/org/hedgecode/chess/ChessHogConstants.java b/chesshog-core/src/main/java/org/hedgecode/chess/ChessHogConstants.java index f465291..9756c2c 100644 --- a/chesshog-core/src/main/java/org/hedgecode/chess/ChessHogConstants.java +++ b/chesshog-core/src/main/java/org/hedgecode/chess/ChessHogConstants.java @@ -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()) ); } diff --git a/chesshog-dbetude/src/main/java/org/hedgecode/chess/EtudeConstants.java b/chesshog-dbetude/src/main/java/org/hedgecode/chess/EtudeConstants.java index 81570ab..4318426 100644 --- a/chesshog-dbetude/src/main/java/org/hedgecode/chess/EtudeConstants.java +++ b/chesshog-dbetude/src/main/java/org/hedgecode/chess/EtudeConstants.java @@ -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()) ); } diff --git a/chesshog-dbetude/src/main/java/org/hedgecode/chess/EtudeUtils.java b/chesshog-dbetude/src/main/java/org/hedgecode/chess/EtudeUtils.java index 268ca54..1a553dc 100644 --- a/chesshog-dbetude/src/main/java/org/hedgecode/chess/EtudeUtils.java +++ b/chesshog-dbetude/src/main/java/org/hedgecode/chess/EtudeUtils.java @@ -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()) ); } diff --git a/chesshog-dbetude/src/main/java/org/hedgecode/chess/persistence/PersistenceUtils.java b/chesshog-dbetude/src/main/java/org/hedgecode/chess/persistence/PersistenceUtils.java index 5c49ea5..a450a95 100644 --- a/chesshog-dbetude/src/main/java/org/hedgecode/chess/persistence/PersistenceUtils.java +++ b/chesshog-dbetude/src/main/java/org/hedgecode/chess/persistence/PersistenceUtils.java @@ -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()) ); } diff --git a/chesshog-graphics/src/main/java/org/hedgecode/chess/img/FilenameUtils.java b/chesshog-graphics/src/main/java/org/hedgecode/chess/img/FilenameUtils.java index f4f4719..5eb3db7 100644 --- a/chesshog-graphics/src/main/java/org/hedgecode/chess/img/FilenameUtils.java +++ b/chesshog-graphics/src/main/java/org/hedgecode/chess/img/FilenameUtils.java @@ -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()) ); } diff --git a/chesshog-graphics/src/main/java/org/hedgecode/chess/img/ImageConstants.java b/chesshog-graphics/src/main/java/org/hedgecode/chess/img/ImageConstants.java index d197d47..4d18ad9 100644 --- a/chesshog-graphics/src/main/java/org/hedgecode/chess/img/ImageConstants.java +++ b/chesshog-graphics/src/main/java/org/hedgecode/chess/img/ImageConstants.java @@ -37,7 +37,7 @@ public final class ImageConstants { private ImageConstants() { throw new AssertionError( - "No ImageConstants instances!" + String.format("No %s instances!", getClass().getName()) ); } diff --git a/chesshog-qrcode/src/main/java/org/hedgecode/chess/qrcode/ChessQRCodeConstants.java b/chesshog-qrcode/src/main/java/org/hedgecode/chess/qrcode/ChessQRCodeConstants.java index b208100..3e2e77c 100644 --- a/chesshog-qrcode/src/main/java/org/hedgecode/chess/qrcode/ChessQRCodeConstants.java +++ b/chesshog-qrcode/src/main/java/org/hedgecode/chess/qrcode/ChessQRCodeConstants.java @@ -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()) ); } diff --git a/chesshog-qrcode/src/main/java/org/hedgecode/chess/qrcode/zip/ZipContentUtils.java b/chesshog-qrcode/src/main/java/org/hedgecode/chess/qrcode/zip/ZipContentUtils.java index dfd7901..a3c9f5c 100644 --- a/chesshog-qrcode/src/main/java/org/hedgecode/chess/qrcode/zip/ZipContentUtils.java +++ b/chesshog-qrcode/src/main/java/org/hedgecode/chess/qrcode/zip/ZipContentUtils.java @@ -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()) ); } diff --git a/chesshog-uci/src/main/java/org/hedgecode/chess/uci/UCIConstants.java b/chesshog-uci/src/main/java/org/hedgecode/chess/uci/UCIConstants.java index 1fb5004..415be72 100644 --- a/chesshog-uci/src/main/java/org/hedgecode/chess/uci/UCIConstants.java +++ b/chesshog-uci/src/main/java/org/hedgecode/chess/uci/UCIConstants.java @@ -58,7 +58,7 @@ public final class UCIConstants { private UCIConstants() { throw new AssertionError( - "No UCIConstants instances!" + String.format("No %s instances!", getClass().getName()) ); } -- 2.10.0