StringBuffer s = new StringBuffer();
s.append( '[' );
if( entityName == null ) {
s.append( "<null entity name>" );
}
else {
s.append( entityName );
}
s.append( '#' );
if ( id == null ) {
s.append( "<null>" );
}
else {
s.append( id );
}
s.append( ']' );
return s.toString();
StringBuffer s = new StringBuffer();
s.append( '[' );
if( role == null ) {
s.append( "<unreferenced>" );
}
else {
s.append( role );
s.append( '#' );
if ( id == null ) {
s.append( "<null>" );
}
else {
s.append( id );
}
}
s.append( ']' );
return s.toString();
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/pretty/MessageHelper.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/pretty/MessageHelper.java
|
Method name: String infoString(String, Serializable)
|
|
Method name: String collectionInfoString(String, Serializable)
|
Number of AST nodes: 11
|
|
Number of AST nodes: 11
|
|
1 | StringBuffer s = new StringBuffer();↵ | | 1 | StringBuffer s = new StringBuffer();↵
|
2 | s.append( '[' );↵ | | 2 | s.append( '[' );↵
|
3 | if( entityName == null ) {↵ | | 3 | if( role == null ) {↵
|
4 | s.append( "<null entity name>" );↵ | | 4 | s.append( "<unreferenced>" );↵
|
5 | }↵ | | 5 | }↵
|
6 | else {↵ | | 6 | else {↵
|
7 | s.append( entityName );↵ | | 7 | s.append( role );↵
|
8 | }↵ | | 8 | ↵
|
9 | s.append( '#' );↵ | | 9 | s.append( '#' );↵
|
|
10 | if ( id == null ) {↵ | | 10 | if ( id == null ) {↵
|
11 | s.append( "<null>" );↵ | | 11 | s.append( "<null>" );↵
|
12 | }↵ | | 12 | }↵
|
13 | else {↵ | | 13 | else {↵
|
14 | s.append( id );↵ | | 14 | s.append( id );↵
|
15 | ↵ | | 15 | }↵
|
16 | }↵ | | 16 | }↵
|
17 | s.append( ']' );↵ | | 17 | s.append( ']' );↵
|
|
18 | return s.toString(); | | 18 | return s.toString();
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 14 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 1.1 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | StringBuffer s = new StringBuffer(); | | | |
| | | 5 | s.append(role); |
2 | s.append('['); | | 6 | s.append('#'); |
3 | if (entityName == null) | | 7 | if (id == null) |
4 | s.append("<null entity name>"); | | 8 | |
| | | | |
5 | | | 9 | |
Precondition Violations (2)
Row |
Violation |
1 | Type java.lang.String of variable entityName does not match with type java.io.Serializable of variable id |
2 | Type java.lang.String of variable entityName does not match with type java.io.Serializable of variable id |