public String logicalCollectionTableName(String tableName, String ownerEntityTable, String associatedEntityTable, String propertyName ) { if ( tableName != null ) { return tableName; } else { //use of a stringbuffer to workaround a JDK bug return new StringBuffer(ownerEntityTable).append("_") .append( associatedEntityTable != null ? associatedEntityTable : StringHelper.unqualify( propertyName ) ).toString();
public String logicalCollectionTableName(String tableName, String ownerEntityTable, String associatedEntityTable, String propertyName ) { if ( tableName != null ) { return tableName; } else { //use of a stringbuffer to workaround a JDK bug return new StringBuffer(ownerEntityTable).append("_") .append( associatedEntityTable != null ? associatedEntityTable : StringHelper.unqualify( propertyName ) ).toString();
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/cfg/DefaultNamingStrategy.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/cfg/ImprovedNamingStrategy.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public String logicalCollectionTableName(String tableName,
1
public String logicalCollectionTableName(String tableName,
2
											 String ownerEntityTable, String associatedEntityTable, String propertyName
2
											 String ownerEntityTable, String associatedEntityTable, String propertyName
3
	) {
3
	) {
4
		if ( tableName != null ) {
4
		if ( tableName != null ) {
5
			return tableName;
5
			return tableName;
6
		}
6
		}
7
		else {
7
		else {
8
			//use of a stringbuffer to workaround a JDK bug
8
			//use of a stringbuffer to workaround a JDK bug
9
			return new StringBuffer(ownerEntityTable).append("_")
9
			return new StringBuffer(ownerEntityTable).append("_")
10
					.append(
10
					.append(
11
						associatedEntityTable != null ?
11
						associatedEntityTable != null ?
12
						associatedEntityTable :
12
						associatedEntityTable :
13
						StringHelper.unqualify( propertyName )
13
						StringHelper.unqualify( propertyName )
14
					).toString();
14
					).toString();
15
		
15
		
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0