diff --git a/core/src/main/java/org/hibernate/dialect/TypeNames.java b/core/src/main/java/org/hibernate/dialect/TypeNames.java index f5d06fa3d8..98d9c3ea6e 100644 --- a/core/src/main/java/org/hibernate/dialect/TypeNames.java +++ b/core/src/main/java/org/hibernate/dialect/TypeNames.java @@ -73,7 +73,7 @@ public class TypeNames { * @return the default type name associated with specified key */ public String get(int typecode) throws MappingException { - String result = defaults.get( new Integer(typecode) ); + String result = defaults.get( typecode ); if (result==null) throw new MappingException("No Dialect mapping for JDBC type: " + typecode); return result; } @@ -88,12 +88,12 @@ public class TypeNames { * if available and the default type name otherwise */ public String get(int typecode, int size, int precision, int scale) throws MappingException { - Map map = weighted.get( new Integer(typecode) ); + Map map = weighted.get( typecode ); if ( map!=null && map.size()>0 ) { // iterate entries ordered by capacity to find first fit for (Map.Entry entry: map.entrySet()) { - if ( size <= ( (Integer) entry.getKey() ).intValue() ) { - return replace( (String) entry.getValue(), size, precision, scale ); + if ( size <= ( entry.getKey() ).intValue() ) { + return replace( entry.getValue(), size, precision, scale ); } } } @@ -111,12 +111,12 @@ public class TypeNames { * @param typecode the type key */ public void put(int typecode, int capacity, String value) { - Map map = weighted.get( new Integer(typecode) ); + Map map = weighted.get( typecode ); if (map == null) {// add new ordered map map = new TreeMap(); - weighted.put( new Integer(typecode), map ); + weighted.put( typecode, map ); } - map.put(new Integer(capacity), value); + map.put(capacity, value); } /** @@ -124,7 +124,7 @@ public class TypeNames { * @param typecode the type key */ public void put(int typecode, String value) { - defaults.put( new Integer(typecode), value ); + defaults.put( typecode, value ); } }