if ((Os.isFamily("dos") || Os.isFamily("netware"))
&& s1.length() >= 1 && s2.length() >= 1) {
StringBuffer sb1 = new StringBuffer(s1);
StringBuffer sb2 = new StringBuffer(s2);
sb1.setCharAt(0, Character.toUpperCase(s1.charAt(0)));
sb2.setCharAt(0, Character.toUpperCase(s2.charAt(0)));
assertEquals(sb1.toString(), sb2.toString());
} else {
assertEquals(s1, s2);
}
if ((Os.isFamily("dos") || Os.isFamily("netware"))
&& s1.length() > 0 && s2.length() > 0) {
StringBuffer sb1 = new StringBuffer(s1);
StringBuffer sb2 = new StringBuffer(s2);
sb1.setCharAt(0, Character.toUpperCase(s1.charAt(0)));
sb2.setCharAt(0, Character.toUpperCase(s2.charAt(0)));
assertEquals(sb1.toString(), sb2.toString());
} else {
assertEquals(s1, s2);
}
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/ProjectTest.java
|
|
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/util/FileUtilsTest.java
|
Method name: void assertEqualsIgnoreDriveCase(String, String)
|
|
Method name: void assertEqualsIgnoreDriveCase(String, String)
|
Number of AST nodes: 7
|
|
Number of AST nodes: 7
|
|
1 | if ((Os.isFamily("dos") || Os.isFamily("netware"))↵ | | 1 | if ((Os.isFamily("dos") || Os.isFamily("netware"))↵
|
2 | && s1.length() >= 1 && s2.length() >= 1) {↵ | | 2 | && s1.length() > 0 && s2.length() > 0) {↵
|
3 | StringBuffer sb1 = new StringBuffer(s1);↵ | | 3 | StringBuffer sb1 = new StringBuffer(s1);↵
|
4 | StringBuffer sb2 = new StringBuffer(s2);↵ | | 4 | StringBuffer sb2 = new StringBuffer(s2);↵
|
5 | sb1.setCharAt(0, Character.toUpperCase(s1.charAt(0)));↵ | | 5 | sb1.setCharAt(0, Character.toUpperCase(s1.charAt(0)));↵
|
6 | sb2.setCharAt(0, Character.toUpperCase(s2.charAt(0)));↵ | | 6 | sb2.setCharAt(0, Character.toUpperCase(s2.charAt(0)));↵
|
7 | assertEquals(sb1.toString(), sb2.toString());↵ | | 7 | assertEquals(sb1.toString(), sb2.toString());↵
|
8 | } else {↵ | | 8 | } else {↵
|
9 | assertEquals(s1, s2);↵ | | 9 | assertEquals(s1, s2);↵
|
10 | } | | 10 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 0 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.4 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 1 |