Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

simple change, mostly are removing those unnesserary unboxing code.

  • Loading branch information...
commit 9f4f817a73763c2418076ddb550a7b8399d53cc0 1 parent 7811331
@stliu stliu authored
Showing with 80 additions and 100 deletions.
  1. +4 −15 hibernate-core/src/main/java/org/hibernate/CacheMode.java
  2. +4 −15 hibernate-core/src/main/java/org/hibernate/FlushMode.java
  3. +1 −2  ...nate-core/src/main/java/org/hibernate/bytecode/instrumentation/internal/javassist/FieldInterceptorImpl.java
  4. +2 −2 hibernate-core/src/main/java/org/hibernate/collection/internal/PersistentArrayHolder.java
  5. +1 −1  hibernate-core/src/main/java/org/hibernate/collection/internal/PersistentList.java
  6. +1 −1  hibernate-core/src/main/java/org/hibernate/collection/internal/PersistentListElementHolder.java
  7. +1 −1  hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQL81Dialect.java
  8. +1 −1  hibernate-core/src/main/java/org/hibernate/dialect/function/TemplateRenderer.java
  9. +1 −1  hibernate-core/src/main/java/org/hibernate/engine/jdbc/ColumnNameCache.java
  10. +1 −1  hibernate-core/src/main/java/org/hibernate/engine/jdbc/cursor/internal/StandardRefCursorSupport.java
  11. +1 −1  hibernate-core/src/main/java/org/hibernate/engine/jdbc/internal/BasicFormatterImpl.java
  12. +1 −1  hibernate-core/src/main/java/org/hibernate/engine/query/spi/NativeSQLQueryPlan.java
  13. +1 −1  hibernate-core/src/main/java/org/hibernate/engine/spi/RowSelection.java
  14. +4 −4 hibernate-core/src/main/java/org/hibernate/hql/internal/ast/HqlSqlWalker.java
  15. +3 −5 hibernate-core/src/main/java/org/hibernate/hql/internal/ast/QueryTranslatorImpl.java
  16. +1 −1  hibernate-core/src/main/java/org/hibernate/hql/internal/ast/exec/BasicExecutor.java
  17. +6 −7 hibernate-core/src/main/java/org/hibernate/hql/internal/ast/util/ASTUtil.java
  18. +1 −3 hibernate-core/src/main/java/org/hibernate/hql/internal/classic/QueryTranslatorImpl.java
  19. +2 −2 hibernate-core/src/main/java/org/hibernate/internal/AbstractSessionImpl.java
  20. +7 −7 hibernate-core/src/main/java/org/hibernate/internal/FetchingScrollableResultsImpl.java
  21. +24 −16 hibernate-core/src/main/java/org/hibernate/internal/util/collections/ArrayHelper.java
  22. +1 −1  hibernate-core/src/main/java/org/hibernate/internal/util/config/ConfigurationHelper.java
  23. +2 −2 hibernate-core/src/main/java/org/hibernate/loader/JoinWalker.java
  24. +1 −1  hibernate-core/src/main/java/org/hibernate/persister/entity/JoinedSubclassEntityPersister.java
  25. +2 −2 hibernate-core/src/main/java/org/hibernate/persister/entity/SingleTableEntityPersister.java
  26. +1 −1  hibernate-core/src/main/java/org/hibernate/tuple/component/ComponentMetamodel.java
  27. +2 −2 hibernate-core/src/main/java/org/hibernate/tuple/entity/AbstractEntityTuplizer.java
  28. +1 −1  hibernate-core/src/main/java/org/hibernate/tuple/entity/EntityMetamodel.java
  29. +1 −1  hibernate-core/src/main/java/org/hibernate/type/IntegerType.java
  30. +1 −1  hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/JdbcTypeJavaClassMappings.java
