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 testGetSetLabelPaint()
|
|||
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(Color.black, m.getLabelPaint());↵ | |
5 | m.setPaint(Color.blue);↵ | 5 | m.setLabelPaint(Color.red);↵ | |
6 | assertEquals(Color.blue, m.getPaint());↵ | 6 | assertEquals(Color.red, m.getLabelPaint());↵ | |
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 | try {↵ | |
11 | m.setPaint(null);↵ | 11 | m.setLabelPaint(null);↵ | |
12 | fail("Expected an IllegalArgumentException for null.");↵ | 12 | fail("Expected an IllegalArgumentException for null.");↵ | |
13 | }↵ | 13 | }↵ | |
14 | catch (IllegalArgumentException e) {↵ | 14 | catch (IllegalArgumentException e) {↵ | |
15 | assertTrue(true);↵ | 15 | assertTrue(true);↵ | |
16 | } | 16 |
| |
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 declared in the same class |
Number of node comparisons | 31 |
Number of mapped statements | 10 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 10.9 |
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(Color.gray, m.getPaint()); |
| 4 | assertEquals(Color.black, m.getLabelPaint()); | |||||||||||||||||
5 | m.setPaint(Color.blue); |
| 5 | m.setLabelPaint(Color.red); | |||||||||||||||||
6 | assertEquals(Color.blue, m.getPaint()); |
| 6 | assertEquals(Color.red, m.getLabelPaint()); | |||||||||||||||||
7 | assertEquals(m, this.lastEvent.getMarker()); | 7 | assertEquals(m, this.lastEvent.getMarker()); | ||||||||||||||||||
8 | try | 8 | try | ||||||||||||||||||
9 | m.setPaint(null); |
| 9 | m.setLabelPaint(null); | |||||||||||||||||
10 | fail("Expected an IllegalArgumentException for null."); | 10 | fail("Expected an IllegalArgumentException for null."); |
Row | Violation |
---|---|
1 | Expression m.getPaint() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression m.getLabelPaint() 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.setLabelPaint(Color.red) 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.setLabelPaint(Color.red) 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.getLabelPaint() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Expression m.setPaint(null) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
10 | Expression m.setLabelPaint(null) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Expression m.setPaint(null) is a void method call, and thus it cannot be parameterized |
12 | Expression m.setLabelPaint(null) is a void method call, and thus it cannot be parameterized |