HHH-13496 Excessive relyiance on auto-boxing

This commit is contained in:
Sanne Grinovero 2019-07-08 20:30:21 +01:00
parent 433a7904c1
commit f2215dab47
6 changed files with 7 additions and 7 deletions

View File

@ -123,14 +123,14 @@ class SingularAttributeSourceBasicImpl
@Override
public Boolean isInsertable() {
return propertyElement.isInsert() == null
? true
? Boolean.TRUE
: propertyElement.isInsert();
}
@Override
public Boolean isUpdatable() {
return propertyElement.isUpdate() == null
? true
? Boolean.TRUE
: propertyElement.isUpdate();
}

View File

@ -156,7 +156,7 @@ class VersionAttributeSourceImpl
@Override
public Boolean isInsertable() {
return versionElement.isInsert() == null ? true : versionElement.isInsert();
return versionElement.isInsert() == null ? Boolean.TRUE : versionElement.isInsert();
}
@Override

View File

@ -45,7 +45,7 @@ public class MySQL5Dialect extends MySQLDialect {
@Override
protected String doExtractConstraintName(SQLException sqle) throws NumberFormatException {
final int sqlState = Integer.valueOf( JdbcExceptionHelper.extractSqlState( sqle ) ).intValue();
final int sqlState = Integer.parseInt( JdbcExceptionHelper.extractSqlState( sqle ) );
switch ( sqlState ) {
case 23000:
return extractUsingTemplate( " for key '", "'", sqle.getMessage() );

View File

@ -422,7 +422,7 @@ public class PostgreSQL81Dialect extends Dialect {
private static final ViolatedConstraintNameExtracter EXTRACTER = new TemplatedViolatedConstraintNameExtracter() {
@Override
protected String doExtractConstraintName(SQLException sqle) throws NumberFormatException {
final int sqlState = Integer.valueOf( JdbcExceptionHelper.extractSqlState( sqle ) );
final int sqlState = Integer.parseInt( JdbcExceptionHelper.extractSqlState( sqle ) );
switch (sqlState) {
// CHECK VIOLATION
case 23514: return extractUsingTemplate( "violates check constraint \"","\"", sqle.getMessage() );

View File

@ -188,7 +188,7 @@ public class ParameterParser {
final String param = sqlString.substring( indx + 1, chopLocation );
// make sure this "name" is an integral
try {
recognizer.jpaPositionalParameter( Integer.valueOf( param ), indx );
recognizer.jpaPositionalParameter( Integer.parseInt( param ), indx );
indx = chopLocation - 1;
}
catch( NumberFormatException e ) {

View File

@ -37,7 +37,7 @@ public class DurationJavaDescriptor extends AbstractTypeDescriptor<Duration> {
if ( string == null ) {
return null;
}
return Duration.ofNanos( Long.valueOf( string ) );
return Duration.ofNanos( Long.parseLong( string ) );
}
@Override