File path: /jEdit-4.2/src/org/gjt/sp/jedit/PluginJAR.java | File path: /jEdit-4.2/src/org/gjt/sp/jedit/PluginJAR.java | |||
Method name: String readString(DataInputStream)
|
Method name: String[] readStringArray(DataInputStream)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | int len = din.readInt();↵ | 1 | int len = din.readInt();↵ | |
2 | if(len == 0)↵ | 2 | if(len == 0)↵ | |
3 | return null;↵ | 3 | return null;↵ | |
4 | char[] str = new char[len];↵ | 4 | String[] str = new String[len];↵ | |
5 | for(int i = 0; i < len; i++)↵ | 5 | for(int i = 0; i < len; i++)↵ | |
6 | ↵ | 6 | {↵ | |
7 | str[i] = din.readChar();↵ | 7 | str[i] = readString(din);↵ | |
8 | ↵ | 8 | }↵ | |
9 | return new String(str); | 9 | return str; | |
See real code fragment | See real code fragment |
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.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 22 |
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 0.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||
---|---|---|---|---|---|---|---|
1 | int len = din.readInt(); | 1 | int len = din.readInt(); | ||||
2 | if (len == 0) | 2 | if (len == 0) | ||||
3 | return null; | 3 | return null; | ||||
| 4 | String[] str = new String[len]; | |||||
4 | char[] str = new char[len]; | | |||||
5 | for (int i = 0; i < len; i++) | 5 | for (int i = 0; i < len; i++) | ||||
|
| 6 | str[i] = readString(din); | ||||
6 | str[i] = din.readChar(); |
| | ||||
|
| 7 | return str; | ||||
7 | return new String(str); |
| |
Row | Violation |
---|---|
1 | Unmatched statement str[i]=readString(din); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement str[i]=din.readChar(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched return str; |
4 | Unmatched return new String(str); |
5 | Clone fragment #1 returns variables len, i , while Clone fragment #2 returns variables len, i |