Remove more deprecated classes and methods

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1809428 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2017-09-23 14:03:25 +00:00
parent 8e1b51128c
commit 3a622169d3
10 changed files with 11 additions and 149 deletions

View File

@ -1,43 +0,0 @@
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
package org.apache.poi.hssf.util;
import org.apache.poi.ss.SpreadsheetVersion;
/**
* @deprecated POI 3.15 beta 3. Use {@link org.apache.poi.ss.util.AreaReference} instead.
*/
@Deprecated
public final class AreaReference extends org.apache.poi.ss.util.AreaReference {
/**
* Create an area ref from a string representation. Sheet names containing special characters should be
* delimited and escaped as per normal syntax rules for formulas.<br>
* The area reference must be contiguous (i.e. represent a single rectangle, not a union of rectangles)
*/
public AreaReference(String reference) {
super(reference, SpreadsheetVersion.EXCEL97);
}
/**
* Creates an area ref from a pair of Cell References.
* Also normalises such that the top-left
*/
public AreaReference(CellReference topLeft, CellReference botRight) {
super(topLeft, botRight);
}
}

View File

@ -26,10 +26,10 @@ import org.apache.poi.util.Removal;
/**
* Various utility functions that make working with a region of cells easier.
* @deprecated POI 3.18
* @deprecated POI 4.0.0
* @see RegionUtil
*/
@Removal(version="3.20")
@Removal(version="4.2")
public final class HSSFRegionUtil {
private HSSFRegionUtil() {

View File

@ -1,30 +0,0 @@
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
package org.apache.poi.hssf.util;
/**
* Holds information regarding a split plane or freeze plane for a sheet.
* @deprecated POI 3.15 beta 3. Use {@link org.apache.poi.ss.util.PaneInformation} instead.
*/
public class PaneInformation extends org.apache.poi.ss.util.PaneInformation
{
public PaneInformation(short x, short y, short top, short left, byte active, boolean frozen) {
super(x, y, top, left, active, frozen);
}
}

View File

@ -17,10 +17,8 @@
package org.apache.poi.ss.formula.ptg;
import org.apache.poi.ss.SpreadsheetVersion;
import org.apache.poi.ss.util.AreaReference;
import org.apache.poi.util.LittleEndianInput;
import org.apache.poi.util.Removal;
/**
* Specifies a rectangular area of cells A1:A4 for instance.
@ -36,15 +34,6 @@ public final class AreaPtg extends Area2DPtgBase {
public AreaPtg(LittleEndianInput in) {
super(in);
}
/**
* @deprecated use {@link #AreaPtg(AreaReference)} instead
*/
@Deprecated()
@Removal(version="3.19")
public AreaPtg(String arearef) {
this(new AreaReference(arearef, SpreadsheetVersion.EXCEL97));
}
public AreaPtg(AreaReference arearef) {
super(arearef);

View File

@ -22,7 +22,6 @@ import java.util.List;
import java.util.StringTokenizer;
import org.apache.poi.ss.SpreadsheetVersion;
import org.apache.poi.util.Removal;
public class AreaReference {
@ -105,16 +104,6 @@ public class AreaReference {
}
return true;
}
/**
* Creates an area ref from a pair of Cell References.
* @deprecated use {@link #AreaReference(CellReference, CellReference, SpreadsheetVersion)} instead
*/
@Deprecated
@Removal(version="3.19")
public AreaReference(CellReference topLeft, CellReference botRight) {
this(topLeft, botRight, DEFAULT_SPREADSHEET_VERSION);
}
/**
* Creates an area ref from a pair of Cell References.
@ -217,17 +206,6 @@ public class AreaReference {
return isWholeColumnReference(_version, _firstCell, _lastCell);
}
/**
* Takes a non-contiguous area reference, and returns an array of contiguous area references
* @return an array of contiguous area references.
* @deprecated use {@link #generateContiguous(SpreadsheetVersion, String)} instead
*/
@Deprecated
@Removal(version="3.19")
public static AreaReference[] generateContiguous(String reference) {
return generateContiguous(DEFAULT_SPREADSHEET_VERSION, reference);
}
/**
* Takes a non-contiguous area reference, and returns an array of contiguous area references
* @return an array of contiguous area references.

View File

@ -18,7 +18,6 @@
package org.apache.poi.xssf.usermodel;
import org.apache.poi.ss.usermodel.Shape;
import org.apache.poi.util.Removal;
import org.apache.poi.util.Units;
import org.openxmlformats.schemas.drawingml.x2006.main.CTLineProperties;
import org.openxmlformats.schemas.drawingml.x2006.main.CTNoFillProperties;
@ -32,33 +31,6 @@ import org.openxmlformats.schemas.drawingml.x2006.main.STPresetLineDashVal;
* Represents a shape in a SpreadsheetML drawing.
*/
public abstract class XSSFShape implements Shape {
/**
* @deprecated POI 3.17 beta 1
* @see Units#EMU_PER_PIXEL
*/
@Removal(version="3.19")
public static final int EMU_PER_PIXEL = Units.EMU_PER_PIXEL;
/**
* @deprecated POI 3.17 beta 1
* @see Units#EMU_PER_POINT
*/
@Removal(version="3.19")
public static final int EMU_PER_POINT = Units.EMU_PER_POINT;
/**
* @deprecated POI 3.17 beta 1
* @see Units#POINT_DPI
*/
@Removal(version="3.19")
public static final int POINT_DPI = Units.POINT_DPI;
/**
* @deprecated POI 3.17 beta 1
* @see Units#PIXEL_DPI
*/
@Removal(version="3.19")
public static final int PIXEL_DPI = Units.PIXEL_DPI;
/**
* Parent drawing

View File

@ -274,16 +274,6 @@ public final class TestAreaReference extends TestCase {
confirmWholeColumnRef("AD:$AE", 29, 30, false, true);
}
@SuppressWarnings("deprecation")
public void testDeprecatedMethod() {
String refSimple = "$C$10:$C$10";
AreaReference[] arefs1 = AreaReference.generateContiguous(SpreadsheetVersion.EXCEL97, refSimple);
AreaReference[] arefs2 = AreaReference.generateContiguous(refSimple);
assertEquals(1, arefs1.length);
assertEquals(arefs1.length, arefs2.length);
assertEquals(arefs1[0].formatAsString(), arefs2[0].formatAsString());
}
private static void confirmWholeColumnRef(String ref, int firstCol, int lastCol, boolean firstIsAbs, boolean lastIsAbs) {
AreaReference ar = new AreaReference(ref, SpreadsheetVersion.EXCEL97);
confirmCell(ar.getFirstCell(), 0, firstCol, true, firstIsAbs);

View File

@ -20,8 +20,10 @@ package org.apache.poi.ss.formula.eval;
import junit.framework.AssertionFailedError;
import junit.framework.TestCase;
import org.apache.poi.ss.SpreadsheetVersion;
import org.apache.poi.ss.formula.ptg.AreaPtg;
import org.apache.poi.ss.formula.functions.EvalFactory;
import org.apache.poi.ss.util.AreaReference;
/**
* Tests for <tt>AreaEval</tt>
@ -32,7 +34,7 @@ public final class TestAreaEval extends TestCase {
public void testGetValue_bug44950() {
// TODO - this test probably isn't testing much anymore
AreaPtg ptg = new AreaPtg("B2:D3");
AreaPtg ptg = new AreaPtg(new AreaReference("B2:D3", SpreadsheetVersion.EXCEL97));
NumberEval one = new NumberEval(1);
ValueEval[] values = {
one,

View File

@ -17,6 +17,7 @@
package org.apache.poi.ss.formula.functions;
import org.apache.poi.ss.SpreadsheetVersion;
import org.apache.poi.ss.formula.TwoDEval;
import org.apache.poi.ss.formula.eval.AreaEval;
import org.apache.poi.ss.formula.eval.AreaEvalBase;
@ -28,6 +29,7 @@ import org.apache.poi.ss.formula.ptg.AreaI;
import org.apache.poi.ss.formula.ptg.AreaPtg;
import org.apache.poi.ss.formula.ptg.Ref3DPtg;
import org.apache.poi.ss.formula.ptg.RefPtg;
import org.apache.poi.ss.util.AreaReference;
/**
* Test helper class for creating mock <code>Eval</code> objects
@ -45,7 +47,7 @@ public final class EvalFactory {
* @param values empty (<code>null</code>) entries in this array will be converted to NumberEval.ZERO
*/
public static AreaEval createAreaEval(String areaRefStr, ValueEval[] values) {
AreaPtg areaPtg = new AreaPtg(areaRefStr);
AreaPtg areaPtg = new AreaPtg(new AreaReference(areaRefStr, SpreadsheetVersion.EXCEL2007));
return createAreaEval(areaPtg, values);
}

View File

@ -22,6 +22,8 @@ import junit.framework.TestCase;
import org.apache.poi.hssf.model.HSSFFormulaParser;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.SpreadsheetVersion;
import org.apache.poi.ss.util.AreaReference;
/**
* Tests for {@link AreaPtg}.
@ -44,7 +46,7 @@ public final class TestAreaPtg extends TestCase {
}
public static void testSortTopLeftToBottomRight() {
AreaPtg ptg = new AreaPtg("A$1:$B5");
AreaPtg ptg = new AreaPtg(new AreaReference("A$1:$B5", SpreadsheetVersion.EXCEL2007));
assertEquals("A$1:$B5", ptg.toFormulaString());
ptg.setFirstColumn(3);
assertEquals("Area Ptg should not implicitly re-sort itself (except during construction)",