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/YearTests.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 | Year y = new Year(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(1009843199999L, y.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 | y.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 | 18 |
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) | 14.2 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Month m = new Month(1, 2001); |
| 1 | Year y = new Year(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(1009843199999L, y.getLastMillisecond(calendar)); | ||||||||||||||||||||||||||
5 | boolean pass = false; | 5 | boolean pass = false; | |||||||||||||||||||||||||||
6 | try | 6 | try | |||||||||||||||||||||||||||
7 | m.getFirstMillisecond((Calendar)null); |
| 7 | y.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 Year(2001) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression new Month(1,2001) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression new Year(2001) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression m.getFirstMillisecond(calendar) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression y.getLastMillisecond(calendar) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression m.getFirstMillisecond((Calendar)null) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression y.getLastMillisecond((Calendar)null) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Expression m.getFirstMillisecond((Calendar)null) is a void method call, and thus it cannot be parameterized |
10 | Expression y.getLastMillisecond((Calendar)null) is a void method call, and thus it cannot be parameterized |