File path: /jfreechart-1.0.10/tests/org/jfree/chart/plot/junit/MarkerTests.java | File path: /jfreechart-1.0.10/tests/org/jfree/chart/plot/junit/MarkerTests.java | |||
Method name: void testGetSetPaint()
|
Method name: void testGetSetLabelTextAnchor()
|
|||
Number of AST nodes: 10 | Number of AST nodes: 10 | |||
1 | ValueMarker m = new ValueMarker(1.1);↵ | 1 | ValueMarker m = new ValueMarker(1.1);↵ | |
2 | m.addChangeListener(this);↵ | 2 | m.addChangeListener(this);↵ | |
3 | this.lastEvent = null;↵ | 3 | this.lastEvent = null;↵ | |
4 | assertEquals(Color.gray, m.getPaint());↵ | 4 | assertEquals(↵ | |
5 | m.setPaint(Color.blue);↵ | |||
6 | assertEquals(Color.blue, m.getPaint↵ | 5 | TextAnchor.CENTER, m.getLabelTextAnchor());↵ | |
6 | m.setLabelTextAnchor(TextAnchor.BASELINE_LEFT);↵ | |||
7 | ());↵ | 7 | assertEquals(TextAnchor.BASELINE_LEFT, m.getLabelTextAnchor());↵ | |
8 | assertEquals(m, this.lastEvent.getMarker());↵ | 8 | assertEquals(m, this.lastEvent.getMarker());↵ | |
9 | ↵ | 9 | ↵ | |
10 | // check null argument...↵ | 10 | // check null argument...↵ | |
11 | try {↵ | 11 | try {↵ | |
12 | m.setPaint(null);↵ | 12 | m.setLabelTextAnchor(null);↵ | |
13 | fail("Expected an IllegalArgumentException for null.");↵ | 13 | fail("Expected an IllegalArgumentException for null.");↵ | |
14 | }↵ | 14 | }↵ | |
15 | catch (IllegalArgumentException e) {↵ | 15 | catch (IllegalArgumentException e) {↵ | |
16 | assertTrue(true);↵ | 16 | assertTrue(true);↵ | |
17 | } | 17 |
| |
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.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 37 |
Number of mapped statements | 7 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 10.7 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | ValueMarker m = new ValueMarker(1.1); | 1 | ValueMarker m = new ValueMarker(1.1); | |||||||||||||||
2 | m.addChangeListener(this); | 2 | m.addChangeListener(this); | |||||||||||||||
3 | this.lastEvent = null; | 3 | this.lastEvent = null; | |||||||||||||||
|
| 4 | assertEquals(TextAnchor.CENTER, m.getLabelTextAnchor()); | |||||||||||||||
4 | assertEquals(Color.gray, m.getPaint()); |
| | |||||||||||||||
|
| 5 | m.setLabelTextAnchor(TextAnchor.BASELINE_LEFT); | |||||||||||||||
5 | m.setPaint(Color.blue); |
| | |||||||||||||||
|
| 6 | assertEquals(TextAnchor.BASELINE_LEFT, m.getLabelTextAnchor()); | |||||||||||||||
6 | assertEquals(Color.blue, m.getPaint()); |
| | |||||||||||||||
7 | assertEquals(m, this.lastEvent.getMarker()); | 7 | assertEquals(m, this.lastEvent.getMarker()); | |||||||||||||||
8 | try | 8 | try | |||||||||||||||
9 | m.setPaint(null); |
| 9 | m.setLabelTextAnchor(null); | ||||||||||||||
10 | fail("Expected an IllegalArgumentException for null."); | 10 | fail("Expected an IllegalArgumentException for null."); |
Row | Violation |
---|---|
1 | Unmatched statement assertEquals(TextAnchor.CENTER,m.getLabelTextAnchor()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement assertEquals(Color.gray,m.getPaint()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement m.setLabelTextAnchor(TextAnchor.BASELINE_LEFT); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement m.setPaint(Color.blue); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Unmatched statement assertEquals(TextAnchor.BASELINE_LEFT,m.getLabelTextAnchor()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
6 | Unmatched statement assertEquals(Color.blue,m.getPaint()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
7 | Expression m.setPaint(null) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression m.setLabelTextAnchor(null) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Expression m.setPaint(null) is a void method call, and thus it cannot be parameterized |
10 | Expression m.setLabelTextAnchor(null) is a void method call, and thus it cannot be parameterized |