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 testGetSetOutlinePaint()
|
Method name: void testGetSetLabelTextAnchor()
|
|||
Number of AST nodes: 9 | 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.getOutlinePaint());↵ | 4 | assertEquals(↵ | |
5 | m.setOutlinePaint(Color.yellow);↵ | |||
6 | assertEquals(Color.yellow, m.getOutlinePaint↵ | 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 | m.setOutlinePaint(null);↵ | 11 | ↵ | |
12 | assertEquals(null, m.getOutlinePaint()); | 12 | try {↵ | |
13 | m.setLabelTextAnchor(null);↵ | |||
14 | fail("Expected an IllegalArgumentException for null.");↵ | |||
15 | }↵ | |||
16 | catch (IllegalArgumentException e) {↵ | |||
17 | assertTrue(true);↵ | |||
18 |
| |||
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 declared in the same class |
Number of node comparisons | 32 |
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 4 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 3 |
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.getOutlinePaint()); |
| | ||||||||||||||||||
5 | m.setOutlinePaint(Color.yellow); |
| | ||||||||||||||||||
|
| 6 | assertEquals(TextAnchor.BASELINE_LEFT, m.getLabelTextAnchor()); | ||||||||||||||||||
6 | assertEquals(Color.yellow, m.getOutlinePaint()); |
| | ||||||||||||||||||
7 | assertEquals(m, this.lastEvent.getMarker()); | 7 | assertEquals(m, this.lastEvent.getMarker()); | ||||||||||||||||||
8 | m.setOutlinePaint(null); |
| 5 | m.setLabelTextAnchor(TextAnchor.BASELINE_LEFT); | |||||||||||||||||
9 | assertEquals(null, m.getOutlinePaint()); |
| |
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.getOutlinePaint()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement m.setOutlinePaint(Color.yellow); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | 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 |
5 | Unmatched statement assertEquals(Color.yellow,m.getOutlinePaint()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
6 | Expression m.setOutlinePaint(null) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression m.setLabelTextAnchor(TextAnchor.BASELINE_LEFT) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression m.setOutlinePaint(null) is a void method call, and thus it cannot be parameterized |
9 | Expression m.setLabelTextAnchor(TextAnchor.BASELINE_LEFT) is a void method call, and thus it cannot be parameterized |
10 | Unmatched statement assertEquals(null,m.getOutlinePaint()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
11 | Clone fragment #1 returns variables , while Clone fragment #2 returns variables m |