if (action != null) {
HashSet set = (HashSet) preActionListeners.get(action.getName());
if (set == null) {
set = new HashSet();
}
set.add(listener);
preActionListeners.put(action.getName(), set);
}
if (action != null) {
HashSet set = (HashSet) postActionListeners.get(action.getName());
if (set == null) {
set = new HashSet();
}
set.add(listener);
postActionListeners.put(action.getName(), set);
}
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/action/ActionRouter.java
|
|
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/report/gui/action/ReportActionRouter.java
|
Method name: void addPreActionListener(Class, ActionListener)
|
|
Method name: void addPostActionListener(Class, ActionListener)
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | if (action != null) {↵ | | 1 | if (action != null) {↵
|
2 | HashSet set = (HashSet) preActionListeners.get(action.getName());↵ | | 2 | HashSet set = (HashSet) postActionListeners.get(action.getName());↵
|
3 | if (set == null) {↵ | | 3 | if (set == null) {↵
|
4 | set = new HashSet();↵ | | 4 | set = new HashSet();↵
|
5 | }↵ | | 5 | }↵
|
6 | set.add(listener);↵ | | 6 | set.add(listener);↵
|
7 | preActionListeners.put(action.getName(), set);↵ | | 7 | postActionListeners.put(action.getName(), set);↵
|
8 | } | | 8 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 20 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 1.2 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (action != null) | | 1 | if (action != null) |
2 | HashSet set = (HashSet)preActionListeners.get(action.getName()); | | 2 | HashSet set = (HashSet)postActionListeners.get(action.getName()); |
3 | | | 3 | |
4 | | | 4 | |
5 | | | 5 | |
6 | preActionListeners.put(action.getName(), set); | | 6 | postActionListeners.put(action.getName(), set); |
Precondition Violations (0)
Row |
Violation |