String lastSegment = uri.lastSegment();
if ("bin".equals(lastSegment) || "runtime".equals(lastSegment))
{
uri = uri.trimSegments(1);
}
uri = uri.appendSegments(relativePath);
String lastSegment = uri.lastSegment();
if ("bin".equals(lastSegment) || "runtime".equals(lastSegment))
{
uri = uri.trimSegments(1);
}
uri = uri.appendSegment("plugin.properties");
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/common/EMFPlugin.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/common/util/DelegatingResourceLocator.java
|
Method name: void main(String[])
|
|
Method name: URL getBaseURL()
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | String lastSegment = uri.lastSegment();↵ | | 1 | String lastSegment = uri.lastSegment();↵
|
2 | if ("bin".equals(lastSegment) || "runtime".equals(lastSegment))↵ | | 2 | if ("bin".equals(lastSegment) || "runtime".equals(lastSegment))↵
|
3 | {↵ | | 3 | {↵
|
4 | uri = uri.trimSegments(1);↵ | | 4 | uri = uri.trimSegments(1);↵
|
5 | }↵ | | 5 | ↵
|
| | | 6 | }↵
|
6 | uri = uri.appendSegments(relativePath); | | 7 | uri = uri.appendSegment("plugin.properties");
|
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.3 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 9 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 3 |
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.6 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
20 | String lastSegment = uri.lastSegment(); | | 21 | String lastSegment = uri.lastSegment(); |
21 | if ("bin".equals(lastSegment) || "runtime".equals(lastSegment)) | | 22 | if ("bin".equals(lastSegment) || "runtime".equals(lastSegment)) |
22 | uri = uri.trimSegments(1); | | 23 | uri = uri.trimSegments(1); |
23 | uri = uri.appendSegments(relativePath); | | | |
| | | 24 | uri = uri.appendSegment("plugin.properties"); |
Precondition Violations (0)
Row |
Violation |