remove unnecessary @SuppressWarnings("deprecation") warnings (because of old xml schemas)

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1722480 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Andreas Beeker 2016-01-01 00:45:05 +00:00
parent e7d60982c7
commit 8ed770dfe3
48 changed files with 8 additions and 98 deletions

View File

@ -469,8 +469,7 @@ public class POIXMLProperties {
*
* @return next property id starting with 2
*/
@SuppressWarnings("deprecation")
protected int nextPid(){
protected int nextPid() {
int propid = 1;
for(CTProperty p : props.getProperties().getPropertyArray()){
if(p.getPid() > propid) propid = p.getPid();
@ -484,7 +483,6 @@ public class POIXMLProperties {
* @param name the name to check
* @return whether a property with the given name exists in the custom properties
*/
@SuppressWarnings("deprecation")
public boolean contains(String name) {
for(CTProperty p : props.getProperties().getPropertyArray()){
if(p.getName().equals(name)) return true;
@ -501,7 +499,6 @@ public class POIXMLProperties {
*
* @param name the name of the property to fetch
*/
@SuppressWarnings("deprecation")
public CTProperty getProperty(String name) {
for(CTProperty p : props.getProperties().getPropertyArray()){
if(p.getName().equals(name)) {

View File

@ -119,7 +119,6 @@ public class XSLFPowerPointExtractor extends POIXMLTextExtractor {
* @param notesText Should we retrieve text from notes?
* @param masterText Should we retrieve text from master slides?
*/
@SuppressWarnings("deprecation")
public String getText(boolean slideText, boolean notesText, boolean masterText) {
StringBuffer text = new StringBuffer();

View File

@ -27,7 +27,6 @@ public class DrawingTable {
this.table = table;
}
@SuppressWarnings("deprecation")
public DrawingTableRow[] getRows() {
CTTableRow[] ctTableRows = table.getTrArray();
DrawingTableRow[] o = new DrawingTableRow[ctTableRows.length];

View File

@ -27,7 +27,6 @@ public class DrawingTableRow {
this.row = row;
}
@SuppressWarnings("deprecation")
public DrawingTableCell[] getCells() {
CTTableCell[] ctTableCells = row.getTcArray();
DrawingTableCell[] o = new DrawingTableCell[ctTableCells.length];

View File

@ -27,7 +27,6 @@ public class DrawingTextBody {
this.textBody = textBody;
}
@SuppressWarnings("deprecation")
public DrawingParagraph[] getParagraphs() {
CTTextParagraph[] paragraphs = textBody.getPArray();
DrawingParagraph[] o = new DrawingParagraph[paragraphs.length];

View File

@ -206,7 +206,6 @@ implements SlideShow<XSLFShape,XSLFTextParagraph> {
* @param layout
* @return created slide
*/
@SuppressWarnings("deprecation")
public XSLFSlide createSlide(XSLFSlideLayout layout) {
int slideNumber = 256, cnt = 1;
CTSlideIdList slideList;
@ -369,7 +368,6 @@ implements SlideShow<XSLFShape,XSLFTextParagraph> {
*
* @param newIndex 0-based index of the slide
*/
@SuppressWarnings("deprecation")
public void setSlideOrder(XSLFSlide slide, int newIndex){
int oldIndex = _slides.indexOf(slide);
if(oldIndex == -1) throw new IllegalArgumentException("Slide not found");

View File

@ -63,7 +63,6 @@ public class XSLFCommentAuthors extends POIXMLDocumentPart {
return _authors;
}
@SuppressWarnings("deprecation")
public CTCommentAuthor getAuthorById(long id) {
// TODO Have a map
for (CTCommentAuthor author : _authors.getCmAuthorArray()) {

View File

@ -46,7 +46,6 @@ public class XSLFCommonSlideData {
this.data = data;
}
@SuppressWarnings("deprecation")
public List<DrawingTextBody> getDrawingText() {
CTGroupShape gs = data.getSpTree();
@ -100,7 +99,6 @@ public class XSLFCommonSlideData {
return paragraphs;
}
@SuppressWarnings("deprecation")
private void processShape(CTGroupShape gs, List<DrawingTextBody> out) {
for (CTShape shape : gs.getSpArray()) {
CTTextBody ctTextBody = shape.getTxBody();

View File

@ -119,7 +119,6 @@ public class XSLFFreeformShape extends XSLFAutoShape
}
@Override
@SuppressWarnings("deprecation")
public GeneralPath getPath() {
GeneralPath path = new GeneralPath();
Rectangle2D bounds = getAnchor();

View File

@ -66,7 +66,6 @@ public class XSLFSlideShow extends POIXMLDocument {
*/
private List<PackagePart> embedds;
@SuppressWarnings("deprecation")
public XSLFSlideShow(OPCPackage container) throws OpenXML4JException, IOException, XmlException {
super(container);

View File

@ -38,7 +38,6 @@ public class XSLFTableRow implements Iterable<XSLFTableCell> {
private List<XSLFTableCell> _cells;
private XSLFTable _table;
@SuppressWarnings("deprecation")
/*package*/ XSLFTableRow(CTTableRow row, XSLFTable table){
_row = row;
_table = table;

View File

@ -41,7 +41,6 @@ public class XSLFTableStyles extends POIXMLDocumentPart implements Iterable<XSLF
super();
}
@SuppressWarnings("deprecation")
public XSLFTableStyles(PackagePart part, PackageRelationship rel) throws IOException, XmlException {
super(part, rel);

View File

@ -819,7 +819,6 @@ public class XSLFTextParagraph implements TextParagraph<XSLFShape,XSLFTextParagr
return false;
}
@SuppressWarnings("deprecation")
void copy(XSLFTextParagraph other){
if (other == this) return;

View File

@ -160,7 +160,6 @@ public class XSSFSheetXMLHandler extends DefaultHandler {
this(styles, strings, sheetContentsHandler, new DataFormatter(), formulasNotResults);
}
@SuppressWarnings("deprecation")
private void init() {
if (commentsTable != null) {
commentCellRefs = new LinkedList<CellAddress>();

View File

@ -82,7 +82,6 @@ public class CalculationChain extends POIXMLDocumentPart {
* @param sheetId the sheet Id of a sheet the formula belongs to.
* @param ref A1 style reference to the cell containing the formula.
*/
@SuppressWarnings("deprecation") // getXYZArray() array accessors are deprecated
public void removeItem(int sheetId, String ref){
//sheet Id of a sheet the cell belongs to
int id = -1;

View File

@ -122,7 +122,6 @@ public class CommentsTable extends POIXMLDocumentPart {
}
public int findAuthor(String author) {
@SuppressWarnings("deprecation")
String[] authorArray = comments.getAuthors().getAuthorArray();
for (int i = 0 ; i < authorArray.length; i++) {
if (authorArray[i].equals(author)) {
@ -203,7 +202,6 @@ public class CommentsTable extends POIXMLDocumentPart {
* Calls that use the commentRefs cache will perform in O(1)
* time rather than O(n) lookup time for List<CTComment> comments.
*/
@SuppressWarnings("deprecation") //YK: getXYZArray) array accessors are deprecated in xmlbeans with JDK 1.5 support
private void prepareCTCommentCache() {
// Create the cache if needed
if(commentRefs == null) {
@ -265,7 +263,6 @@ public class CommentsTable extends POIXMLDocumentPart {
final String stringRef = cellRef.formatAsString();
CTCommentList lst = comments.getCommentList();
if(lst != null) {
@SuppressWarnings("deprecation") //YK: getXYZArray() array accessors are deprecated in xmlbeans with JDK 1.5 support
CTComment[] commentArray = lst.getCommentArray();
for (int i = 0; i < commentArray.length; i++) {
CTComment comment = commentArray[i];

View File

@ -116,7 +116,6 @@ public class ExternalLinksTable extends POIXMLDocumentPart {
link.getExternalBook().setId(newRel.getId());
}
@SuppressWarnings("deprecation")
public List<String> getSheetNames() {
CTExternalSheetName[] sheetNames =
link.getExternalBook().getSheetNames().getSheetNameArray();
@ -127,7 +126,6 @@ public class ExternalLinksTable extends POIXMLDocumentPart {
return names;
}
@SuppressWarnings("deprecation")
public List<Name> getDefinedNames() {
CTExternalDefinedName[] extNames =
link.getExternalBook().getDefinedNames().getDefinedNameArray();

View File

@ -67,7 +67,6 @@ public class MapInfo extends POIXMLDocumentPart {
readFrom(part.getInputStream());
}
@SuppressWarnings("deprecation")
public void readFrom(InputStream is) throws IOException {
try {
MapInfoDocument doc = MapInfoDocument.Factory.parse(is, DEFAULT_XML_OPTIONS);
@ -106,7 +105,6 @@ public class MapInfo extends POIXMLDocumentPart {
* @param schemaId the schema ID
* @return CTSchema by it's ID
*/
@SuppressWarnings("deprecation")
public CTSchema getCTSchemaById(String schemaId){
CTSchema xmlSchema = null;

View File

@ -114,7 +114,6 @@ public class SharedStringsTable extends POIXMLDocumentPart {
* @param is The input stream containing the XML document.
* @throws IOException if an error occurs while reading.
*/
@SuppressWarnings("deprecation") //YK: getXYZArray() array accessors are deprecated in xmlbeans with JDK 1.5 support
public void readFrom(InputStream is) throws IOException {
try {
int cnt = 0;

View File

@ -96,7 +96,6 @@ public class SingleXmlCells extends POIXMLDocumentPart {
*
* @return all the SimpleXmlCell contained in this SingleXmlCells element
*/
@SuppressWarnings("deprecation")
public List<XSSFSingleXmlCell> getAllSimpleXmlCell(){
List<XSSFSingleXmlCell> list = new Vector<XSSFSingleXmlCell>();

View File

@ -187,7 +187,6 @@ public class StylesTable extends POIXMLDocumentPart {
* @param is The input stream containing the XML document.
* @throws IOException if an error occurs while reading.
*/
@SuppressWarnings("deprecation") //YK: getXYZArray() array accessors are deprecated in xmlbeans with JDK 1.5 support
protected void readFrom(InputStream is) throws IOException {
try {
doc = StyleSheetDocument.Factory.parse(is, DEFAULT_XML_OPTIONS);

View File

@ -299,14 +299,12 @@ public final class XSSFChart extends POIXMLDocumentPart implements Chart, ChartA
parseValueAxis();
}
@SuppressWarnings("deprecation")
private void parseCategoryAxis() {
for (CTCatAx catAx : chart.getPlotArea().getCatAxArray()) {
axis.add(new XSSFCategoryAxis(this, catAx));
}
}
@SuppressWarnings("deprecation")
private void parseValueAxis() {
for (CTValAx valAx : chart.getPlotArea().getValAxArray()) {
axis.add(new XSSFValueAxis(this, valAx));

View File

@ -50,7 +50,6 @@ public class XSSFColorScaleFormatting implements ColorScaleFormatting {
}
}
@SuppressWarnings("deprecation")
public XSSFColor[] getColors() {
CTColor[] ctcols = _scale.getColorArray();
XSSFColor[] c = new XSSFColor[ctcols.length];
@ -67,7 +66,6 @@ public class XSSFColorScaleFormatting implements ColorScaleFormatting {
_scale.setColorArray(ctcols);
}
@SuppressWarnings("deprecation")
public XSSFConditionalFormattingThreshold[] getThresholds() {
CTCfvo[] cfvos = _scale.getCfvoArray();
XSSFConditionalFormattingThreshold[] t =

View File

@ -62,7 +62,6 @@ public class XSSFIconMultiStateFormatting implements IconMultiStateFormatting {
_iconset.setReverse(reversed);
}
@SuppressWarnings("deprecation")
public XSSFConditionalFormattingThreshold[] getThresholds() {
CTCfvo[] cfvos = _iconset.getCfvoArray();
XSSFConditionalFormattingThreshold[] t =

View File

@ -265,7 +265,6 @@ public class XSSFPivotTable extends POIXMLDocumentPart {
}
@Beta
@SuppressWarnings("deprecation")
public List<Integer> getRowLabelColumns() {
if (pivotTableDefinition.getRowFields() != null) {
List<Integer> columnIndexes = new ArrayList<Integer>();

View File

@ -253,7 +253,6 @@ public class XSSFRichTextString implements RichTextString {
* it just text in the default style?
*/
public boolean hasFormatting() {
@SuppressWarnings("deprecation")
CTRElt[] rs = st.getRArray();
if (rs == null || rs.length == 0) {
return false;
@ -310,7 +309,6 @@ public class XSSFRichTextString implements RichTextString {
/**
* Returns the plain string representation.
*/
@SuppressWarnings("deprecation") //YK: getXYZArray() array accessors are deprecated in xmlbeans with JDK 1.5 support
public String getString() {
if(st.sizeOfRArray() == 0) {
return utfDecode(st.getT());
@ -409,7 +407,6 @@ public class XSSFRichTextString implements RichTextString {
return st;
}
@SuppressWarnings("deprecation") //YK: getXYZArray() array accessors are deprecated in xmlbeans with JDK 1.5 support
protected void setStylesTableReference(StylesTable tbl){
styles = tbl;
if(st.sizeOfRArray() > 0) {
@ -558,7 +555,6 @@ public class XSSFRichTextString implements RichTextString {
while(sub.size() > 1) sub.remove(sub.lastKey());
}
@SuppressWarnings("deprecation")
TreeMap<Integer, CTRPrElt> getFormatMap(CTRst entry){
int length = 0;
TreeMap<Integer, CTRPrElt> formats = new TreeMap<Integer, CTRPrElt>();
@ -577,11 +573,11 @@ public class XSSFRichTextString implements RichTextString {
throw new IllegalArgumentException("Text length was " + text.length() +
" but the last format index was " + formats.lastKey());
}
CTRst st = CTRst.Factory.newInstance();
CTRst stf = CTRst.Factory.newInstance();
int runStartIdx = 0;
for (Iterator<Integer> it = formats.keySet().iterator(); it.hasNext();) {
int runEndIdx = it.next();
CTRElt run = st.addNewR();
CTRElt run = stf.addNewR();
String fragment = text.substring(runStartIdx, runEndIdx);
run.setT(fragment);
preserveSpaces(run.xgetT());
@ -589,7 +585,7 @@ public class XSSFRichTextString implements RichTextString {
if(fmt != null) run.setRPr(fmt);
runStartIdx = runEndIdx;
}
return st;
return stf;
}
private ThemesTable getThemesTable() {

View File

@ -66,7 +66,6 @@ public class XSSFRow implements Row, Comparable<XSSFRow> {
* @param row the xml bean containing all cell definitions for this row.
* @param sheet the parent sheet.
*/
@SuppressWarnings("deprecation") //YK: getXYZArray() array accessors are deprecated in xmlbeans with JDK 1.5 support
protected XSSFRow(CTRow row, XSSFSheet sheet) {
_row = row;
_sheet = sheet;
@ -474,7 +473,6 @@ public class XSSFRow implements Row, Comparable<XSSFRow> {
*
* @see org.apache.poi.xssf.usermodel.XSSFSheet#write(java.io.OutputStream) ()
*/
@SuppressWarnings("deprecation")
protected void onDocumentWrite(){
// check if cells in the CTRow are ordered
boolean isOrdered = true;

View File

@ -231,7 +231,6 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet {
hyperlinks = new ArrayList<XSSFHyperlink>();
}
@SuppressWarnings("deprecation") //YK: getXYZArray() array accessors are deprecated in xmlbeans with JDK 1.5 support
private void initRows(CTWorksheet worksheetParam) {
_rows = new TreeMap<Integer, XSSFRow>();
tables = new TreeMap<String, XSSFTable>();
@ -247,7 +246,6 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet {
* Read hyperlink relations, link them with CTHyperlink beans in this worksheet
* and initialize the internal array of XSSFHyperlink objects
*/
@SuppressWarnings("deprecation") //YK: getXYZArray() array accessors are deprecated in xmlbeans with JDK 1.5 support
private void initHyperlinks() {
hyperlinks = new ArrayList<XSSFHyperlink>();
@ -744,7 +742,6 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet {
return Collections.unmodifiableList(hyperlinks);
}
@SuppressWarnings("deprecation")
private int[] getBreaks(CTPageBreak ctPageBreak) {
CTBreak[] brkArray = ctPageBreak.getBrkArray();
int[] breaks = new int[brkArray.length];
@ -754,7 +751,6 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet {
return breaks;
}
@SuppressWarnings("deprecation")
private void removeBreak(int index, CTPageBreak ctPageBreak) {
int index1 = index + 1;
CTBreak[] brkArray = ctPageBreak.getBrkArray();
@ -1173,7 +1169,6 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet {
*
* @return the list of merged regions
*/
@SuppressWarnings("deprecation")
@Override
public List<CellRangeAddress> getMergedRegions() {
List<CellRangeAddress> addresses = new ArrayList<CellRangeAddress>();
@ -1512,7 +1507,6 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet {
/**
* Do not leave the width attribute undefined (see #52186).
*/
@SuppressWarnings("deprecation")
private void setColWidthAttribute(CTCols ctCols) {
for (CTCol col : ctCols.getColArray()) {
if (!col.isSetWidth()) {
@ -1550,8 +1544,6 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet {
return (short) outlineLevel;
}
@SuppressWarnings("deprecation")
private short getMaxOutlineLevelCols() {
CTCols ctCols = worksheet.getColsArray(0);
int outlineLevel = 0;
@ -1761,7 +1753,6 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet {
*
* @param indices A set of the regions to unmerge
*/
@SuppressWarnings("deprecation")
public void removeMergedRegions(Collection<Integer> indices) {
if (!worksheet.isSetMergeCells()) return;
@ -1959,7 +1950,6 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet {
}
@SuppressWarnings("deprecation")
private void setColumn(int targetColumnIx, Integer style,
Integer level, Boolean hidden, Boolean collapsed) {
CTCols cols = worksheet.getColsArray(0);
@ -2055,7 +2045,6 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet {
* the col info index of the start of the outline group
* @return the column index of the last column in the outline group
*/
@SuppressWarnings("deprecation")
private int setGroupHidden(int pIdx, int level, boolean hidden) {
CTCols cols = worksheet.getColsArray(0);
int idx = pIdx;
@ -2084,7 +2073,6 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet {
return col.getMax() == other_col.getMin() - 1;
}
@SuppressWarnings("deprecation")
private int findStartOfColumnOutlineGroup(int pIdx) {
// Find the start of the group.
CTCols cols = worksheet.getColsArray(0);
@ -2106,7 +2094,6 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet {
return idx;
}
@SuppressWarnings("deprecation")
private int findEndOfColumnOutlineGroup(int colInfoIndex) {
CTCols cols = worksheet.getColsArray(0);
// Find the end of the group.
@ -2129,7 +2116,6 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet {
return idx;
}
@SuppressWarnings("deprecation")
private void expandColumn(int columnIndex) {
CTCols cols = worksheet.getColsArray(0);
CTCol col = columnHelper.getColumn(columnIndex, false);
@ -2184,7 +2170,6 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet {
Boolean.FALSE, Boolean.FALSE);
}
@SuppressWarnings("deprecation")
private boolean isColumnGroupHiddenByParent(int idx) {
CTCols cols = worksheet.getColsArray(0);
// Look out outline details of end
@ -2218,7 +2203,6 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet {
return startHidden;
}
@SuppressWarnings("deprecation")
private int findColInfoIdx(int columnValue, int fromColInfoIdx) {
CTCols cols = worksheet.getColsArray(0);
@ -2258,7 +2242,6 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet {
* @param idx
* @return a boolean represented if the column is collapsed
*/
@SuppressWarnings("deprecation")
private boolean isColumnGroupCollapsed(int idx) {
CTCols cols = worksheet.getColsArray(0);
CTCol[] colArray = cols.getColArray();
@ -2800,7 +2783,6 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet {
* @param resetOriginalRowHeight whether to set the original row's height to the default
*/
@Override
@SuppressWarnings("deprecation") //YK: getXYZArray() array accessors are deprecated in xmlbeans with JDK 1.5 support
public void shiftRows(int startRow, int endRow, final int n, boolean copyRowHeight, boolean resetOriginalRowHeight) {
XSSFVMLDrawing vml = getVMLDrawing(false);
@ -3066,7 +3048,6 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet {
* @param value <code>true</code> if this sheet is selected
*/
@Override
@SuppressWarnings("deprecation") //YK: getXYZArray() array accessors are deprecated in xmlbeans with JDK 1.5 support
public void setSelected(boolean value) {
CTSheetViews views = getSheetTypeSheetViews();
for (CTSheetView view : views.getSheetViewArray()) {
@ -3674,7 +3655,6 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet {
return dataValidationHelper;
}
@SuppressWarnings("deprecation") //YK: getXYZArray() array accessors are deprecated in xmlbeans with JDK 1.5 support
public List<XSSFDataValidation> getDataValidations() {
List<XSSFDataValidation> xssfValidations = new ArrayList<XSSFDataValidation>();
CTDataValidations dataValidations = this.worksheet.getDataValidations();

View File

@ -182,7 +182,6 @@ public class XSSFSheetConditionalFormatting implements SheetConditionalFormattin
return rule;
}
@SuppressWarnings("deprecation")
public int addConditionalFormatting(CellRangeAddress[] regions, ConditionalFormattingRule[] cfRules) {
if (regions == null) {
throw new IllegalArgumentException("regions must not be null");

View File

@ -129,7 +129,6 @@ public class XSSFTable extends POIXMLDocumentPart {
*
* @return the xpath of the table's root element
*/
@SuppressWarnings("deprecation")
public String getCommonXpath() {
if (commonXPath == null) {
String[] commonTokens = {};
@ -167,7 +166,6 @@ public class XSSFTable extends POIXMLDocumentPart {
}
@SuppressWarnings("deprecation")
public List<XSSFXmlColumnPr> getXmlColumnPrs() {
if (xmlColumnPr==null) {
@ -275,7 +273,6 @@ public class XSSFTable extends POIXMLDocumentPart {
* Headers <em>must</em> be in sync, otherwise Excel will display a
* "Found unreadable content" message on startup.
*/
@SuppressWarnings("deprecation")
public void updateHeaders(){
XSSFSheet sheet = (XSSFSheet)getParent();
CellReference ref = getStartCellReference();

View File

@ -330,7 +330,6 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook {
}
@Override
@SuppressWarnings("deprecation") // getXYZArray() array accessors are deprecated
protected void onDocumentRead() throws IOException {
try {
WorkbookDocument doc = WorkbookDocument.Factory.parse(getPackagePart().getInputStream(), DEFAULT_XML_OPTIONS);
@ -1330,7 +1329,6 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook {
* 'Selected' sheet(s) is a distinct concept.
*/
@Override
@SuppressWarnings("deprecation") //YK: getXYZArray() array accessors are deprecated in xmlbeans with JDK 1.5 support
public void setActiveSheet(int index) {
validateSheetIndex(index);
@ -1569,7 +1567,6 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook {
* @param pos the position that we want to insert the sheet into (0 based)
*/
@Override
@SuppressWarnings("deprecation")
public void setSheetOrder(String sheetname, int pos) {
int idx = getSheetIndex(sheetname);
sheets.add(pos, sheets.remove(idx));
@ -1632,7 +1629,6 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook {
}
}
@SuppressWarnings("deprecation")
private void reprocessNamedRanges() {
namedRanges = new ArrayList<XSSFName>();
if(workbook.isSetDefinedNames()) {
@ -1710,7 +1706,6 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook {
* @param excludeSheetIdx the sheet to exclude from the check or -1 to include all sheets in the check.
* @return true if the sheet contains the name, false otherwise.
*/
@SuppressWarnings("deprecation") // getXYZArray() array accessors are deprecated
private boolean containsSheet(String name, int excludeSheetIdx) {
CTSheet[] ctSheetArray = workbook.getSheets().getSheetArray();

View File

@ -46,7 +46,6 @@ public class ColumnHelper {
cleanColumns();
}
@SuppressWarnings("deprecation")
public void cleanColumns() {
TreeSet<CTCol> trackedCols = new TreeSet<CTCol>(CTColComparator.BY_MIN_MAX);
CTCols newCols = CTCols.Factory.newInstance();
@ -154,7 +153,6 @@ public class ColumnHelper {
return new long[] { col.getMin(), col.getMax() };
}
@SuppressWarnings("deprecation")
public static void sortColumns(CTCols newCols) {
CTCol[] colArray = newCols.getColArray();
Arrays.sort(colArray, CTColComparator.BY_MIN_MAX);
@ -187,7 +185,6 @@ public class ColumnHelper {
// Fetching the array is quicker than working on the new style
// list, assuming we need to read many of them (which we often do),
// and assuming we're not making many changes (which we're not)
@SuppressWarnings("deprecation")
CTCol[] colArray = cols.getColArray();
for (CTCol col : colArray) {
@ -241,7 +238,6 @@ public class ColumnHelper {
return columnExists1Based(cols, index+1);
}
@SuppressWarnings("deprecation")
private boolean columnExists1Based(CTCols cols, long index1) {
for (CTCol col : cols.getColArray()) {
if (col.getMin() == index1) {
@ -313,7 +309,6 @@ public class ColumnHelper {
return -1;
}
@SuppressWarnings("deprecation")
private boolean columnExists(CTCols cols, long min, long max) {
for (CTCol col : cols.getColArray()) {
if (col.getMin() == min && col.getMax() == max) {
@ -323,7 +318,6 @@ public class ColumnHelper {
return false;
}
@SuppressWarnings("deprecation")
public int getIndexOfColumn(CTCols cols, CTCol searchCol) {
int i = 0;
for (CTCol col : cols.getColArray()) {

View File

@ -126,6 +126,7 @@ public final class XSSFRowShifter {
/**
* Updated named ranges
*/
@SuppressWarnings("resource")
public void updateNamedRanges(FormulaShifter shifter) {
XSSFWorkbook wb = sheet.getWorkbook();
XSSFEvaluationWorkbook fpb = XSSFEvaluationWorkbook.create(wb);
@ -145,6 +146,7 @@ public final class XSSFRowShifter {
/**
* Update formulas.
*/
@SuppressWarnings("resource")
public void updateFormulas(FormulaShifter shifter) {
//update formulas on the parent sheet
updateSheetFormulas(sheet, shifter);
@ -211,6 +213,7 @@ public final class XSSFRowShifter {
* @return the shifted formula if the formula was changed,
* <code>null</code> if the formula wasn't modified
*/
@SuppressWarnings("resource")
private static String shiftFormula(XSSFRow row, String formula, FormulaShifter shifter) {
XSSFSheet sheet = row.getSheet();
XSSFWorkbook wb = sheet.getWorkbook();
@ -231,7 +234,7 @@ public final class XSSFRowShifter {
}
}
@SuppressWarnings("deprecation")
@SuppressWarnings("resource")
public void updateConditionalFormatting(FormulaShifter shifter) {
XSSFWorkbook wb = sheet.getWorkbook();
int sheetIndex = wb.getSheetIndex(sheet);

View File

@ -33,7 +33,6 @@ public class XWPFCommentsDecorator extends XWPFParagraphDecorator {
this(nextDecorator.paragraph, nextDecorator);
}
@SuppressWarnings("deprecation")
public XWPFCommentsDecorator(XWPFParagraph paragraph, XWPFParagraphDecorator nextDecorator) {
super(paragraph, nextDecorator);

View File

@ -32,7 +32,6 @@ public abstract class AbstractXWPFSDT implements ISDTContents {
private final String tag;
private final IBody part;
@SuppressWarnings("deprecation")
public AbstractXWPFSDT(CTSdtPr pr, IBody part) {
CTString[] aliases = pr.getAliasArray();

View File

@ -29,7 +29,6 @@ public class XWPFComment {
protected String author;
protected StringBuffer text;
@SuppressWarnings("deprecation")
public XWPFComment(CTComment comment, XWPFDocument document) {
text = new StringBuffer();
id = comment.getId().toString();

View File

@ -252,7 +252,6 @@ public class XWPFDocument extends POIXMLDocument implements Document, IBody {
}
}
@SuppressWarnings("deprecation")
private void initFootnotes() throws XmlException, IOException {
for (POIXMLDocumentPart p : getRelations()) {
String relation = p.getPackageRelationship().getRelationshipType();
@ -1212,7 +1211,6 @@ public class XWPFDocument extends POIXMLDocument implements Document, IBody {
* @param table
*/
@Override
@SuppressWarnings("deprecation")
public void insertTable(int pos, XWPFTable table) {
bodyElements.add(pos, table);
int i = 0;

View File

@ -124,7 +124,6 @@ public class XWPFFootnote implements Iterable<XWPFParagraph>, IBody {
* @param table
* @see org.apache.poi.xwpf.usermodel.IBody#insertTable(int pos, XWPFTable table)
*/
@SuppressWarnings("deprecation")
public void insertTable(int pos, XWPFTable table) {
bodyElements.add(pos, table);
int i = 0;

View File

@ -66,7 +66,6 @@ public class XWPFFootnotes extends POIXMLDocumentPart {
* Read document
*/
@Override
@SuppressWarnings("deprecation")
protected void onDocumentRead() throws IOException {
FootnotesDocument notesDoc;
try {

View File

@ -441,7 +441,6 @@ public abstract class XWPFHeaderFooter extends POIXMLDocumentPart implements IBo
* @param pos
* @param table
*/
@SuppressWarnings("deprecation")
public void insertTable(int pos, XWPFTable table) {
bodyElements.add(pos, table);
int i = 0;

View File

@ -42,7 +42,6 @@ public class XWPFLatentStyles {
/**
* checks whether specific LatentStyleID is a latentStyle
*/
@SuppressWarnings("deprecation")
protected boolean isLatentStyle(String latentStyleID) {
for (CTLsdException lsd : latentStyles.getLsdExceptionArray()) {
if (lsd.getName().equals(latentStyleID)) {

View File

@ -69,7 +69,6 @@ public class XWPFNumbering extends POIXMLDocumentPart {
* read numbering form an existing package
*/
@Override
@SuppressWarnings("deprecation")
protected void onDocumentRead() throws IOException {
NumberingDocument numberingDoc = null;
InputStream is;

View File

@ -1376,7 +1376,6 @@ public class XWPFParagraph implements IBodyElement, IRunBody, ISDTContents, Para
int beginRunPos = 0, candCharPos = 0;
boolean newList = false;
@SuppressWarnings("deprecation")
CTR[] rArray = paragraph.getRArray();
for (int runPos = startRun; runPos < rArray.length; runPos++) {
int beginTextPos = 0, beginCharPos = 0, textPos = 0, charPos = 0;
@ -1437,7 +1436,6 @@ public class XWPFParagraph implements IBodyElement, IRunBody, ISDTContents, Para
*
* @param segment
*/
@SuppressWarnings("deprecation")
public String getText(TextSegement segment) {
int runBegin = segment.getBeginRun();
int textBegin = segment.getBeginText();

View File

@ -94,7 +94,6 @@ public class XWPFRun implements ISDTContents, IRunElement, CharacterRun {
* @param r the CTR bean which holds the run attributes
* @param p the parent paragraph
*/
@SuppressWarnings("deprecation")
public XWPFRun(CTR r, IRunBody p) {
this.run = r;
this.parent = p;

View File

@ -129,7 +129,6 @@ public class XWPFStyles extends POIXMLDocumentPart {
*
* @param styles
*/
@SuppressWarnings("deprecation")
public void setStyles(CTStyles styles) {
ctStyles = styles;

View File

@ -92,7 +92,6 @@ public class XWPFTable implements IBodyElement, ISDTContents {
}
}
@SuppressWarnings("deprecation")
public XWPFTable(CTTbl table, IBody part) {
this.part = part;
this.ctTbl = table;

View File

@ -396,7 +396,6 @@ public class XWPFTableCell implements IBody, ICell {
*
* @see org.apache.poi.xwpf.usermodel.IBody#insertTable(int, org.apache.poi.xwpf.usermodel.XWPFTable)
*/
@SuppressWarnings("deprecation")
public void insertTable(int pos, XWPFTable table) {
bodyElements.add(pos, table);
int i = 0;

View File

@ -156,7 +156,6 @@ public class XWPFTableRow {
*
* @return a list of {@link XWPFTableCell}
*/
@SuppressWarnings("deprecation")
public List<XWPFTableCell> getTableCells() {
if (tableCells == null) {
List<XWPFTableCell> cells = new ArrayList<XWPFTableCell>();