File path: /jfreechart-1.0.10/tests/org/jfree/data/time/junit/DayTests.java | File path: /jfreechart-1.0.10/tests/org/jfree/data/time/junit/WeekTests.java | |||
Method name: void testGetLastMillisecondWithCalendar()
|
Method name: void testGetLastMillisecondWithCalendar()
|
|||
Number of AST nodes: 7 | Number of AST nodes: 8 | |||
1 | Day d = new Day(4, 5, 2001);↵ | 1 | Week w = new Week(52, 2001);↵ | |
2 | Calendar calendar = Calendar.getInstance(↵ | 2 | GregorianCalendar calendar = ↵ | |
3 | ↵ | 3 | new GregorianCalendar(Locale.GERMANY);↵ | |
4 | TimeZone.getTimeZone("Europe/London"), Locale.UK);↵ | 4 | calendar.setTimeZone(TimeZone.getTimeZone("Europe/Frankfurt"));↵ | |
5 | assertEquals(989017199999L, d.getLastMillisecond(calendar));↵ | 5 | assertEquals(1009756799999L, w.getLastMillisecond(calendar));↵ | |
6 | ↵ | 6 | ↵ | |
7 | // try null calendar↵ | 7 | // try null calendar↵ | |
8 | boolean pass = false;↵ | 8 | boolean pass = false;↵ | |
9 | try {↵ | 9 | try {↵ | |
10 | d.getLastMillisecond((Calendar) null);↵ | 10 | w.getLastMillisecond((Calendar) null);↵ | |
11 | }↵ | 11 | }↵ | |
12 | catch (NullPointerException e) {↵ | 12 | catch (NullPointerException e) {↵ | |
13 | pass = true;↵ | 13 | pass = true;↵ | |
14 | }↵ | 14 | }↵ | |
15 | assertTrue(pass); | 15 |
| |
See real code fragment | See real code fragment |
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.1 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 20 |
Number of mapped statements | 7 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 15.6 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Day d = new Day(4, 5, 2001); |
| 1 | Week w = new Week(52, 2001); | ||||||||||||||||||||||||||
2 | Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("Europe/London"), Locale.UK); |
| 2 | GregorianCalendar calendar = new GregorianCalendar(Locale.GERMANY); | ||||||||||||||||||||||||||
|
| 3 | calendar.setTimeZone(TimeZone.getTimeZone("Europe/Frankfurt")); | |||||||||||||||||||||||||||
3 | assertEquals(989017199999L, d.getLastMillisecond(calendar)); |
| 4 | assertEquals(1009756799999L, w.getLastMillisecond(calendar)); | ||||||||||||||||||||||||||
4 | boolean pass = false; | 5 | boolean pass = false; | |||||||||||||||||||||||||||
5 | try | 6 | try | |||||||||||||||||||||||||||
6 | d.getLastMillisecond((Calendar)null); |
| 7 | w.getLastMillisecond((Calendar)null); | ||||||||||||||||||||||||||
7 | assertTrue(pass); | 8 | assertTrue(pass); |
Row | Violation |
---|---|
1 | Expression new Day(4,5,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 new Day(4,5,2001) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression new Week(52,2001) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression new GregorianCalendar(Locale.GERMANY) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Unmatched statement calendar.setTimeZone(TimeZone.getTimeZone("Europe/Frankfurt")); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |