Author: dgolovin
Date: 2007-10-24 20:21:58 -0400 (Wed, 24 Oct 2007)
New Revision: 4497
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/AbstractConfigurationResource.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/OrmPropertyDescriptorsHolder.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/XMLFileReader.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/automapping/HibernateAutoMappingHelper.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/automapping/ReversStatistic.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/properties/BeanPropertySourceBase.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/properties/ChangebleIntegerPropertyDescriptor.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/properties/DBTablePropertyDescriptor.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/properties/ListPropertyDescriptor.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/util/TypeUtils.java
Log:
Code clean up.
new Integer() replaced for Integer.valueOf()
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/AbstractConfigurationResource.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/AbstractConfigurationResource.java 2007-10-25
00:21:48 UTC (rev 4496)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/AbstractConfigurationResource.java 2007-10-25
00:21:58 UTC (rev 4497)
@@ -119,7 +119,7 @@
StringTokenizer stringTokenizer1 = new StringTokenizer(out
.toString(), "\r\n");
while (stringTokenizer1.hasMoreTokens())
- hm.put(new Integer(i++), stringTokenizer1.nextToken());
+ hm.put(Integer.valueOf(i++), stringTokenizer1.nextToken());
boolean[] flag = new boolean[hm.size()];
StringTokenizer stringTokenizer2 = new StringTokenizer(
new String(output.toByteArray()), "\r\n");
@@ -129,27 +129,27 @@
String str3 = stringTokenizer2.nextToken();
String str4 = (new StringTokenizer(str3, "=")).nextToken();
for (i = 0; i < hm.size(); i++) {
- String str = (String) hm.get(new Integer(i));
+ String str = (String) hm.get(Integer.valueOf(i));
String str2 = str4;
if (str.startsWith(str2) && "\r\n".indexOf(str) == -1) {
- hm.put(new Integer(i), str3);
+ hm.put(Integer.valueOf(i), str3);
flag[i] = true;
break;
}
}
if (i == hm.size())
- hm2.put(new Integer(j++), str3);
+ hm2.put(Integer.valueOf(j++), str3);
}
i = j = 0;
String newStrOutput = new String();
while (hm.size() != 0) {
- String str5 = (String) hm.remove(new Integer(i++)) + '\n';
+ String str5 = (String) hm.remove(Integer.valueOf(i++)) + '\n';
if (str5.startsWith("#") || str5.indexOf((int) '=') == -1
|| flag[i - 1])
newStrOutput += str5;
}
while (hm2.size() != 0)
- newStrOutput += (String) hm2.remove(new Integer(j++)) + '\n';
+ newStrOutput += (String) hm2.remove(Integer.valueOf(j++)) + '\n';
res.setContents(new ByteArrayInputStream(newStrOutput
.getBytes()), IResource.NONE, null);
// #changed#
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/OrmPropertyDescriptorsHolder.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/OrmPropertyDescriptorsHolder.java 2007-10-25
00:21:48 UTC (rev 4496)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/OrmPropertyDescriptorsHolder.java 2007-10-25
00:21:58 UTC (rev 4497)
@@ -351,7 +351,7 @@
setDefaultPropertyValue(pd.getId(),OrmConfiguration.DEFAULT_SELECT_BEFORE_UPDATE);
// pd=new TextPropertyDescriptor(OrmConfiguration.CLASS_BATCH_SIZE,"fetching
\"batch size\"");
- pd=new
TextPropertyDescriptorWithType(OrmConfiguration.CLASS_BATCH_SIZE,Messages.OrmPropertyDescriptorsHolder_ClassBatchSizeN,true,true,false,new
Integer(1),null);
+ pd=new
TextPropertyDescriptorWithType(OrmConfiguration.CLASS_BATCH_SIZE,Messages.OrmPropertyDescriptorsHolder_ClassBatchSizeN,true,true,false,Integer.valueOf(1),null);
pd.setDescription(Messages.OrmPropertyDescriptorsHolder_ClassBatchSizeD);
addPropertyDescriptor(pd);
pd.setCategory(CLASS_MAPPING_CATEGORY);
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/XMLFileReader.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/XMLFileReader.java 2007-10-25
00:21:48 UTC (rev 4496)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/XMLFileReader.java 2007-10-25
00:21:58 UTC (rev 4497)
@@ -158,9 +158,9 @@
boolean cacheable = "true".equals( subnode.attributeValue(
"cacheable" ) );
String region = subnode.attributeValue( "cache-region" );
Attribute tAtt = subnode.attribute( "timeout" );
- Integer timeout = tAtt == null ? null : new Integer( tAtt.getValue() );
+ Integer timeout = tAtt == null ? null : Integer.valueOf( tAtt.getValue() );
Attribute fsAtt = subnode.attribute( "fetch-size" );
- Integer fetchSize = fsAtt == null ? null : new Integer( fsAtt.getValue() );
+ Integer fetchSize = fsAtt == null ? null : Integer.valueOf( fsAtt.getValue() );
String flushMode = subnode.attributeValue( "flush-mode" );
// edit tau - add storage in parametr for new NamedQueryDefinition(storage,...
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/automapping/HibernateAutoMappingHelper.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/automapping/HibernateAutoMappingHelper.java 2007-10-25
00:21:48 UTC (rev 4496)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/automapping/HibernateAutoMappingHelper.java 2007-10-25
00:21:58 UTC (rev 4497)
@@ -251,10 +251,10 @@
String output=Messages.HibernateAutoMappingHelper_ReportString1+
Messages.HibernateAutoMappingHelper_ReportString2+
- Messages.HibernateAutoMappingHelper_ReportString3+(new
Integer(tablesNumber-skippedTablesNumber-linkTablesNumber)).toString()+Messages.HibernateAutoMappingHelper_ReportString4+
+
Messages.HibernateAutoMappingHelper_ReportString3+(Integer.valueOf(tablesNumber-skippedTablesNumber-linkTablesNumber)).toString()+Messages.HibernateAutoMappingHelper_ReportString4+
Messages.HibernateAutoMappingHelper_ReportString5+
- Messages.HibernateAutoMappingHelper_ReportString6+(new
Integer(skippedTablesNumber)).toString()+Messages.HibernateAutoMappingHelper_ReportString7+
- Messages.HibernateAutoMappingHelper_ReportString8+(new
Integer(linkTablesNumber)).toString()+Messages.HibernateAutoMappingHelper_ReportString9+
+
Messages.HibernateAutoMappingHelper_ReportString6+(Integer.valueOf(skippedTablesNumber)).toString()+Messages.HibernateAutoMappingHelper_ReportString7+
+
Messages.HibernateAutoMappingHelper_ReportString8+(Integer.valueOf(linkTablesNumber)).toString()+Messages.HibernateAutoMappingHelper_ReportString9+
Messages.HibernateAutoMappingHelper_ReportString10;
InputStream input = new ByteArrayInputStream(output.getBytes());
// edit tau 18.01.2006
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/automapping/ReversStatistic.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/automapping/ReversStatistic.java 2007-10-25
00:21:48 UTC (rev 4496)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/automapping/ReversStatistic.java 2007-10-25
00:21:58 UTC (rev 4497)
@@ -72,9 +72,9 @@
public String[] getAllResults()
{
String[] res={
- (new Integer(tablesNumber-skippedTablesNumber-linkTablesNumber)).toString(),
- (new Integer(skippedTablesNumber)).toString(),
- (new Integer(linkTablesNumber)).toString()
+ (Integer.valueOf(tablesNumber-skippedTablesNumber-linkTablesNumber)).toString(),
+ (Integer.valueOf(skippedTablesNumber)).toString(),
+ (Integer.valueOf(linkTablesNumber)).toString()
};
return res;
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/properties/BeanPropertySourceBase.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/properties/BeanPropertySourceBase.java 2007-10-25
00:21:48 UTC (rev 4496)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/properties/BeanPropertySourceBase.java 2007-10-25
00:21:58 UTC (rev 4497)
@@ -144,7 +144,7 @@
if (value==null || value.toString().length()==0) {
//akuzmin
if(pd instanceof ChangebleIntegerPropertyDescriptor)
- value=new Integer(-1);
+ value = Integer.valueOf(-1);
else
value=oldValue;
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/properties/ChangebleIntegerPropertyDescriptor.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/properties/ChangebleIntegerPropertyDescriptor.java 2007-10-25
00:21:48 UTC (rev 4496)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/properties/ChangebleIntegerPropertyDescriptor.java 2007-10-25
00:21:58 UTC (rev 4497)
@@ -43,11 +43,11 @@
newvalue=((String)changedValue);
if ((techvalue==null)||(!(techvalue instanceof
Integer))||(!isValidValue(techvalue)))
if (isValidValue(newvalue))
- setTechvalue(new Integer(StringConverter.asInt(newvalue)));
+ setTechvalue(Integer.valueOf(StringConverter.asInt(newvalue)));
else if (StringConverter.asInt(newvalue)==defvalue)
{
- newvalue=(new Integer(defvalue+1)).toString();
- setTechvalue(new Integer(StringConverter.asInt(newvalue)));
+ newvalue=(Integer.valueOf(defvalue+1)).toString();
+ setTechvalue(Integer.valueOf(StringConverter.asInt(newvalue)));
}
}
@@ -69,7 +69,7 @@
if (!isValidValue(propertyValue))
if (newvalue!=null)
{
- setTechvalue(new Integer(StringConverter.asInt(newvalue)));
+ setTechvalue(Integer.valueOf(StringConverter.asInt(newvalue)));
if (isValidValue(newvalue))
return newvalue;
else return "";
@@ -80,7 +80,7 @@
{
if ((techvalue==null)||(!(techvalue instanceof
Integer))||(!isValidValue(techvalue)))
if (isValidValue(propertyValue))
- setTechvalue(new Integer(StringConverter.asInt(propertyValue.toString())));
+
setTechvalue(Integer.valueOf(StringConverter.asInt(propertyValue.toString())));
return super.getEditValue(propertyValue);
}
@@ -111,7 +111,7 @@
* @return Returns the defvalue.
*/
public Object getDefvalue() {
- return new Integer(defvalue);
+ return Integer.valueOf(defvalue);
}
/**
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/properties/DBTablePropertyDescriptor.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/properties/DBTablePropertyDescriptor.java 2007-10-25
00:21:48 UTC (rev 4496)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/properties/DBTablePropertyDescriptor.java 2007-10-25
00:21:58 UTC (rev 4497)
@@ -41,8 +41,8 @@
public Object getEditValue(Object propertyValue){
for(int i=0;i<getPropertyValues().length;++i)
- if(getPropertyValues()[i]==propertyValue || (propertyValue!=null &&
propertyValue.equals(getPropertyValues()[i])))return new Integer(i);
- return new Integer(0);
+ if(getPropertyValues()[i]==propertyValue || (propertyValue!=null &&
propertyValue.equals(getPropertyValues()[i])))return Integer.valueOf(i);
+ return Integer.valueOf(0);
}
public Object getPropertyValue(Object editValue){
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/properties/ListPropertyDescriptor.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/properties/ListPropertyDescriptor.java 2007-10-25
00:21:48 UTC (rev 4496)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/properties/ListPropertyDescriptor.java 2007-10-25
00:21:58 UTC (rev 4497)
@@ -38,8 +38,8 @@
public Object getEditValue(Object propertyValue){
for(int i=0;i<propertyValues.length;++i)
- if(propertyValues[i]==propertyValue || (propertyValue!=null &&
propertyValue.equals(propertyValues[i])))return new Integer(i);
- return new Integer(0);
+ if(propertyValues[i]==propertyValue || (propertyValue!=null &&
propertyValue.equals(propertyValues[i])))return Integer.valueOf(i);
+ return Integer.valueOf(0);
}
public Object getPropertyValue(Object editValue){
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/util/TypeUtils.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/util/TypeUtils.java 2007-10-25
00:21:48 UTC (rev 4496)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/util/TypeUtils.java 2007-10-25
00:21:58 UTC (rev 4497)
@@ -230,7 +230,7 @@
public static String SQLTypeToName(int jdbcType) {
// Return the JDBC type name
- return (String)jdbcConstantsMap.get(new Integer(jdbcType));
+ return (String)jdbcConstantsMap.get(Integer.valueOf(jdbcType));
}
// akuzmin 09.06.2005
public static int getSQLTypeCodeToName(String fQTypeName)