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 @Override
public Boolean isInsertable() { public Boolean isInsertable() {
return propertyElement.isInsert() == null return propertyElement.isInsert() == null
? true ? Boolean.TRUE
: propertyElement.isInsert(); : propertyElement.isInsert();
} }
@Override @Override
public Boolean isUpdatable() { public Boolean isUpdatable() {
return propertyElement.isUpdate() == null return propertyElement.isUpdate() == null
? true ? Boolean.TRUE
: propertyElement.isUpdate(); : propertyElement.isUpdate();
} }

View File

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

View File

@ -45,7 +45,7 @@ public class MySQL5Dialect extends MySQLDialect {
@Override @Override
protected String doExtractConstraintName(SQLException sqle) throws NumberFormatException { 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 ) { switch ( sqlState ) {
case 23000: case 23000:
return extractUsingTemplate( " for key '", "'", sqle.getMessage() ); return extractUsingTemplate( " for key '", "'", sqle.getMessage() );

View File

@ -422,7 +422,7 @@ public class PostgreSQL81Dialect extends Dialect {
private static final ViolatedConstraintNameExtracter EXTRACTER = new TemplatedViolatedConstraintNameExtracter() { private static final ViolatedConstraintNameExtracter EXTRACTER = new TemplatedViolatedConstraintNameExtracter() {
@Override @Override
protected String doExtractConstraintName(SQLException sqle) throws NumberFormatException { 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) { switch (sqlState) {
// CHECK VIOLATION // CHECK VIOLATION
case 23514: return extractUsingTemplate( "violates check constraint \"","\"", sqle.getMessage() ); 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 ); final String param = sqlString.substring( indx + 1, chopLocation );
// make sure this "name" is an integral // make sure this "name" is an integral
try { try {
recognizer.jpaPositionalParameter( Integer.valueOf( param ), indx ); recognizer.jpaPositionalParameter( Integer.parseInt( param ), indx );
indx = chopLocation - 1; indx = chopLocation - 1;
} }
catch( NumberFormatException e ) { catch( NumberFormatException e ) {

View File

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