mirror of
https://github.com/apache/poi.git
synced 2026-02-27 20:40:08 +08:00
remove deprecated method getSeries (#864)
* remove deprecated method getSeries * Update TestXDDFChartRemoveSeries.java
This commit is contained in:
parent
ebad7593ff
commit
f1e6b9d11c
@ -28,7 +28,6 @@ import org.apache.poi.logging.PoiLogManager;
|
||||
import org.apache.poi.ss.util.CellReference;
|
||||
import org.apache.poi.util.Beta;
|
||||
import org.apache.poi.util.Internal;
|
||||
import org.apache.poi.util.Removal;
|
||||
import org.apache.poi.xddf.usermodel.XDDFFillProperties;
|
||||
import org.apache.poi.xddf.usermodel.XDDFLineProperties;
|
||||
import org.apache.poi.xddf.usermodel.XDDFShapeProperties;
|
||||
@ -85,27 +84,6 @@ public abstract class XDDFChartData {
|
||||
return valueAxes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls to {@code getSeries().add(series)} or to {@code getSeries().remove(series)}
|
||||
* may corrupt the workbook.
|
||||
*
|
||||
* <p>
|
||||
* Instead, use the following methods:
|
||||
* <ul>
|
||||
* <li>{@link #getSeriesCount()}</li>
|
||||
* <li>{@link #getSeries(int)}</li>
|
||||
* <li>{@link #addSeries(XDDFDataSource,XDDFNumericalDataSource)}</li>
|
||||
* <li>{@link #removeSeries(int)}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @deprecated since POI 4.1.1
|
||||
*/
|
||||
@Deprecated
|
||||
@Removal(version = "5.3")
|
||||
public List<Series> getSeries() {
|
||||
return Collections.unmodifiableList(series);
|
||||
}
|
||||
|
||||
public final int getSeriesCount() {
|
||||
return series.size();
|
||||
}
|
||||
|
||||
@ -112,21 +112,7 @@ class TestXDDFChartRemoveSeries {
|
||||
}
|
||||
workbook.close();
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempt to remove the first series by calling chartData.getSeries().remove(0).
|
||||
* <p>
|
||||
* This used to corrupt the workbook but the returned <code>List</code> is unmodifiable.
|
||||
*/
|
||||
@Test
|
||||
void testRemoveSeries0() {
|
||||
procName = "testRemoveSeries0";
|
||||
fileName = procName + ".xlsx";
|
||||
|
||||
assertThrows(UnsupportedOperationException.class, () -> chartData.getSeries().remove(0));
|
||||
assertEquals(2, chartData.getSeriesCount());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Remove the first series by calling chartData.removeSeries(0).
|
||||
* <p>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user