diff options
author | PJ Fanning <fanningpj@apache.org> | 2017-09-14 23:44:47 +0000 |
---|---|---|
committer | PJ Fanning <fanningpj@apache.org> | 2017-09-14 23:44:47 +0000 |
commit | deb0aca6ac31fa15b34271c965883da5d4d6f57d (patch) | |
tree | 6094e601a704d8ca7e5cbc5213f625c012f0c04b /src/java/org/apache/poi | |
parent | 66d83f98d7d403875e2eaefe615624060e19157e (diff) | |
download | poi-deb0aca6ac31fa15b34271c965883da5d4d6f57d.tar.gz poi-deb0aca6ac31fa15b34271c965883da5d4d6f57d.zip |
remove some deprecated code slated for removal in 3.18
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808403 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/poi')
12 files changed, 13 insertions, 217 deletions
diff --git a/src/java/org/apache/poi/hpsf/CustomProperties.java b/src/java/org/apache/poi/hpsf/CustomProperties.java index da4e9277bc..8652c3a446 100644 --- a/src/java/org/apache/poi/hpsf/CustomProperties.java +++ b/src/java/org/apache/poi/hpsf/CustomProperties.java @@ -151,7 +151,7 @@ public class CustomProperties implements Map<String,Object> { } else { throw new IllegalStateException("unsupported datatype - currently String,Short,Integer,Long,Float,Double,Boolean,BigInteger(unsigned long),Date can be processed."); } - final Property p = new MutableProperty(-1, variantType, value); + final Property p = new Property(-1, variantType, value); return put(new CustomProperty(p, key)); } diff --git a/src/java/org/apache/poi/hpsf/CustomProperty.java b/src/java/org/apache/poi/hpsf/CustomProperty.java index 83511655ab..9602cf8f49 100644 --- a/src/java/org/apache/poi/hpsf/CustomProperty.java +++ b/src/java/org/apache/poi/hpsf/CustomProperty.java @@ -23,7 +23,7 @@ package org.apache.poi.hpsf; * properties have an optional name. If the name is not {@code null} it * will be maintained in the section's dictionary. */ -public class CustomProperty extends MutableProperty +public class CustomProperty extends Property { private String name; diff --git a/src/java/org/apache/poi/hpsf/DocumentSummaryInformation.java b/src/java/org/apache/poi/hpsf/DocumentSummaryInformation.java index cea4d5dd9f..7d86a2b0f3 100644 --- a/src/java/org/apache/poi/hpsf/DocumentSummaryInformation.java +++ b/src/java/org/apache/poi/hpsf/DocumentSummaryInformation.java @@ -33,7 +33,7 @@ import org.apache.poi.hpsf.wellknown.SectionIDMap; * * @see SummaryInformation */ -public class DocumentSummaryInformation extends SpecialPropertySet { +public class DocumentSummaryInformation extends PropertySet { /** * The document name a document summary information stream * usually has in a POIFS filesystem. @@ -811,7 +811,7 @@ public class DocumentSummaryInformation extends SpecialPropertySet { */ private void ensureSection2() { if (getSectionCount() < 2) { - Section s2 = new MutableSection(); + Section s2 = new Section(); s2.setFormatID(SectionIDMap.DOCUMENT_SUMMARY_INFORMATION_ID[1]); addSection(s2); } diff --git a/src/java/org/apache/poi/hpsf/MutableProperty.java b/src/java/org/apache/poi/hpsf/MutableProperty.java deleted file mode 100644 index 106ad6f240..0000000000 --- a/src/java/org/apache/poi/hpsf/MutableProperty.java +++ /dev/null @@ -1,55 +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.hpsf; - -import java.io.UnsupportedEncodingException; - -import org.apache.poi.util.LittleEndianByteArrayInputStream; -import org.apache.poi.util.Removal; - -/** - * <p>Adds writing capability to the {@link Property} class.</p> - * - * <p>Please be aware that this class' functionality will be merged into the - * {@link Property} class at a later time, so the API will change.</p> - * - * @deprecated POI 3.16 - use Property as base class instead - */ -@Deprecated -@Removal(version="3.18") -public class MutableProperty extends Property { - public MutableProperty() {} - - public MutableProperty(final Property p) { - super(p); - } - - public MutableProperty(final long id, final long type, final Object value) { - super(id, type, value); - } - - public MutableProperty(final long id, final byte[] src, final long offset, final int length, final int codepage) - throws UnsupportedEncodingException { - super(id, src, offset, length, codepage); - } - - public MutableProperty(final long id, LittleEndianByteArrayInputStream leis, final int length, final int codepage) - throws UnsupportedEncodingException { - super(id, leis, length, codepage); - } -} diff --git a/src/java/org/apache/poi/hpsf/MutablePropertySet.java b/src/java/org/apache/poi/hpsf/MutablePropertySet.java deleted file mode 100644 index 60f043af9f..0000000000 --- a/src/java/org/apache/poi/hpsf/MutablePropertySet.java +++ /dev/null @@ -1,46 +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.hpsf; - -import java.io.IOException; -import java.io.InputStream; -import java.io.UnsupportedEncodingException; - -import org.apache.poi.util.Removal; - -/** - * dds writing support to the {@link PropertySet} class.<p> - * - * Please be aware that this class' functionality will be merged into the - * {@link PropertySet} class at a later time, so the API will change. - * - * @deprecated POI 3.16 - use PropertySet as base class instead - */ -@Removal(version="3.18") -public class MutablePropertySet extends PropertySet { - public MutablePropertySet() {} - - public MutablePropertySet(final PropertySet ps) { - super(ps); - } - - /* package */ MutablePropertySet(final InputStream stream) - throws NoPropertySetStreamException, MarkUnsupportedException, IOException, UnsupportedEncodingException { - super(stream); - } -} diff --git a/src/java/org/apache/poi/hpsf/MutableSection.java b/src/java/org/apache/poi/hpsf/MutableSection.java deleted file mode 100644 index c5f0d6e0c8..0000000000 --- a/src/java/org/apache/poi/hpsf/MutableSection.java +++ /dev/null @@ -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.hpsf; - -import java.io.UnsupportedEncodingException; - -import org.apache.poi.util.Removal; - -/** - * <p>Adds writing capability to the {@link Section} class.</p> - * - * <p>Please be aware that this class' functionality will be merged into the - * {@link Section} class at a later time, so the API will change.</p> - * - * @deprecated POI 3.16 - use Section as base class instead - */ -@Removal(version="3.18") -public class MutableSection extends Section { - public MutableSection() {} - - public MutableSection(final Section s) { - super(s); - } - - public MutableSection(final byte[] src, final int offset) throws UnsupportedEncodingException { - super(src,offset); - } -} diff --git a/src/java/org/apache/poi/hpsf/PropertySet.java b/src/java/org/apache/poi/hpsf/PropertySet.java index db01200bc7..dd6d7e737f 100644 --- a/src/java/org/apache/poi/hpsf/PropertySet.java +++ b/src/java/org/apache/poi/hpsf/PropertySet.java @@ -158,7 +158,7 @@ public class PropertySet { /* Initialize the sections. Since property set must have at least * one section it is added right here. */ - addSection(new MutableSection()); + addSection(new Section()); } @@ -250,7 +250,7 @@ public class PropertySet { setOSVersion(ps.getOSVersion()); setClassID(ps.getClassID()); for (final Section section : ps.getSections()) { - sections.add(new MutableSection(section)); + sections.add(new Section(section)); } } @@ -491,7 +491,7 @@ public class PropertySet { * "offset" accordingly. */ for (int i = 0; i < sectionCount; i++) { - final Section s = new MutableSection(src, o); + final Section s = new Section(src, o); o += ClassID.LENGTH + LittleEndianConsts.INT_SIZE; sections.add(s); } @@ -580,7 +580,7 @@ public class PropertySet { * document. The input stream represents a snapshot of the property set. * If the latter is modified while the input stream is still being * read, the modifications will not be reflected in the input stream but in - * the {@link MutablePropertySet} only. + * the {@link PropertySet} only. * * @return the contents of this property set stream * diff --git a/src/java/org/apache/poi/hpsf/Section.java b/src/java/org/apache/poi/hpsf/Section.java index f041986402..accb177cc6 100644 --- a/src/java/org/apache/poi/hpsf/Section.java +++ b/src/java/org/apache/poi/hpsf/Section.java @@ -99,7 +99,7 @@ public class Section { this._offset = -1; setFormatID(s.getFormatID()); for (Property p : s.properties.values()) { - properties.put(p.getID(), new MutableProperty(p)); + properties.put(p.getID(), new Property(p)); } setDictionary(s.getDictionary()); } @@ -228,13 +228,13 @@ public class Section { try { // fix id id = Math.max(PropertyIDMap.PID_MAX, offset2Id.inverseBidiMap().lastKey())+1; - setProperty(new MutableProperty(id, leis, pLen, codepage)); + setProperty(new Property(id, leis, pLen, codepage)); } catch (RuntimeException e) { LOG.log(POILogger.INFO, "Dictionary fallback failed - ignoring property"); } }; } else { - setProperty(new MutableProperty(id, leis, pLen, codepage)); + setProperty(new Property(id, leis, pLen, codepage)); } } @@ -424,7 +424,7 @@ public class Section { */ @SuppressWarnings("deprecation") public void setProperty(final int id, final long variantType, final Object value) { - setProperty(new MutableProperty(id, variantType, value)); + setProperty(new Property(id, variantType, value)); } diff --git a/src/java/org/apache/poi/hpsf/SpecialPropertySet.java b/src/java/org/apache/poi/hpsf/SpecialPropertySet.java deleted file mode 100644 index 0ba19b7982..0000000000 --- a/src/java/org/apache/poi/hpsf/SpecialPropertySet.java +++ /dev/null @@ -1,49 +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.hpsf; - -import java.io.IOException; -import java.io.InputStream; -import java.io.UnsupportedEncodingException; - -import org.apache.poi.util.Removal; - -/** - * Interface for the convenience classes {@link SummaryInformation} - * and {@link DocumentSummaryInformation}.<p> - * - * This used to be an abstract class to support late loading - * of the SummaryInformation classes, as their concrete instance can - * only be determined after the PropertySet has been loaded. - * - * @deprecated POI 3.16 - use PropertySet as base class instead - */ -@Removal(version="3.18") -public class SpecialPropertySet extends MutablePropertySet { - public SpecialPropertySet() { - } - - public SpecialPropertySet(final PropertySet ps) throws UnexpectedPropertySetTypeException { - super(ps); - } - - /* package */ SpecialPropertySet(final InputStream stream) - throws NoPropertySetStreamException, MarkUnsupportedException, IOException, UnsupportedEncodingException { - super(stream); - } -} diff --git a/src/java/org/apache/poi/hpsf/SummaryInformation.java b/src/java/org/apache/poi/hpsf/SummaryInformation.java index 8d9e431794..4425abc530 100644 --- a/src/java/org/apache/poi/hpsf/SummaryInformation.java +++ b/src/java/org/apache/poi/hpsf/SummaryInformation.java @@ -31,7 +31,7 @@ import org.apache.poi.hpsf.wellknown.SectionIDMap; * * @see DocumentSummaryInformation */ -public final class SummaryInformation extends SpecialPropertySet { +public final class SummaryInformation extends PropertySet { /** * The document name a summary information stream usually has in a POIFS filesystem. diff --git a/src/java/org/apache/poi/hpsf/extractor/HPSFPropertiesExtractor.java b/src/java/org/apache/poi/hpsf/extractor/HPSFPropertiesExtractor.java index 36c3f3a9cb..c3efc21d3d 100644 --- a/src/java/org/apache/poi/hpsf/extractor/HPSFPropertiesExtractor.java +++ b/src/java/org/apache/poi/hpsf/extractor/HPSFPropertiesExtractor.java @@ -28,7 +28,6 @@ import org.apache.poi.hpsf.DocumentSummaryInformation; import org.apache.poi.hpsf.HPSFPropertiesOnlyDocument; import org.apache.poi.hpsf.Property; import org.apache.poi.hpsf.PropertySet; -import org.apache.poi.hpsf.SpecialPropertySet; import org.apache.poi.hpsf.SummaryInformation; import org.apache.poi.hpsf.wellknown.PropertyIDMap; import org.apache.poi.poifs.filesystem.NPOIFSFileSystem; diff --git a/src/java/org/apache/poi/ss/format/CellFormat.java b/src/java/org/apache/poi/ss/format/CellFormat.java index de1bad4bd3..8ac8075166 100644 --- a/src/java/org/apache/poi/ss/format/CellFormat.java +++ b/src/java/org/apache/poi/ss/format/CellFormat.java @@ -37,7 +37,6 @@ import org.apache.poi.ss.usermodel.DataFormatter; import org.apache.poi.ss.usermodel.DateUtil; import org.apache.poi.ss.util.DateFormatConverter; import org.apache.poi.util.LocaleUtil; -import org.apache.poi.util.Removal; /** * Format a value according to the standard Excel behavior. This "standard" is @@ -118,15 +117,6 @@ public class CellFormat { "###################################################"; private static String QUOTE = "\""; - - /** - * Format a value as it would be were no format specified. This is also - * used when the format specified is <tt>General</tt>. - * @deprecated use {@link #getInstance(Locale, String)} instead - */ - @Deprecated - @Removal(version="3.18") - public static final CellFormat GENERAL_FORMAT = createGeneralFormat(LocaleUtil.getUserLocale()); private static CellFormat createGeneralFormat(final Locale locale) { return new CellFormat(locale, "General") { |