View
19 hibernate-core/src/main/java/org/hibernate/CacheMode.java
@@ -84,22 +84,11 @@ public static CacheMode interpretExternalSetting(String setting) {
return null;
}
- if ( GET.name().equalsIgnoreCase( setting ) ) {
- return CacheMode.GET;
+ try {
+ return CacheMode.valueOf( setting.toUpperCase() );
}
- if ( IGNORE.name().equalsIgnoreCase( setting ) ) {
- return CacheMode.IGNORE;
+ catch ( IllegalArgumentException e ) {
+ throw new MappingException( "Unknown Cache Mode: " + setting );
}
- if ( NORMAL.name().equalsIgnoreCase( setting ) ) {
- return CacheMode.NORMAL;
- }
- if ( PUT.name().equalsIgnoreCase( setting ) ) {
- return CacheMode.PUT;
- }
- if ( REFRESH.name().equalsIgnoreCase( setting ) ) {
- return CacheMode.REFRESH;
- }
-
- throw new MappingException( "Unknown Cache Mode: " + setting );
}
}
View
19 hibernate-core/src/main/java/org/hibernate/FlushMode.java
@@ -89,22 +89,11 @@ public static FlushMode interpretExternalSetting(String setting) {
return null;
}
- if ( AUTO.name().equalsIgnoreCase( setting ) ) {
- return FlushMode.AUTO;
+ try {
+ return FlushMode.valueOf( setting.toUpperCase() );
}
- if ( COMMIT.name().equalsIgnoreCase( setting ) ) {
- return FlushMode.COMMIT;
+ catch ( IllegalArgumentException e ) {
+ throw new MappingException( "unknown FlushMode : " + setting );
}
- if ( NEVER.name().equalsIgnoreCase( setting ) ) {
- return FlushMode.NEVER;
- }
- if ( MANUAL.name().equalsIgnoreCase( setting ) ) {
- return FlushMode.MANUAL;
- }
- if ( ALWAYS.name().equalsIgnoreCase( setting ) ) {
- return FlushMode.ALWAYS;
- }
-
- throw new MappingException( "unknown FlushMode : " + setting );
}
}
View
3  .../java/org/hibernate/bytecode/instrumentation/internal/javassist/FieldInterceptorImpl.java
@@ -81,8 +81,7 @@ public float readFloat(Object target, String name, float oldValue) {
}
public int readInt(Object target, String name, int oldValue) {
- return ( ( Integer ) intercept( target, name, Integer.valueOf( oldValue ) ) )
- .intValue();
+ return ( ( Integer ) intercept( target, name, Integer.valueOf( oldValue ) ) );
}
public long readLong(Object target, String name, long oldValue) {
View
4 hibernate-core/src/main/java/org/hibernate/collection/internal/PersistentArrayHolder.java
@@ -134,7 +134,7 @@ public Object readFrom(ResultSet rs, CollectionPersister persister, CollectionAl
throws HibernateException, SQLException {
Object element = persister.readElement( rs, owner, descriptor.getSuffixedElementAliases(), getSession() );
- int index = ( (Integer) persister.readIndex( rs, descriptor.getSuffixedIndexAliases(), getSession() ) ).intValue();
+ int index = (Integer) persister.readIndex( rs, descriptor.getSuffixedIndexAliases(), getSession() );
for ( int i = tempList.size(); i<=index; i++) {
tempList.add(i, null);
}
@@ -205,7 +205,7 @@ public Object getValue() {
}
public Iterator getDeletes(CollectionPersister persister, boolean indexIsFormula) throws HibernateException {
- java.util.List deletes = new ArrayList();
+ java.util.List<Integer> deletes = new ArrayList<Integer>();
Serializable sn = getSnapshot();
int snSize = Array.getLength(sn);
int arraySize = Array.getLength(array);
View
2  hibernate-core/src/main/java/org/hibernate/collection/internal/PersistentList.java
@@ -397,7 +397,7 @@ public String toString() {
public Object readFrom(ResultSet rs, CollectionPersister persister, CollectionAliases descriptor, Object owner)
throws HibernateException, SQLException {
Object element = persister.readElement( rs, owner, descriptor.getSuffixedElementAliases(), getSession() ) ;
- int index = ( (Integer) persister.readIndex( rs, descriptor.getSuffixedIndexAliases(), getSession() ) ).intValue();
+ int index = (Integer) persister.readIndex( rs, descriptor.getSuffixedIndexAliases(), getSession() );
//pad with nulls from the current last element up to the new index
for ( int i = list.size(); i<=index; i++) {
View
2  ...ate-core/src/main/java/org/hibernate/collection/internal/PersistentListElementHolder.java
@@ -79,7 +79,7 @@ public Serializable disassemble(CollectionPersister persister) throws HibernateE
Element elem = (Element) elements.get(i);
Object object = elementType.fromXMLNode( elem, persister.getFactory() );
Integer index = IntegerType.INSTANCE.fromString( getIndex(elem, indexNodeName, i) );
- result[ index.intValue() ] = elementType.disassemble( object, getSession(), null );
+ result[index] = elementType.disassemble( object, getSession(), null );
}
return result;
}
View
2  hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQL81Dialect.java
@@ -354,7 +354,7 @@ public ViolatedConstraintNameExtracter getViolatedConstraintNameExtracter() {
private static ViolatedConstraintNameExtracter EXTRACTER = new TemplatedViolatedConstraintNameExtracter() {
public String extractConstraintName(SQLException sqle) {
try {
- int sqlState = Integer.valueOf( JdbcExceptionHelper.extractSqlState( sqle )).intValue();
+ int sqlState = Integer.valueOf( JdbcExceptionHelper.extractSqlState( sqle ) );
switch (sqlState) {
// CHECK VIOLATION
case 23514: return extractUsingTemplate("violates check constraint \"","\"", sqle.getMessage());
View
2  hibernate-core/src/main/java/org/hibernate/dialect/function/TemplateRenderer.java
@@ -84,7 +84,7 @@ public TemplateRenderer(String template) {
chunks = chunkList.toArray( new String[chunkList.size()] );
paramIndexes = new int[paramList.size()];
for ( int i = 0; i < paramIndexes.length; ++i ) {
- paramIndexes[i] = paramList.get( i ).intValue();
+ paramIndexes[i] = paramList.get( i );
}
}
View
2  hibernate-core/src/main/java/org/hibernate/engine/jdbc/ColumnNameCache.java
@@ -45,7 +45,7 @@ public ColumnNameCache(int columnCount) {
public int getIndexForColumnName(String columnName, ResultSet rs) throws SQLException {
Integer cached = columnNameToIndexCache.get( columnName );
if ( cached != null ) {
- return cached.intValue();
+ return cached;
}
else {
int index = rs.findColumn( columnName );
View
2  ...ore/src/main/java/org/hibernate/engine/jdbc/cursor/internal/StandardRefCursorSupport.java
@@ -192,7 +192,7 @@ private int refCursorTypeCode() {
throw new HibernateException( "Unexpected error trying to determine REF_CURSOR field value : " + e.getMessage() );
}
}
- return refCursorTypeCode.intValue();
+ return refCursorTypeCode;
}
View
2  hibernate-core/src/main/java/org/hibernate/engine/jdbc/internal/BasicFormatterImpl.java
@@ -336,7 +336,7 @@ private void closeParen() {
parensSinceSelect--;
if ( parensSinceSelect < 0 ) {
indent--;
- parensSinceSelect = parenCounts.removeLast().intValue();
+ parensSinceSelect = parenCounts.removeLast();
afterByOrSetOrFromOrSelect = afterByOrFromOrSelects.removeLast().booleanValue();
}
if ( inFunction > 0 ) {
View
2  hibernate-core/src/main/java/org/hibernate/engine/query/spi/NativeSQLQueryPlan.java
@@ -87,7 +87,7 @@ public SQLCustomQuery getCustomQuery() {
customQuery.getSQL() );
}
if ( loc instanceof Integer ) {
- return new int[] { ((Integer) loc ).intValue() };
+ return new int[] { (Integer) loc };
}
else {
return ArrayHelper.toIntArray( (List) loc );
View
2  hibernate-core/src/main/java/org/hibernate/engine/spi/RowSelection.java
@@ -68,6 +68,6 @@ public void setFetchSize(Integer fetchSize) {
public boolean definesLimits() {
return maxRows != null ||
- ( firstRow != null && firstRow.intValue() <= 0 );
+ ( firstRow != null && firstRow <= 0 );
}
}
View
8 hibernate-core/src/main/java/org/hibernate/hql/internal/ast/HqlSqlWalker.java
@@ -137,7 +137,7 @@
* Maps each top-level result variable to its SelectExpression;
* (excludes result variables defined in subqueries)
**/
- private Map<String, SelectExpression> selectExpressionsByResultVariable = new HashMap();
+ private Map<String, SelectExpression> selectExpressionsByResultVariable = new HashMap<String, SelectExpression>();
private Set querySpaces = new HashSet();
@@ -492,8 +492,8 @@ else if ( node instanceof ParameterContainer ) {
private void applyParameterSpecifications(ParameterContainer parameterContainer) {
if ( parameterContainer.hasEmbeddedParameters() ) {
ParameterSpecification[] specs = parameterContainer.getEmbeddedParameters();
- for ( int i = 0; i < specs.length; i++ ) {
- applyParameterSpecification( specs[i] );
+ for ( ParameterSpecification spec : specs ) {
+ applyParameterSpecification( spec );
}
}
}
@@ -1064,7 +1064,7 @@ protected void handleResultVariableRef(AST resultVariableRef) throws SemanticExc
throw qe;
}
if ( o instanceof Integer ) {
- return new int[]{( ( Integer ) o ).intValue()};
+ return new int[]{ (Integer) o };
}
else {
return ArrayHelper.toIntArray( (ArrayList) o );
View
8 hibernate-core/src/main/java/org/hibernate/hql/internal/ast/QueryTranslatorImpl.java
@@ -359,15 +359,13 @@ public List list(SessionImplementor session, QueryParameters queryParameters)
// NOTE : firstRow is zero-based
int first = !hasLimit || queryParameters.getRowSelection().getFirstRow() == null
? 0
- : queryParameters.getRowSelection().getFirstRow().intValue();
+ : queryParameters.getRowSelection().getFirstRow();
int max = !hasLimit || queryParameters.getRowSelection().getMaxRows() == null
? -1
- : queryParameters.getRowSelection().getMaxRows().intValue();
- int size = results.size();
+ : queryParameters.getRowSelection().getMaxRows();
List tmp = new ArrayList();
IdentitySet distinction = new IdentitySet();
- for ( int i = 0; i < size; i++ ) {
- final Object result = results.get( i );
+ for ( final Object result : results ) {
if ( !distinction.add( result ) ) {
continue;
}
View
2  hibernate-core/src/main/java/org/hibernate/hql/internal/ast/exec/BasicExecutor.java
@@ -96,7 +96,7 @@ public int execute(QueryParameters parameters, SessionImplementor session) throw
}
if ( selection != null ) {
if ( selection.getTimeout() != null ) {
- st.setQueryTimeout( selection.getTimeout().intValue() );
+ st.setQueryTimeout( selection.getTimeout() );
}
}
View
13 hibernate-core/src/main/java/org/hibernate/hql/internal/ast/util/ASTUtil.java
@@ -384,8 +384,7 @@ public List collect(AST root) {
public static Map generateTokenNameCache(Class tokenTypeInterface) {
final Field[] fields = tokenTypeInterface.getFields();
Map cache = new HashMap( (int)( fields.length * .75 ) + 1 );
- for ( int i = 0; i < fields.length; i++ ) {
- final Field field = fields[i];
+ for ( final Field field : fields ) {
if ( Modifier.isStatic( field.getModifiers() ) ) {
try {
cache.put( field.get( null ), field.getName() );
@@ -429,10 +428,10 @@ public static String getTokenTypeName(Class tokenTypeInterface, int tokenType) {
String tokenTypeName = Integer.toString( tokenType );
if ( tokenTypeInterface != null ) {
Field[] fields = tokenTypeInterface.getFields();
- for ( int i = 0; i < fields.length; i++ ) {
- final Integer fieldValue = extractIntegerValue( fields[i] );
- if ( fieldValue != null && fieldValue.intValue() == tokenType ) {
- tokenTypeName = fields[i].getName();
+ for ( Field field : fields ) {
+ final Integer fieldValue = extractIntegerValue( field );
+ if ( fieldValue != null && fieldValue == tokenType ) {
+ tokenTypeName = field.getName();
break;
}
}
@@ -451,7 +450,7 @@ else if ( value instanceof Short ) {
rtn = ( ( Short ) value ).intValue();
}
else if ( value instanceof Long ) {
- if ( ( ( Long ) value ).longValue() <= Integer.MAX_VALUE ) {
+ if ( ( Long ) value <= Integer.MAX_VALUE ) {
rtn = ( ( Long ) value ).intValue();
}
}
View
4 hibernate-core/src/main/java/org/hibernate/hql/internal/classic/QueryTranslatorImpl.java
@@ -550,9 +550,7 @@ else if ( o instanceof Integer ) {
qe.setQueryString( queryString );
throw qe;
}
- if ( o instanceof Integer ) {
- return new int[]{ ( ( Integer ) o ).intValue() };
- }
+ if ( o instanceof Integer ) return new int[] { (Integer) o };
else {
return ArrayHelper.toIntArray( ( ArrayList ) o );
}
View
4 hibernate-core/src/main/java/org/hibernate/internal/AbstractSessionImpl.java
@@ -192,10 +192,10 @@ private void initQuery(Query query, NamedQueryDefinition nqd) {
query.setReadOnly( nqd.isReadOnly() );
if ( nqd.getTimeout() != null ) {
- query.setTimeout( nqd.getTimeout().intValue() );
+ query.setTimeout( nqd.getTimeout() );
}
if ( nqd.getFetchSize() != null ) {
- query.setFetchSize( nqd.getFetchSize().intValue() );
+ query.setFetchSize( nqd.getFetchSize() );
}
if ( nqd.getCacheMode() != null ) {
query.setCacheMode( nqd.getCacheMode() );
View
14 hibernate-core/src/main/java/org/hibernate/internal/FetchingScrollableResultsImpl.java
@@ -67,9 +67,9 @@ public FetchingScrollableResultsImpl(
* @return <tt>true</tt> if there is another result
*/
public boolean next() throws HibernateException {
- if ( maxPosition != null && maxPosition.intValue() <= currentPosition ) {
+ if ( maxPosition != null && maxPosition <= currentPosition ) {
currentRow = null;
- currentPosition = maxPosition.intValue() + 1;
+ currentPosition = maxPosition + 1;
return false;
}
@@ -130,7 +130,7 @@ public boolean previous() throws HibernateException {
getSession(),
getQueryParameters(),
false,
- ( maxPosition != null && currentPosition > maxPosition.intValue() )
+ ( maxPosition != null && currentPosition > maxPosition )
);
currentRow = new Object[] { loadResult };
@@ -186,10 +186,10 @@ else if ( positions < 0 ) {
public boolean last() throws HibernateException {
boolean more = false;
if ( maxPosition != null ) {
- if ( currentPosition > maxPosition.intValue() ) {
+ if ( currentPosition > maxPosition ) {
more = previous();
}
- for ( int i = currentPosition; i < maxPosition.intValue(); i++ ) {
+ for ( int i = currentPosition; i < maxPosition; i++ ) {
more = next();
}
}
@@ -284,7 +284,7 @@ public boolean isLast() throws HibernateException {
return false;
}
else {
- return currentPosition == maxPosition.intValue();
+ return currentPosition == maxPosition;
}
}
@@ -312,7 +312,7 @@ public boolean setRowNumber(int rowNumber) throws HibernateException {
else if ( rowNumber == -1 ) {
return last();
}
- else if ( maxPosition != null && rowNumber == maxPosition.intValue() ) {
+ else if ( maxPosition != null && rowNumber == maxPosition ) {
return last();
}
return scroll( rowNumber - currentPosition );
View
40 hibernate-core/src/main/java/org/hibernate/internal/util/collections/ArrayHelper.java
@@ -113,7 +113,7 @@ public static int indexOf(Object[] array, Object object) {
int[] arr = new int[ coll.size() ];
int i=0;
while( iter.hasNext() ) {
- arr[i++] = ( (Integer) iter.next() ).intValue();
+ arr[i++] = (Integer) iter.next();
}
return arr;
}
@@ -123,7 +123,7 @@ public static int indexOf(Object[] array, Object object) {
boolean[] arr = new boolean[ coll.size() ];
int i=0;
while( iter.hasNext() ) {
- arr[i++] = ( (Boolean) iter.next() ).booleanValue();
+ arr[i++] = (Boolean) iter.next();
}
return arr;
}
@@ -214,23 +214,29 @@ public static String toString( Object[] array ) {
}
public static boolean isAllNegative(int[] array) {
- for ( int i=0; i<array.length; i++ ) {
- if ( array[i] >=0 ) return false;
+ for ( int anArray : array ) {
+ if ( anArray >= 0 ) {
+ return false;
+ }
}
return true;
}
public static boolean isAllTrue(boolean[] array) {
- for ( int i=0; i<array.length; i++ ) {
- if ( !array[i] ) return false;
+ for ( boolean anArray : array ) {
+ if ( !anArray ) {
+ return false;
+ }
}
return true;
}
public static int countTrue(boolean[] array) {
int result=0;
- for ( int i=0; i<array.length; i++ ) {
- if ( array[i] ) result++;
+ for ( boolean anArray : array ) {
+ if ( anArray ) {
+ result++;
+ }
}
return result;
}
@@ -244,8 +250,10 @@ public static int countTrue(boolean[] array) {
}*/
public static boolean isAllFalse(boolean[] array) {
- for ( int i=0; i<array.length; i++ ) {
- if ( array[i] ) return false;
+ for ( boolean anArray : array ) {
+ if ( anArray ) {
+ return false;
+ }
}
return true;
}
@@ -299,8 +307,8 @@ else if (batchSize/2 < 10) {
public static int hash(Object[] array) {
int length = array.length;
int seed = SEED;
- for (int index = 0 ; index < length ; index++) {
- seed = hash( seed, array[index] == null ? 0 : array[index].hashCode() );
+ for ( Object anArray : array ) {
+ seed = hash( seed, anArray == null ? 0 : anArray.hashCode() );
}
return seed;
}
@@ -311,8 +319,8 @@ public static int hash(Object[] array) {
public static int hash(char[] array) {
int length = array.length;
int seed = SEED;
- for (int index = 0 ; index < length ; index++) {
- seed = hash( seed, array[index] ) ;
+ for ( char anArray : array ) {
+ seed = hash( seed, anArray );
}
return seed;
}
@@ -323,8 +331,8 @@ public static int hash(char[] array) {
public static int hash(byte[] bytes) {
int length = bytes.length;
int seed = SEED;
- for (int index = 0 ; index < length ; index++) {
- seed = hash( seed, bytes[index] ) ;
+ for ( byte aByte : bytes ) {
+ seed = hash( seed, aByte );
}
return seed;
}
View
2  hibernate-core/src/main/java/org/hibernate/internal/util/config/ConfigurationHelper.java
@@ -133,7 +133,7 @@ public static int getInt(String name, Map values, int defaultValue) {
return defaultValue;
}
if ( Integer.class.isInstance( value ) ) {
- return ( (Integer) value ).intValue();
+ return (Integer) value;
}
if ( String.class.isInstance( value ) ) {
return Integer.parseInt( (String) value );
View
4 hibernate-core/src/main/java/org/hibernate/loader/JoinWalker.java
@@ -724,7 +724,7 @@ protected JoinType getJoinType(boolean nullable, int currentDepth) {
protected boolean isTooDeep(int currentDepth) {
Integer maxFetchDepth = getFactory().getSettings().getMaximumFetchDepth();
- return maxFetchDepth!=null && currentDepth >= maxFetchDepth.intValue();
+ return maxFetchDepth!=null && currentDepth >= maxFetchDepth;
}
protected boolean isTooManyCollections() {
@@ -841,7 +841,7 @@ protected boolean isJoinable(
}
Integer maxFetchDepth = getFactory().getSettings().getMaximumFetchDepth();
- final boolean tooDeep = maxFetchDepth!=null && depth >= maxFetchDepth.intValue();
+ final boolean tooDeep = maxFetchDepth!=null && depth >= maxFetchDepth;
return !tooDeep && !isDuplicateAssociation(lhsTable, lhsColumnNames, type);
}
View
2  ...nate-core/src/main/java/org/hibernate/persister/entity/JoinedSubclassEntityPersister.java
@@ -807,7 +807,7 @@ public String getPropertyTableName(String propertyName) {
if ( index == null ) {
return null;
}
- return tableNames[propertyTableNumbers[index.intValue()]];
+ return tableNames[propertyTableNumbers[index]];
}
public String[] getConstraintOrderedTableNameClosure() {
View
4 hibernate-core/src/main/java/org/hibernate/persister/entity/SingleTableEntityPersister.java
@@ -927,7 +927,7 @@ private int getSubclassPropertyTableNumber(String propertyName, String entityNam
Type type = propertyMapping.toType(propertyName);
if ( type.isAssociationType() && ( (AssociationType) type ).useLHSPrimaryKey() ) return 0;
final Integer tabnum = (Integer) propertyTableNumbersByNameAndSubclass.get(entityName + '.' + propertyName);
- return tabnum==null ? 0 : tabnum.intValue();
+ return tabnum==null ? 0 : tabnum;
}
protected String getSequentialSelect(String entityName) {
@@ -1011,7 +1011,7 @@ protected boolean isNullableSubclassTable(int j) {
public String getPropertyTableName(String propertyName) {
Integer index = getEntityMetamodel().getPropertyIndexOrNull(propertyName);
if (index==null) return null;
- return qualifiedTableNames[ propertyTableNumbers[ index.intValue() ] ];
+ return qualifiedTableNames[ propertyTableNumbers[index] ];
}
public void postInstantiate() {
View
2  hibernate-core/src/main/java/org/hibernate/tuple/component/ComponentMetamodel.java
@@ -107,7 +107,7 @@ public int getPropertyIndex(String propertyName) {
if ( index == null ) {
throw new HibernateException( "component does not contain such a property [" + propertyName + "]" );
}
- return index.intValue();
+ return index;
}
public StandardProperty getProperty(String propertyName) {
View
4 hibernate-core/src/main/java/org/hibernate/tuple/entity/AbstractEntityTuplizer.java
@@ -645,13 +645,13 @@ public Object getPropertyValue(Object entity, String propertyPath) throws Hibern
: propertyPath;
}
index = entityMetamodel.getPropertyIndexOrNull( basePropertyName );
- final Object baseValue = getPropertyValue( entity, index.intValue() );
+ final Object baseValue = getPropertyValue( entity, index );
if ( loc > 0 ) {
if ( baseValue == null ) {
return null;
}
return getComponentValue(
- (ComponentType) entityMetamodel.getPropertyTypes()[index.intValue()],
+ (ComponentType) entityMetamodel.getPropertyTypes()[index],
baseValue,
propertyPath.substring(loc+1)
);
View
2  hibernate-core/src/main/java/org/hibernate/tuple/entity/EntityMetamodel.java
@@ -791,7 +791,7 @@ public int getPropertyIndex(String propertyName) {
if ( index == null ) {
throw new HibernateException("Unable to resolve property: " + propertyName);
}
- return index.intValue();
+ return index;
}
public Integer getPropertyIndexOrNull(String propertyName) {
View
2  hibernate-core/src/main/java/org/hibernate/type/IntegerType.java
@@ -79,7 +79,7 @@ public Integer seed(SessionImplementor session) {
@SuppressWarnings({ "UnnecessaryBoxing", "UnnecessaryUnboxing" })
public Integer next(Integer current, SessionImplementor session) {
- return Integer.valueOf( current.intValue() + 1 );
+ return current+1;
}
public Comparator<Integer> getComparator() {
View
2  ...rnate-core/src/main/java/org/hibernate/type/descriptor/sql/JdbcTypeJavaClassMappings.java
@@ -62,7 +62,7 @@ private JdbcTypeJavaClassMappings() {
public int determineJdbcTypeCodeForJavaClass(Class cls) {
Integer typeCode = JdbcTypeJavaClassMappings.javaClassToJdbcTypeCodeMap.get( cls );
if ( typeCode != null ) {
- return typeCode.intValue();
+ return typeCode;
}
int specialCode = cls.hashCode();
Please sign in to comment.
Something went wrong with that request. Please try again.