Author: hardy.ferentschik
Date: 2010-10-06 07:19:32 -0400 (Wed, 06 Oct 2010)
New Revision: 20779
Modified:
jpamodelgen/trunk/src/main/java/org/hibernate/jpamodelgen/util/Constants.java
jpamodelgen/trunk/src/main/java/org/hibernate/jpamodelgen/util/StringUtil.java
Log:
METAGEN-35 Some coding style improvements
Modified: jpamodelgen/trunk/src/main/java/org/hibernate/jpamodelgen/util/Constants.java
===================================================================
---
jpamodelgen/trunk/src/main/java/org/hibernate/jpamodelgen/util/Constants.java 2010-10-06
11:18:07 UTC (rev 20778)
+++
jpamodelgen/trunk/src/main/java/org/hibernate/jpamodelgen/util/Constants.java 2010-10-06
11:19:32 UTC (rev 20779)
@@ -27,7 +27,7 @@
/**
* @author Hardy Ferentschik
*/
-public class Constants {
+public final class Constants {
public static Map<String, String> COLLECTIONS = new HashMap<String,
String>();
static {
Modified: jpamodelgen/trunk/src/main/java/org/hibernate/jpamodelgen/util/StringUtil.java
===================================================================
---
jpamodelgen/trunk/src/main/java/org/hibernate/jpamodelgen/util/StringUtil.java 2010-10-06
11:18:07 UTC (rev 20778)
+++
jpamodelgen/trunk/src/main/java/org/hibernate/jpamodelgen/util/StringUtil.java 2010-10-06
11:19:32 UTC (rev 20779)
@@ -22,7 +22,7 @@
/**
* @author Hardy Ferentschik
*/
-public class StringUtil {
+public final class StringUtil {
private static final String NAME_SEPARATOR = ".";
private static final String PROPERTY_PREFIX_GET = "get";
private static final String PROPERTY_PREFIX_IS = "is";
@@ -63,16 +63,17 @@
return null;
}
+ String tmp = name;
if ( name.startsWith( PROPERTY_PREFIX_GET ) ) {
- name = name.replaceFirst( PROPERTY_PREFIX_GET, "" );
+ tmp = name.replaceFirst( PROPERTY_PREFIX_GET, "" );
}
else if ( name.startsWith( PROPERTY_PREFIX_IS ) ) {
- name = name.replaceFirst( PROPERTY_PREFIX_IS, "" );
+ tmp = name.replaceFirst( PROPERTY_PREFIX_IS, "" );
}
else if ( name.startsWith( PROPERTY_PREFIX_HAS ) ) {
- name = name.replaceFirst( PROPERTY_PREFIX_HAS, "" );
+ tmp = name.replaceFirst( PROPERTY_PREFIX_HAS, "" );
}
- return name.substring(0,1).toLowerCase() + name.substring(1);
+ return tmp.substring(0,1).toLowerCase() + tmp.substring(1);
}
}
Show replies by date