StringIndexOutOfBoundsException at
TemplatedViolatedConstraintNameExtracter.extractUsingTemplate
------------------------------------------------------------------------------------------------
Key: HHH-6789
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-6789
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 4.0.0.CR5
Environment: PostgreSQL
Reporter: Dimitris Zenios
TemplatedViolatedConstraintNameExtracter.extractUsingTemplate throws
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
Example values
templateStart = "violates check constraint \""
templateEnd = "\""
message = "new row for relation \"user_balance\" violates check constraint
\"balance_check_constraint\""
This function broke from the last commit
https://hibernate.onjira.com/browse/HHH-4854
In order to fix it, we have to change this on the function
int end = message.lastIndexOf( templateEnd, start );
to
int end = message.indexOf( templateEnd, start );
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira