|
17 | 17 | import java.util.Date;
|
18 | 18 | import java.util.TimeZone;
|
19 | 19 |
|
20 |
| -import java.util.regex.Matcher; |
21 |
| -import java.util.regex.Pattern; |
22 | 20 | import org.hibernate.Length;
|
23 | 21 | import org.hibernate.LockOptions;
|
24 | 22 | import org.hibernate.PessimisticLockException;
|
@@ -214,12 +212,12 @@ protected static DatabaseVersion createVersion(DialectResolutionInfo info) {
|
214 | 212 | protected static DatabaseVersion createVersion(DialectResolutionInfo info, DatabaseVersion defaultVersion) {
|
215 | 213 | final String versionString = info.getDatabaseVersion();
|
216 | 214 | if ( versionString != null ) {
|
217 |
| - final Matcher matcher = Pattern.compile("^(\\d+)\\.(\\d+)\\.(\\d+).*").matcher(versionString); |
218 |
| - if ( matcher.matches() && matcher.groupCount() >= 3 ) { |
| 215 | + final String[] components = StringHelper.split(".-", versionString); |
| 216 | + if ( components.length >= 3 ) { |
219 | 217 | try {
|
220 |
| - final int majorVersion = Integer.parseInt( matcher.group(1)); |
221 |
| - final int minorVersion = Integer.parseInt( matcher.group(2) ); |
222 |
| - final int patchLevel = Integer.parseInt( matcher.group(3) ); |
| 218 | + final int majorVersion = Integer.parseInt( components[0] ); |
| 219 | + final int minorVersion = Integer.parseInt( components[1] ); |
| 220 | + final int patchLevel = Integer.parseInt( components[2] ); |
223 | 221 | return DatabaseVersion.make( majorVersion, minorVersion, patchLevel );
|
224 | 222 | }
|
225 | 223 | catch (NumberFormatException ex) {
|
|
0 commit comments