default:
if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
String s = "0000" + Integer.toString(ch, 16);
retval.append("\\u" + s.substring(s.length() - 4, s.length()));
if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
String s = "0000" + Integer.toString(ch, 16);
retval.append("\\u" + s.substring(s.length() - 4, s.length()));
} else {
retval.append(ch);
}
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/bsh/ParseException.java
|
|
File path: /jEdit-4.2/src/bsh/TokenMgrError.java
|
Method name: String add_escapes(String)
|
|
Method name: String addEscapes(String)
|
Number of AST nodes: 3
|
|
Number of AST nodes: 4
|
|
1 | default:↵ | | |
|
2 | if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {↵ | | 1 | if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {↵
|
3 | String s = "0000" + Integer.toString(ch, 16);↵ | | 2 | String s = "0000" + Integer.toString(ch, 16);↵
|
4 | retval.append("\\u" + s.substring(s.length() - 4, s.length())); | | 3 | retval.append("\\u" + s.substring(s.length() - 4, s.length()));↵
|
| | | 4 | } else {↵
|
| | | 5 | retval.append(ch);↵
|
| | | 6 | }
|
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.0 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 10 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 2 |
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) | 0.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
32 | if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) | | | |
33 | String s = "0000" + Integer.toString(ch, 16); | | 33 | String s = "0000" + Integer.toString(ch, 16); |
34 | retval.append("\\u" + s.substring(s.length() - 4, s.length())); | | 34 | retval.append("\\u" + s.substring(s.length() - 4, s.length())); |
| | | 35 | retval.append(ch); |
Precondition Violations (1)
Row |
Violation |
1 | Unmatched statement if((ch=str.charAt(i)) < 0x20 || ch > 0x7e) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |