File path: /jfreechart-1.0.10/tests/org/jfree/chart/axis/junit/DateAxisTests.java | File path: /jfreechart-1.0.10/tests/org/jfree/chart/axis/junit/NumberAxisTests.java | |||
Method name: void testEquals()
|
Method name: void testEquals()
|
|||
Number of AST nodes: 21 | Number of AST nodes: 23 | |||
1 | DateAxis a1 = new DateAxis("Test");↵ | 1 | NumberAxis a1 = new NumberAxis("Test");↵ | |
2 | DateAxis a2 = new DateAxis("Test");↵ | 2 | NumberAxis a2 = new NumberAxis("Test");↵ | |
3 | assertTrue(a1.equals(a2));↵ | 3 | assertTrue(a1.equals(a2));↵ | |
4 | assertFalse(a1.equals(null));↵ | 4 | ↵ | |
5 | assertFalse(a1.equals("Some non-DateAxis object"));↵ | |||
6 | ↵ | |||
7 | // tickUnit ↵ | |||
8 | a1.setTickUnit(new DateTickUnit(DateTickUnit.DAY, 7)↵ | |||
5 | //private boolean autoRangeIncludesZero;↵ | |||
6 | a1.setAutoRangeIncludesZero(false);↵ | |||
7 | assertFalse(a1.equals(a2));↵ | |||
8 | a2.setAutoRangeIncludesZero(false);↵ | |||
9 | assertTrue(a1.equals(a2));↵ | |||
10 | //private boolean autoRangeStickyZero;↵ | |||
9 | );↵ | 11 | a1.setAutoRangeStickyZero(false);↵ | |
10 | assertFalse(a1.equals(a2));↵ | 12 | assertFalse(a1.equals(a2));↵ | |
11 | a2.setTickUnit(new DateTickUnit(DateTickUnit.DAY, 7));↵ | 13 | a2.setAutoRangeStickyZero(false);↵ | |
12 | assertTrue(a1.equals(a2));↵ | 14 | assertTrue(a1.equals(a2));↵ | |
13 | // dateFormatOverride ↵ | 15 | //↵ | |
14 | a1.setDateFormatOverride(new SimpleDateFormat("yyyy"↵ | 16 | private NumberTickUnit tickUnit;↵ | |
15 | ));↵ | 17 | a1.setTickUnit(new NumberTickUnit(25.0));↵ | |
16 | assertFalse(a1.equals(a2));↵ | 18 | assertFalse(a1.equals(a2));↵ | |
17 | a2.setDateFormatOverride(new SimpleDateFormat("yyyy"));↵ | 19 | a2.setTickUnit(new NumberTickUnit(25.0));↵ | |
18 | assertTrue(a1.equals(a2));↵ | 20 | assertTrue(a1.equals(a2));↵ | |
19 | // tickMarkPosition↵ | 21 | //↵ | |
20 | a1.setTickMarkPosition(DateTickMarkPosition.END↵ | 22 | private NumberFormat numberFormatOverride;↵ | |
21 | );↵ | 23 | a1.setNumberFormatOverride(new DecimalFormat("0.00"));↵ | |
22 | assertFalse(a1.equals(a2));↵ | 24 | assertFalse(a1.equals(a2));↵ | |
23 | a2.setTickMarkPosition(DateTickMarkPosition.END);↵ | 25 | a2.setNumberFormatOverride(new DecimalFormat("0.00"));↵ | |
24 | assertTrue(a1.equals(a2));↵ | 26 | assertTrue(a1.equals(a2));↵ | |
25 | ↵ | 27 | ↵ | |
26 | // timeline↵ | 28 | ↵ | |
27 | a1.setTimeline(SegmentedTimeline.newMondayThroughFridayTimeline());↵ | |||
28 | assertFalse(a1.equals(a2));↵ | |||
29 | a2.setTimeline(SegmentedTimeline.newMondayThroughFridayTimeline()↵ | 29 | a1.setRangeType(RangeType.POSITIVE);↵ | |
30 | assertFalse(a1.equals(a2));↵ | |||
30 | );↵ | 31 | a2.setRangeType(RangeType.POSITIVE);↵ | |
31 | assertTrue(a1.equals(a2)); | 32 |
| |
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.0 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 170 |
Number of mapped statements | 16 |
Number of unmapped statements in the first code fragment | 5 |
Number of unmapped statements in the second code fragment | 7 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | DateAxis a1 = new DateAxis("Test"); |
| 1 | NumberAxis a1 = new NumberAxis("Test"); | ||||||||||||||||||||||||
2 | DateAxis a2 = new DateAxis("Test"); |
| 2 | NumberAxis a2 = new NumberAxis("Test"); | ||||||||||||||||||||||||
3 | assertTrue(a1.equals(a2)); |
| 3 | assertTrue(a1.equals(a2)); | ||||||||||||||||||||||||
|
| 4 | a1.setAutoRangeIncludesZero(false); | |||||||||||||||||||||||||
|
| 6 | a2.setAutoRangeIncludesZero(false); | |||||||||||||||||||||||||
|
| 8 | a1.setAutoRangeStickyZero(false); | |||||||||||||||||||||||||
|
| 10 | a2.setAutoRangeStickyZero(false); | |||||||||||||||||||||||||
4 | assertFalse(a1.equals(null)); |
| 21 | assertFalse(a1.equals(a2)); | ||||||||||||||||||||||||
5 | assertFalse(a1.equals("Some non-DateAxis object")); |
| | |||||||||||||||||||||||||
6 | a1.setTickUnit(new DateTickUnit(DateTickUnit.DAY, 7)); |
| 12 | a1.setTickUnit(new NumberTickUnit(25.0)); | ||||||||||||||||||||||||
7 | assertFalse(a1.equals(a2)); |
| 5 | assertFalse(a1.equals(a2)); | ||||||||||||||||||||||||
8 | a2.setTickUnit(new DateTickUnit(DateTickUnit.DAY, 7)); |
| 14 | a2.setTickUnit(new NumberTickUnit(25.0)); | ||||||||||||||||||||||||
9 | assertTrue(a1.equals(a2)); |
| 7 | assertTrue(a1.equals(a2)); | ||||||||||||||||||||||||
10 | a1.setDateFormatOverride(new SimpleDateFormat("yyyy")); |
| 16 | a1.setNumberFormatOverride(new DecimalFormat("0.00")); | ||||||||||||||||||||||||
11 | assertFalse(a1.equals(a2)); |
| 9 | assertFalse(a1.equals(a2)); | ||||||||||||||||||||||||
12 | a2.setDateFormatOverride(new SimpleDateFormat("yyyy")); |
| 18 | a2.setNumberFormatOverride(new DecimalFormat("0.00")); | ||||||||||||||||||||||||
13 | assertTrue(a1.equals(a2)); |
| 11 | assertTrue(a1.equals(a2)); | ||||||||||||||||||||||||
14 | a1.setTickMarkPosition(DateTickMarkPosition.END); |
| | |||||||||||||||||||||||||
15 | assertFalse(a1.equals(a2)); |
| 13 | assertFalse(a1.equals(a2)); | ||||||||||||||||||||||||
16 | a2.setTickMarkPosition(DateTickMarkPosition.END); |
| | |||||||||||||||||||||||||
17 | assertTrue(a1.equals(a2)); |
| 15 | assertTrue(a1.equals(a2)); | ||||||||||||||||||||||||
18 | a1.setTimeline(SegmentedTimeline.newMondayThroughFridayTimeline()); |
| | |||||||||||||||||||||||||
19 | assertFalse(a1.equals(a2)); |
| 17 | assertFalse(a1.equals(a2)); | ||||||||||||||||||||||||
20 | a2.setTimeline(SegmentedTimeline.newMondayThroughFridayTimeline()); |
| | |||||||||||||||||||||||||
21 | assertTrue(a1.equals(a2)); |
| 19 | assertTrue(a1.equals(a2)); | ||||||||||||||||||||||||
|
| 20 | a1.setRangeType(RangeType.POSITIVE); | |||||||||||||||||||||||||
|
| 22 | a2.setRangeType(RangeType.POSITIVE); | |||||||||||||||||||||||||
|
| 23 | assertTrue(a1.equals(a2)); |
Row | Violation |
---|---|
1 | Expression new DateAxis("Test") cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression new NumberAxis("Test") cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression new DateAxis("Test") cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression new NumberAxis("Test") cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Unmatched statement a1.setAutoRangeIncludesZero(false); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
6 | Unmatched statement a2.setAutoRangeIncludesZero(false); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
7 | Unmatched statement a1.setAutoRangeStickyZero(false); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
8 | Unmatched statement a2.setAutoRangeStickyZero(false); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
9 | Expression a2 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
10 | Unmatched statement assertFalse(a1.equals("Some non-DateAxis object")); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
11 | Expression new DateTickUnit(DateTickUnit.DAY,7) cannot be unified with expression new NumberTickUnit(25.0) , because common superclass type org.jfree.chart.axis.TickUnit cannot be passed as an argument to public void setTickUnit(org.jfree.chart.axis.DateTickUnit) |
12 | Expression a1 cannot be unified with expression a1 , because common superclass org.jfree.chart.axis.ValueAxis does not declare member(s) public void setTickUnit(org.jfree.chart.axis.DateTickUnit) , public void setTickUnit(org.jfree.chart.axis.NumberTickUnit) |
13 | Expression new DateTickUnit(DateTickUnit.DAY,7) cannot be unified with expression new NumberTickUnit(25.0) , because common superclass type org.jfree.chart.axis.TickUnit cannot be passed as an argument to public void setTickUnit(org.jfree.chart.axis.DateTickUnit) |
14 | Expression a2 cannot be unified with expression a2 , because common superclass org.jfree.chart.axis.ValueAxis does not declare member(s) public void setTickUnit(org.jfree.chart.axis.DateTickUnit) , public void setTickUnit(org.jfree.chart.axis.NumberTickUnit) |
15 | Expression a1.setDateFormatOverride(new SimpleDateFormat("yyyy")) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
16 | Expression a1.setNumberFormatOverride(new DecimalFormat("0.00")) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
17 | Expression a1.setDateFormatOverride(new SimpleDateFormat("yyyy")) is a void method call, and thus it cannot be parameterized |
18 | Expression a1.setNumberFormatOverride(new DecimalFormat("0.00")) is a void method call, and thus it cannot be parameterized |
19 | Expression a1 cannot be unified with expression a1 , because common superclass org.jfree.chart.axis.ValueAxis does not declare member(s) public void setDateFormatOverride(java.text.DateFormat) , public void setNumberFormatOverride(java.text.NumberFormat) |
20 | Expression a2.setDateFormatOverride(new SimpleDateFormat("yyyy")) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
21 | Expression a2.setNumberFormatOverride(new DecimalFormat("0.00")) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
22 | Expression a2.setDateFormatOverride(new SimpleDateFormat("yyyy")) is a void method call, and thus it cannot be parameterized |
23 | Expression a2.setNumberFormatOverride(new DecimalFormat("0.00")) is a void method call, and thus it cannot be parameterized |
24 | Expression a2 cannot be unified with expression a2 , because common superclass org.jfree.chart.axis.ValueAxis does not declare member(s) public void setDateFormatOverride(java.text.DateFormat) , public void setNumberFormatOverride(java.text.NumberFormat) |
25 | Unmatched statement a1.setTickMarkPosition(DateTickMarkPosition.END); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
26 | Unmatched statement a2.setTickMarkPosition(DateTickMarkPosition.END); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
27 | Unmatched statement a1.setTimeline(SegmentedTimeline.newMondayThroughFridayTimeline()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
28 | Unmatched statement a2.setTimeline(SegmentedTimeline.newMondayThroughFridayTimeline()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
29 | Unmatched statement a1.setRangeType(RangeType.POSITIVE); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
30 | Unmatched statement a2.setRangeType(RangeType.POSITIVE); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
31 | Unmatched statement assertTrue(a1.equals(a2)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
32 | Clone fragment #1 returns variables a1, a2 , while Clone fragment #2 returns variables a1, a2 |