Skip to content

Commit

Permalink
Fix SonarLint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jfree committed Jun 23, 2024
1 parent 098202c commit 704d659
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/test/java/org/jfree/chart/JFreeChartTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@
/**
* Tests for the {@link JFreeChart} class.
*/
public class JFreeChartTest implements ChartChangeListener {
class JFreeChartTest implements ChartChangeListener {

/**
* Use EqualsVerifier to test that the contract between equals and hashCode
* is properly implemented.
*/
@Test
public void testEqualsHashCode() {
void testEqualsHashCode() {
EqualsVerifier.forClass(JFreeChart.class)
.withPrefabValues(TextTitle.class,
new TextTitle("tee"),
Expand Down Expand Up @@ -113,7 +113,7 @@ public void setUp() {
* Check that the equals() method can distinguish all fields.
*/
@Test
public void testEquals() {
void testEquals() {
JFreeChart chart1 = new JFreeChart("Title",
new Font("SansSerif", Font.PLAIN, 12), new PiePlot(), true);
JFreeChart chart2 = new JFreeChart("Title",
Expand Down Expand Up @@ -210,7 +210,7 @@ public void testEquals() {
* equals() testing.
*/
@Test
public void testEquals2() {
void testEquals2() {
JFreeChart chart1 = new JFreeChart("Title",
new Font("SansSerif", Font.PLAIN, 12), new PiePlot(), true);
JFreeChart chart2 = new JFreeChart("Title",
Expand All @@ -223,7 +223,7 @@ public void testEquals2() {
* Checks the subtitle count - should be 1 (the legend).
*/
@Test
public void testSubtitleCount() {
void testSubtitleCount() {
int count = this.pieChart.getSubtitleCount();
assertEquals(1, count);
}
Expand All @@ -232,7 +232,7 @@ public void testSubtitleCount() {
* Some checks for the getSubtitle() method.
*/
@Test
public void testGetSubtitle() {
void testGetSubtitle() {
DefaultPieDataset<String> dataset = new DefaultPieDataset<>();
JFreeChart chart = ChartFactory.createPieChart("title", dataset);
Title t = chart.getSubtitle(0);
Expand Down Expand Up @@ -268,7 +268,7 @@ public void testGetSubtitle() {
* Serialize a pie chart, restore it, and check for equality.
*/
@Test
public void testSerialization1() {
void testSerialization1() {
DefaultPieDataset<String> data = new DefaultPieDataset<>();
data.setValue("Type 1", 54.5);
data.setValue("Type 2", 23.9);
Expand All @@ -285,12 +285,12 @@ public void testSerialization1() {
* Serialize a 3D pie chart, restore it, and check for equality.
*/
@Test
public void testSerialization2() {
void testSerialization2() {
DefaultPieDataset<String> data = new DefaultPieDataset<>();
data.setValue("Type 1", 54.5);
data.setValue("Type 2", 23.9);
data.setValue("Type 3", 45.8);
JFreeChart c1 = ChartFactory.createPieChart3D("Test", data);
JFreeChart c1 = ChartFactory.createPieChart("Test", data);
JFreeChart c2 = TestUtils.serialised(c1);
assertEquals(c1, c2);
}
Expand All @@ -299,7 +299,7 @@ public void testSerialization2() {
* Serialize a bar chart, restore it, and check for equality.
*/
@Test
public void testSerialization3() {
void testSerialization3() {

// row keys...
String series1 = "First";
Expand Down Expand Up @@ -357,7 +357,7 @@ public void testSerialization3() {
* Serialize a time seroes chart, restore it, and check for equality.
*/
@Test
public void testSerialization4() {
void testSerialization4() {

RegularTimePeriod t = new Day();
TimeSeries series = new TimeSeries("Series 1");
Expand All @@ -377,7 +377,7 @@ public void testSerialization4() {
* Some checks for the addSubtitle() methods.
*/
@Test
public void testAddSubtitle() {
void testAddSubtitle() {
DefaultPieDataset<String> dataset = new DefaultPieDataset<>();
JFreeChart chart = ChartFactory.createPieChart("title", dataset);

Expand Down Expand Up @@ -419,7 +419,7 @@ public void testAddSubtitle() {
* Some checks for the getSubtitles() method.
*/
@Test
public void testGetSubtitles() {
void testGetSubtitles() {
DefaultPieDataset<String> dataset = new DefaultPieDataset<>();
JFreeChart chart = ChartFactory.createPieChart("title", dataset);
List<TextTitle> subtitles = chart.getSubtitles();
Expand All @@ -435,7 +435,7 @@ public void testGetSubtitles() {
* Some checks for the default legend firing change events.
*/
@Test
public void testLegendEvents() {
void testLegendEvents() {
DefaultPieDataset<String> dataset = new DefaultPieDataset<>();
JFreeChart chart = ChartFactory.createPieChart("title", dataset);
chart.addChangeListener(this);
Expand All @@ -449,7 +449,7 @@ public void testLegendEvents() {
* Some checks for title changes and event notification.
*/
@Test
public void testTitleChangeEvent() {
void testTitleChangeEvent() {
DefaultPieDataset dataset = new DefaultPieDataset();
JFreeChart chart = ChartFactory.createPieChart("title", dataset);
chart.addChangeListener(this);
Expand Down Expand Up @@ -480,7 +480,7 @@ public void testTitleChangeEvent() {
}

@Test
public void testBug942() throws Exception {
void testBug942() {
final String title = "Pie Chart Demo 1\n\n\ntestnew line";
assertEquals(title, ChartFactory.createPieChart(title,
new DefaultPieDataset<String>()).getTitle().getText());
Expand Down

0 comments on commit 704d659

Please sign in to comment.