diff --git a/hibernate-core/src/main/java/org/hibernate/exception/spi/TemplatedViolatedConstraintNameExtracter.java b/hibernate-core/src/main/java/org/hibernate/exception/spi/TemplatedViolatedConstraintNameExtracter.java index 067ab24589..d6a99dd35d 100644 --- a/hibernate-core/src/main/java/org/hibernate/exception/spi/TemplatedViolatedConstraintNameExtracter.java +++ b/hibernate-core/src/main/java/org/hibernate/exception/spi/TemplatedViolatedConstraintNameExtracter.java @@ -28,13 +28,15 @@ public abstract class TemplatedViolatedConstraintNameExtracter implements Violat if (sqle.getNextException() == null || sqle.getNextException() == sqle) { break; - } else { + } + else { sqle = sqle.getNextException(); } } while (constraintName == null); return constraintName; - } catch (NumberFormatException nfe) { + } + catch (NumberFormatException nfe) { return null; } }