File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/util/JMeterUtils.java | File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/util/JMeterUtils.java | |||
Method name: Vector getVector(Properties, String)
|
Method name: Hashtable getHashtable(Properties, String)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | Vector v = new Vector();↵ | 1 | Hashtable t = new Hashtable();↵ | |
2 | Enumeration names = properties.keys();↵ | 2 | Enumeration names = properties.keys();↵ | |
3 | while (names.hasMoreElements()) {↵ | 3 | while (names.hasMoreElements()) {↵ | |
4 | String prop = (String) names.nextElement();↵ | 4 | String prop = (String) names.nextElement();↵ | |
5 | if (prop.startsWith(name)) {↵ | 5 | if (prop.startsWith(name)) {↵ | |
6 | v.addElement(properties.getProperty(prop));↵ | 6 | t.put(prop.substring(name.length()), properties.getProperty(prop));↵ | |
7 | }↵ | 7 | }↵ | |
8 | }↵ | 8 | }↵ | |
9 | return v; | 9 | return t; | |
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 | 17 |
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) | 3.6 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||
---|---|---|---|---|---|---|---|
| 1 | Hashtable t = new Hashtable(); | |||||
1 | Vector v = new Vector(); | | |||||
2 | Enumeration names = properties.keys(); | 2 | Enumeration names = properties.keys(); | ||||
3 | while (names.hasMoreElements()) | 3 | while (names.hasMoreElements()) | ||||
4 | String prop = (String)names.nextElement(); | 4 | String prop = (String)names.nextElement(); | ||||
5 | if (prop.startsWith(name)) | 5 | if (prop.startsWith(name)) | ||||
|
| 6 | t.put(prop.substring(name.length()), properties.getProperty(prop)); | ||||
6 | v.addElement(properties.getProperty(prop)); |
| | ||||
|
| 7 | return t; | ||||
7 | return v; |
| |
Row | Violation |
---|---|
1 | Unmatched statement t.put(prop.substring(name.length()),properties.getProperty(prop)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement v.addElement(properties.getProperty(prop)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched return t; |
4 | Unmatched return v; |