File path: /jfreechart-1.0.10/tests/org/jfree/data/time/junit/MonthTests.java | File path: /jfreechart-1.0.10/tests/org/jfree/data/time/junit/WeekTests.java | |||
Method name: void testGetFirstMillisecondWithCalendar()
|
Method name: void testGetLastMillisecondWithCalendar()
|
|||
Number of AST nodes: 8 | Number of AST nodes: 8 | |||
1 | Month m = new Month(1, 2001);↵ | 1 | Week w = new Week(52, 2001);↵ | |
2 | GregorianCalendar calendar = new GregorianCalendar(Locale.GERMANY);↵ | 2 | GregorianCalendar calendar = new GregorianCalendar(Locale.GERMANY);↵ | |
3 | calendar.setTimeZone(TimeZone.getTimeZone("Europe/Frankfurt"));↵ | 3 | calendar.setTimeZone(TimeZone.getTimeZone("Europe/Frankfurt"));↵ | |
4 | assertEquals(978307200000L, m.getFirstMillisecond(calendar));↵ | 4 | assertEquals(1009756799999L, w.getLastMillisecond(calendar));↵ | |
5 | ↵ | 5 | ↵ | |
6 | // try null calendar↵ | 6 | // try null calendar↵ | |
7 | boolean pass = false;↵ | 7 | boolean pass = false;↵ | |
8 | try {↵ | 8 | try {↵ | |
9 | m.getFirstMillisecond((Calendar) null);↵ | 9 | w.getLastMillisecond((Calendar) null);↵ | |
10 | }↵ | 10 | }↵ | |
11 | catch (NullPointerException e) {↵ | 11 | catch (NullPointerException e) {↵ | |
12 | pass = true;↵ | 12 | pass = true;↵ | |
13 | }↵ | 13 | }↵ | |
14 | assertTrue(pass); | 14 |
| |
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.1 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 20 |
Number of mapped statements | 8 |
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) | 16.1 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Month m = new Month(1, 2001); |
| 1 | Week w = new Week(52, 2001); | ||||||||||||||||||||||||
2 | GregorianCalendar calendar = new GregorianCalendar(Locale.GERMANY); | 2 | GregorianCalendar calendar = new GregorianCalendar(Locale.GERMANY); | |||||||||||||||||||||||||
3 | calendar.setTimeZone(TimeZone.getTimeZone("Europe/Frankfurt")); | 3 | calendar.setTimeZone(TimeZone.getTimeZone("Europe/Frankfurt")); | |||||||||||||||||||||||||
4 | assertEquals(978307200000L, m.getFirstMillisecond(calendar)); |
| 4 | assertEquals(1009756799999L, w.getLastMillisecond(calendar)); | ||||||||||||||||||||||||
5 | boolean pass = false; | 5 | boolean pass = false; | |||||||||||||||||||||||||
6 | try | 6 | try | |||||||||||||||||||||||||
7 | m.getFirstMillisecond((Calendar)null); |
| 7 | w.getLastMillisecond((Calendar)null); | ||||||||||||||||||||||||
8 | assertTrue(pass); | 8 | assertTrue(pass); |
Row | Violation |
---|---|
1 | Expression new Month(1,2001) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression new Week(52,2001) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression m.getFirstMillisecond(calendar) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression w.getLastMillisecond(calendar) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression m.getFirstMillisecond((Calendar)null) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression w.getLastMillisecond((Calendar)null) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression m.getFirstMillisecond((Calendar)null) is a void method call, and thus it cannot be parameterized |
8 | Expression w.getLastMillisecond((Calendar)null) is a void method call, and thus it cannot be parameterized |