5050/**
5151 * Tests for the {@link CompassPlot} class.
5252 */
53- public class CompassPlotTest {
53+ class CompassPlotTest {
5454
5555 /**
5656 * Test the equals() method.
5757 */
5858 @ Test
59- public void testEquals () {
59+ void testEquals () {
6060 CompassPlot plot1 = new CompassPlot ();
6161 CompassPlot plot2 = new CompassPlot ();
6262 assertEquals (plot1 , plot2 );
@@ -108,7 +108,7 @@ public void testEquals() {
108108 * Serialize an instance, restore it, and check for equality.
109109 */
110110 @ Test
111- public void testSerialization () {
111+ void testSerialization () {
112112 CompassPlot p1 = new CompassPlot (null );
113113 p1 .setRosePaint (new GradientPaint (1.0f , 2.0f , Color .RED , 3.0f , 4.0f ,
114114 Color .BLUE ));
@@ -125,12 +125,21 @@ public void testSerialization() {
125125 * @throws java.lang.CloneNotSupportedException
126126 */
127127 @ Test
128- public void testCloning () throws CloneNotSupportedException {
128+ void testCloning () throws CloneNotSupportedException {
129129 CompassPlot p1 = new CompassPlot (new DefaultValueDataset (15.0 ));
130130 CompassPlot p2 = CloneUtils .clone (p1 );
131131 assertNotSame (p1 , p2 );
132132 assertSame (p1 .getClass (), p2 .getClass ());
133133 assertEquals (p1 , p2 );
134134 }
135135
136+ /**
137+ * Test faulty array bounds; CVE-2024-23077.
138+ */
139+ @ Test
140+ void testArrayBounds () {
141+ CompassPlot p = new CompassPlot (new DefaultValueDataset (0 ));
142+ p .setSeriesNeedle (-1 , new PointerNeedle ());
143+ }
144+
136145}
0 commit comments