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 testGetSetOutlinePaint()
|
|||
Number of AST nodes: 10 | Number of AST nodes: 9 | |||
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(Color.gray, m.getOutlinePaint());↵ | |
5 | m.setPaint(Color.blue);↵ | 5 | m.setOutlinePaint(Color.yellow);↵ | |
6 | assertEquals(Color.blue, m.getPaint());↵ | 6 | assertEquals(Color.yellow, m.getOutlinePaint());↵ | |
7 | assertEquals(m, this.lastEvent.getMarker());↵ | 7 | assertEquals(m, this.lastEvent.getMarker());↵ | |
8 | ↵ | 8 | ↵ | |
9 | // check null argument...↵ | 9 | // check null argument...↵ | |
10 | try {↵ | 10 | ↵ | |
11 | m.setPaint(null);↵ | |||
12 | fail("Expected an IllegalArgumentException for null.");↵ | |||
13 | }↵ | |||
14 | catch (IllegalArgumentException e) {↵ | |||
15 | assertTrue(true);↵ | |||
16 | } | 11 | m.setOutlinePaint(null);↵ | |
12 |
| |||
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 | 31 |
Number of mapped statements | 7 |
Number of unmapped statements in the first code fragment | 0 |
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(Color.gray, m.getPaint()); |
| 4 | assertEquals(Color.gray, m.getOutlinePaint()); | |||||||||||||||||
5 | m.setPaint(Color.blue); |
| 5 | m.setOutlinePaint(Color.yellow); | |||||||||||||||||
6 | assertEquals(Color.blue, m.getPaint()); |
| 6 | assertEquals(Color.yellow, m.getOutlinePaint()); | |||||||||||||||||
7 | assertEquals(m, this.lastEvent.getMarker()); | 7 | assertEquals(m, this.lastEvent.getMarker()); | ||||||||||||||||||
|
| 8 | m.setOutlinePaint(null); | ||||||||||||||||||
|
| 9 | assertEquals(null, m.getOutlinePaint()); |
Row | Violation |
---|---|
1 | Expression m.getPaint() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression m.getOutlinePaint() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression m.setPaint(Color.blue) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression m.setOutlinePaint(Color.yellow) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression m.setPaint(Color.blue) is a void method call, and thus it cannot be parameterized |
6 | Expression m.setOutlinePaint(Color.yellow) is a void method call, and thus it cannot be parameterized |
7 | Expression m.getPaint() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression m.getOutlinePaint() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Unmatched statement m.setOutlinePaint(null); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
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 m , while Clone fragment #2 returns variables |