From ee020c82156b2bf7ac36f74d522896cbf59a6c29 Mon Sep 17 00:00:00 2001 From: Strong Liu Date: Fri, 4 Nov 2011 06:14:30 +0800 Subject: [PATCH] HHH-6789 StringIndexOutOfBoundsException at TemplatedViolatedConstraintNameExtracter.extractUsingTemplate --- .../exception/spi/TemplatedViolatedConstraintNameExtracter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 193150c9bf..303d2be611 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 @@ -46,7 +46,7 @@ public abstract class TemplatedViolatedConstraintNameExtracter implements Violat } int start = templateStartPosition + templateStart.length(); - int end = message.lastIndexOf( templateEnd, start ); + int end = message.indexOf( templateEnd, start ); if ( end < 0 ) { end = message.length(); }