Author: fanningpj Date: Thu Sep 14 23:44:47 2017 New Revision: 1808403 URL: http://svn.apache.org/viewvc?rev=1808403&view=rev Log: remove some deprecated code slated for removal in 3.18
Removed: poi/trunk/src/java/org/apache/poi/hpsf/MutableProperty.java poi/trunk/src/java/org/apache/poi/hpsf/MutablePropertySet.java poi/trunk/src/java/org/apache/poi/hpsf/MutableSection.java poi/trunk/src/java/org/apache/poi/hpsf/SpecialPropertySet.java Modified: poi/trunk/src/examples/src/org/apache/poi/hpsf/examples/CopyCompare.java poi/trunk/src/examples/src/org/apache/poi/hpsf/examples/WriteAuthorAndTitle.java poi/trunk/src/examples/src/org/apache/poi/hpsf/examples/WriteTitle.java poi/trunk/src/java/org/apache/poi/hpsf/CustomProperties.java poi/trunk/src/java/org/apache/poi/hpsf/CustomProperty.java poi/trunk/src/java/org/apache/poi/hpsf/DocumentSummaryInformation.java poi/trunk/src/java/org/apache/poi/hpsf/PropertySet.java poi/trunk/src/java/org/apache/poi/hpsf/Section.java poi/trunk/src/java/org/apache/poi/hpsf/SummaryInformation.java poi/trunk/src/java/org/apache/poi/hpsf/extractor/HPSFPropertiesExtractor.java poi/trunk/src/java/org/apache/poi/ss/format/CellFormat.java poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/ZipHelper.java poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/marshallers/ZipPartMarshaller.java poi/trunk/src/testcases/org/apache/poi/hpsf/basic/TestWrite.java poi/trunk/src/testcases/org/apache/poi/hpsf/basic/TestWriteWellKnown.java Modified: poi/trunk/src/examples/src/org/apache/poi/hpsf/examples/CopyCompare.java URL: http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/hpsf/examples/CopyCompare.java?rev=1808403&r1=1808402&r2=1808403&view=diff ============================================================================== --- poi/trunk/src/examples/src/org/apache/poi/hpsf/examples/CopyCompare.java (original) +++ poi/trunk/src/examples/src/org/apache/poi/hpsf/examples/CopyCompare.java Thu Sep 14 23:44:47 2017 @@ -32,7 +32,6 @@ import java.util.Map; import org.apache.poi.hpsf.HPSFRuntimeException; import org.apache.poi.hpsf.MarkUnsupportedException; -import org.apache.poi.hpsf.MutablePropertySet; import org.apache.poi.hpsf.NoPropertySetStreamException; import org.apache.poi.hpsf.PropertySet; import org.apache.poi.hpsf.PropertySetFactory; @@ -55,9 +54,8 @@ import org.apache.poi.util.TempFile; * * <p>Property set streams are copied logically, i.e. the application * establishes a {@link org.apache.poi.hpsf.PropertySet} of an original property - * set, creates a {@link org.apache.poi.hpsf.MutablePropertySet} from the - * {@link org.apache.poi.hpsf.PropertySet} and writes the - * {@link org.apache.poi.hpsf.MutablePropertySet} to the destination POI file + * set, creates a {@link org.apache.poi.hpsf.PropertySet} and writes the + * {@link org.apache.poi.hpsf.PropertySet} to the destination POI file * system. - Streams which are no property set streams are copied bit by * bit.</p> * @@ -283,7 +281,7 @@ public class CopyCompare * everything unmodified to the destination POI filesystem. Property set * streams are copied by creating a new {@link PropertySet} from the * original property set by using the {@link - * MutablePropertySet#MutablePropertySet(PropertySet)} constructor.</p> + * PropertySet#PropertySet(PropertySet)} constructor.</p> */ static class CopyFile implements POIFSReaderListener { private String dstName; @@ -377,7 +375,7 @@ public class CopyCompare final PropertySet ps) throws WritingNotSupportedException, IOException { final DirectoryEntry de = getPath(poiFs, path); - final MutablePropertySet mps = new MutablePropertySet(ps); + final PropertySet mps = new PropertySet(ps); de.createDocument(name, mps.toInputStream()); } Modified: poi/trunk/src/examples/src/org/apache/poi/hpsf/examples/WriteAuthorAndTitle.java URL: http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/hpsf/examples/WriteAuthorAndTitle.java?rev=1808403&r1=1808402&r2=1808403&view=diff ============================================================================== --- poi/trunk/src/examples/src/org/apache/poi/hpsf/examples/WriteAuthorAndTitle.java (original) +++ poi/trunk/src/examples/src/org/apache/poi/hpsf/examples/WriteAuthorAndTitle.java Thu Sep 14 23:44:47 2017 @@ -28,16 +28,7 @@ import java.io.OutputStream; import java.util.HashMap; import java.util.Map; -import org.apache.poi.hpsf.HPSFRuntimeException; -import org.apache.poi.hpsf.MarkUnsupportedException; -import org.apache.poi.hpsf.MutablePropertySet; -import org.apache.poi.hpsf.MutableSection; -import org.apache.poi.hpsf.NoPropertySetStreamException; -import org.apache.poi.hpsf.PropertySet; -import org.apache.poi.hpsf.PropertySetFactory; -import org.apache.poi.hpsf.SummaryInformation; -import org.apache.poi.hpsf.Variant; -import org.apache.poi.hpsf.WritingNotSupportedException; +import org.apache.poi.hpsf.*; import org.apache.poi.hpsf.wellknown.PropertyIDMap; import org.apache.poi.poifs.eventfilesystem.POIFSReader; import org.apache.poi.poifs.eventfilesystem.POIFSReaderEvent; @@ -240,12 +231,11 @@ public class WriteAuthorAndTitle /* Create a mutable property set as a copy of the original read-only * property set. */ - final MutablePropertySet mps = new MutablePropertySet(si); + final PropertySet mps = new PropertySet(si); /* Retrieve the section containing the properties to modify. A * summary information property set contains exactly one section. */ - final MutableSection s = - (MutableSection) mps.getSections().get(0); + final Section s = mps.getSections().get(0); /* Set the properties. */ s.setProperty(PropertyIDMap.PID_AUTHOR, Variant.VT_LPSTR, @@ -281,7 +271,7 @@ public class WriteAuthorAndTitle throws WritingNotSupportedException, IOException { final DirectoryEntry de = getPath(poiFs, path); - final MutablePropertySet mps = new MutablePropertySet(ps); + final PropertySet mps = new PropertySet(ps); de.createDocument(name, mps.toInputStream()); } Modified: poi/trunk/src/examples/src/org/apache/poi/hpsf/examples/WriteTitle.java URL: http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/hpsf/examples/WriteTitle.java?rev=1808403&r1=1808402&r2=1808403&view=diff ============================================================================== --- poi/trunk/src/examples/src/org/apache/poi/hpsf/examples/WriteTitle.java (original) +++ poi/trunk/src/examples/src/org/apache/poi/hpsf/examples/WriteTitle.java Thu Sep 14 23:44:47 2017 @@ -21,12 +21,7 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; -import org.apache.poi.hpsf.MutableProperty; -import org.apache.poi.hpsf.MutablePropertySet; -import org.apache.poi.hpsf.MutableSection; -import org.apache.poi.hpsf.SummaryInformation; -import org.apache.poi.hpsf.Variant; -import org.apache.poi.hpsf.WritingNotSupportedException; +import org.apache.poi.hpsf.*; import org.apache.poi.hpsf.wellknown.PropertyIDMap; import org.apache.poi.hpsf.wellknown.SectionIDMap; import org.apache.poi.poifs.filesystem.POIFSFileSystem; @@ -61,10 +56,10 @@ public class WriteTitle /* Create a mutable property set. Initially it contains a single section * with no properties. */ - final MutablePropertySet mps = new MutablePropertySet(); + final PropertySet mps = new PropertySet(); /* Retrieve the section the property set already contains. */ - final MutableSection ms = (MutableSection) mps.getSections().get(0); + final Section ms = mps.getSections().get(0); /* Turn the property set into a summary information property. This is * done by setting the format ID of its first section to @@ -72,7 +67,7 @@ public class WriteTitle ms.setFormatID(SectionIDMap.SUMMARY_INFORMATION_ID); /* Create an empty property. */ - final MutableProperty p = new MutableProperty(); + final Property p = new Property(); /* Fill the property with appropriate settings so that it specifies the * document's title. */ Modified: poi/trunk/src/java/org/apache/poi/hpsf/CustomProperties.java URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hpsf/CustomProperties.java?rev=1808403&r1=1808402&r2=1808403&view=diff ============================================================================== --- poi/trunk/src/java/org/apache/poi/hpsf/CustomProperties.java (original) +++ poi/trunk/src/java/org/apache/poi/hpsf/CustomProperties.java Thu Sep 14 23:44:47 2017 @@ -151,7 +151,7 @@ public class CustomProperties implements } 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)); } Modified: poi/trunk/src/java/org/apache/poi/hpsf/CustomProperty.java URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hpsf/CustomProperty.java?rev=1808403&r1=1808402&r2=1808403&view=diff ============================================================================== --- poi/trunk/src/java/org/apache/poi/hpsf/CustomProperty.java (original) +++ poi/trunk/src/java/org/apache/poi/hpsf/CustomProperty.java Thu Sep 14 23:44:47 2017 @@ -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; Modified: poi/trunk/src/java/org/apache/poi/hpsf/DocumentSummaryInformation.java URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hpsf/DocumentSummaryInformation.java?rev=1808403&r1=1808402&r2=1808403&view=diff ============================================================================== --- poi/trunk/src/java/org/apache/poi/hpsf/DocumentSummaryInformation.java (original) +++ poi/trunk/src/java/org/apache/poi/hpsf/DocumentSummaryInformation.java Thu Sep 14 23:44:47 2017 @@ -33,7 +33,7 @@ import org.apache.poi.hpsf.wellknown.Sec * * @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 */ private void ensureSection2() { if (getSectionCount() < 2) { - Section s2 = new MutableSection(); + Section s2 = new Section(); s2.setFormatID(SectionIDMap.DOCUMENT_SUMMARY_INFORMATION_ID[1]); addSection(s2); } Modified: poi/trunk/src/java/org/apache/poi/hpsf/PropertySet.java URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hpsf/PropertySet.java?rev=1808403&r1=1808402&r2=1808403&view=diff ============================================================================== --- poi/trunk/src/java/org/apache/poi/hpsf/PropertySet.java (original) +++ poi/trunk/src/java/org/apache/poi/hpsf/PropertySet.java Thu Sep 14 23:44:47 2017 @@ -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 * Modified: poi/trunk/src/java/org/apache/poi/hpsf/Section.java URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hpsf/Section.java?rev=1808403&r1=1808402&r2=1808403&view=diff ============================================================================== --- poi/trunk/src/java/org/apache/poi/hpsf/Section.java (original) +++ poi/trunk/src/java/org/apache/poi/hpsf/Section.java Thu Sep 14 23:44:47 2017 @@ -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)); } Modified: poi/trunk/src/java/org/apache/poi/hpsf/SummaryInformation.java URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hpsf/SummaryInformation.java?rev=1808403&r1=1808402&r2=1808403&view=diff ============================================================================== --- poi/trunk/src/java/org/apache/poi/hpsf/SummaryInformation.java (original) +++ poi/trunk/src/java/org/apache/poi/hpsf/SummaryInformation.java Thu Sep 14 23:44:47 2017 @@ -31,7 +31,7 @@ import org.apache.poi.hpsf.wellknown.Sec * * @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. Modified: poi/trunk/src/java/org/apache/poi/hpsf/extractor/HPSFPropertiesExtractor.java URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hpsf/extractor/HPSFPropertiesExtractor.java?rev=1808403&r1=1808402&r2=1808403&view=diff ============================================================================== --- poi/trunk/src/java/org/apache/poi/hpsf/extractor/HPSFPropertiesExtractor.java (original) +++ poi/trunk/src/java/org/apache/poi/hpsf/extractor/HPSFPropertiesExtractor.java Thu Sep 14 23:44:47 2017 @@ -28,7 +28,6 @@ import org.apache.poi.hpsf.DocumentSumma 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; Modified: poi/trunk/src/java/org/apache/poi/ss/format/CellFormat.java URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/format/CellFormat.java?rev=1808403&r1=1808402&r2=1808403&view=diff ============================================================================== --- poi/trunk/src/java/org/apache/poi/ss/format/CellFormat.java (original) +++ poi/trunk/src/java/org/apache/poi/ss/format/CellFormat.java Thu Sep 14 23:44:47 2017 @@ -37,7 +37,6 @@ import org.apache.poi.ss.usermodel.DataF 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") { Modified: poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/ZipHelper.java URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/ZipHelper.java?rev=1808403&r1=1808402&r2=1808403&view=diff ============================================================================== --- poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/ZipHelper.java (original) +++ poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/ZipHelper.java Thu Sep 14 23:44:47 2017 @@ -50,17 +50,6 @@ public final class ZipHelper { private final static String FORWARD_SLASH = "/"; /** - * Buffer to read data from file. Use big buffer to improve performaces. the - * InputStream class is reading only 8192 bytes per read call (default value - * set by sun) - * - * @deprecated in POI 3.16-beta3, not used anymore - */ - @Deprecated - @Removal(version="3.18") - public static final int READ_WRITE_FILE_BUFFER_SIZE = 8192; - - /** * Prevent this class to be instancied. */ private ZipHelper() { Modified: poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/marshallers/ZipPartMarshaller.java URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/marshallers/ZipPartMarshaller.java?rev=1808403&r1=1808402&r2=1808403&view=diff ============================================================================== --- poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/marshallers/ZipPartMarshaller.java (original) +++ poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/marshallers/ZipPartMarshaller.java Thu Sep 14 23:44:47 2017 @@ -47,6 +47,7 @@ import org.w3c.dom.Element; */ public final class ZipPartMarshaller implements PartMarshaller { private final static POILogger logger = POILogFactory.getLogger(ZipPartMarshaller.class); + private final static int READ_WRITE_FILE_BUFFER_SIZE = 8192; /** * Save the specified part. @@ -80,7 +81,7 @@ public final class ZipPartMarshaller imp // Saving data in the ZIP file InputStream ins = part.getInputStream(); - byte[] buff = new byte[ZipHelper.READ_WRITE_FILE_BUFFER_SIZE]; + byte[] buff = new byte[READ_WRITE_FILE_BUFFER_SIZE]; while (ins.available() > 0) { int resultRead = ins.read(buff); if (resultRead == -1) { Modified: poi/trunk/src/testcases/org/apache/poi/hpsf/basic/TestWrite.java URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hpsf/basic/TestWrite.java?rev=1808403&r1=1808402&r2=1808403&view=diff ============================================================================== --- poi/trunk/src/testcases/org/apache/poi/hpsf/basic/TestWrite.java (original) +++ poi/trunk/src/testcases/org/apache/poi/hpsf/basic/TestWrite.java Thu Sep 14 23:44:47 2017 @@ -42,24 +42,7 @@ import java.util.Locale; import java.util.Map; import org.apache.poi.POIDataSamples; -import org.apache.poi.hpsf.ClassID; -import org.apache.poi.hpsf.DocumentSummaryInformation; -import org.apache.poi.hpsf.HPSFException; -import org.apache.poi.hpsf.IllegalPropertySetDataException; -import org.apache.poi.hpsf.MutableProperty; -import org.apache.poi.hpsf.MutablePropertySet; -import org.apache.poi.hpsf.MutableSection; -import org.apache.poi.hpsf.NoFormatIDException; -import org.apache.poi.hpsf.NoPropertySetStreamException; -import org.apache.poi.hpsf.PropertySet; -import org.apache.poi.hpsf.PropertySetFactory; -import org.apache.poi.hpsf.ReadingNotSupportedException; -import org.apache.poi.hpsf.Section; -import org.apache.poi.hpsf.SummaryInformation; -import org.apache.poi.hpsf.UnsupportedVariantTypeException; -import org.apache.poi.hpsf.Variant; -import org.apache.poi.hpsf.VariantSupport; -import org.apache.poi.hpsf.WritingNotSupportedException; +import org.apache.poi.hpsf.*; import org.apache.poi.hpsf.wellknown.PropertyIDMap; import org.apache.poi.hpsf.wellknown.SectionIDMap; import org.apache.poi.poifs.eventfilesystem.POIFSReader; @@ -125,9 +108,9 @@ public class TestWrite { * formatID set: */ final OutputStream out = new FileOutputStream(filename); final POIFSFileSystem poiFs = new POIFSFileSystem(); - final MutablePropertySet ps = new MutablePropertySet(); + final PropertySet ps = new PropertySet(); ps.clearSections(); - ps.addSection(new MutableSection()); + ps.addSection(new Section()); /* Write it to a POIFS and the latter to disk: */ try { @@ -162,8 +145,8 @@ public class TestWrite { /* Create a mutable property set and write it to a POIFS: */ final OutputStream out = new FileOutputStream(filename); final POIFSFileSystem poiFs = new POIFSFileSystem(); - final MutablePropertySet ps = new MutablePropertySet(); - final MutableSection s = (MutableSection) ps.getSections().get(0); + final PropertySet ps = new PropertySet(); + final Section s = ps.getSections().get(0); s.setFormatID(SectionIDMap.SUMMARY_INFORMATION_ID); final ByteArrayOutputStream psStream = new ByteArrayOutputStream(); @@ -209,13 +192,13 @@ public class TestWrite { final OutputStream out = new FileOutputStream(filename); final POIFSFileSystem poiFs = new POIFSFileSystem(); - final MutablePropertySet ps = new MutablePropertySet(); - final MutableSection si = new MutableSection(); + final PropertySet ps = new PropertySet(); + final Section si = new Section(); si.setFormatID(SectionIDMap.SUMMARY_INFORMATION_ID); ps.clearSections(); ps.addSection(si); - final MutableProperty p = new MutableProperty(); + final Property p = new Property(); p.setID(PropertyIDMap.PID_AUTHOR); p.setType(Variant.VT_LPWSTR); p.setValue(AUTHOR); @@ -281,18 +264,18 @@ public class TestWrite { final OutputStream out = new FileOutputStream(filename); final POIFSFileSystem poiFs = new POIFSFileSystem(); - final MutablePropertySet ps = new MutablePropertySet(); + final PropertySet ps = new PropertySet(); ps.clearSections(); final ClassID formatID = new ClassID(); formatID.setBytes(new byte[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}); - final MutableSection s1 = new MutableSection(); + final Section s1 = new Section(); s1.setFormatID(formatID); s1.setProperty(2, SECTION1); ps.addSection(s1); - final MutableSection s2 = new MutableSection(); + final Section s2 = new Section(); s2.setFormatID(formatID); s2.setProperty(2, SECTION2); ps.addSection(s2); @@ -429,10 +412,10 @@ public class TestWrite { @Test public void unicodeWrite8Bit() throws WritingNotSupportedException, IOException, NoPropertySetStreamException { final String TITLE = "This is a sample title"; - final MutablePropertySet mps = new MutablePropertySet(); - final MutableSection ms = (MutableSection) mps.getSections().get(0); + final PropertySet mps = new PropertySet(); + final Section ms = mps.getSections().get(0); ms.setFormatID(SectionIDMap.SUMMARY_INFORMATION_ID); - final MutableProperty p = new MutableProperty(); + final Property p = new Property(); p.setID(PropertyIDMap.PID_TITLE); p.setType(Variant.VT_LPSTR); p.setValue(TITLE); @@ -495,8 +478,8 @@ public class TestWrite { /* Write: */ final OutputStream out = new FileOutputStream(copy); final POIFSFileSystem poiFs = new POIFSFileSystem(); - final MutablePropertySet ps1 = new MutablePropertySet(); - final MutableSection s = (MutableSection) ps1.getSections().get(0); + final PropertySet ps1 = new PropertySet(); + final Section s = ps1.getSections().get(0); final Map<Long,String> m = new HashMap<Long,String>(3, 1.0f); m.put(Long.valueOf(1), "String 1"); m.put(Long.valueOf(2), "String 2"); @@ -759,8 +742,8 @@ public class TestWrite { final OutputStream out = new FileOutputStream(copy); final POIFSFileSystem poiFs = new POIFSFileSystem(); - final MutablePropertySet ps1 = new MutablePropertySet(); - final MutableSection s = (MutableSection) ps1.getSections().get(0); + final PropertySet ps1 = new PropertySet(); + final Section s = ps1.getSections().get(0); final Map<Long,String> m = new HashMap<Long, String>(3, 1.0f); m.put(Long.valueOf(1), "String 1"); m.put(Long.valueOf(2), "String 2"); Modified: poi/trunk/src/testcases/org/apache/poi/hpsf/basic/TestWriteWellKnown.java URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hpsf/basic/TestWriteWellKnown.java?rev=1808403&r1=1808402&r2=1808403&view=diff ============================================================================== --- poi/trunk/src/testcases/org/apache/poi/hpsf/basic/TestWriteWellKnown.java (original) +++ poi/trunk/src/testcases/org/apache/poi/hpsf/basic/TestWriteWellKnown.java Thu Sep 14 23:44:47 2017 @@ -34,20 +34,7 @@ import java.util.HashMap; import java.util.Map; import org.apache.poi.POIDataSamples; -import org.apache.poi.hpsf.CustomProperties; -import org.apache.poi.hpsf.CustomProperty; -import org.apache.poi.hpsf.DocumentSummaryInformation; -import org.apache.poi.hpsf.MarkUnsupportedException; -import org.apache.poi.hpsf.MutableProperty; -import org.apache.poi.hpsf.MutableSection; -import org.apache.poi.hpsf.NoPropertySetStreamException; -import org.apache.poi.hpsf.PropertySet; -import org.apache.poi.hpsf.PropertySetFactory; -import org.apache.poi.hpsf.SummaryInformation; -import org.apache.poi.hpsf.UnexpectedPropertySetTypeException; -import org.apache.poi.hpsf.Variant; -import org.apache.poi.hpsf.VariantSupport; -import org.apache.poi.hpsf.WritingNotSupportedException; +import org.apache.poi.hpsf.*; import org.apache.poi.hpsf.wellknown.SectionIDMap; import org.apache.poi.poifs.filesystem.DocumentInputStream; import org.apache.poi.poifs.filesystem.NPOIFSFileSystem; @@ -567,14 +554,14 @@ public class TestWriteWellKnown { DocumentSummaryInformation dsi = PropertySetFactory.newDocumentSummaryInformation(); CustomProperties cps; - MutableSection s; + Section s; /* A document summary information set stream by default does have custom properties. */ cps = dsi.getCustomProperties(); assertNull(cps); /* Test an empty custom properties set. */ - s = new MutableSection(); + s = new Section(); s.setFormatID(SectionIDMap.DOCUMENT_SUMMARY_INFORMATION_ID[1]); // s.setCodepage(CodePageUtil.CP_UNICODE); dsi.addSection(s); @@ -582,7 +569,7 @@ public class TestWriteWellKnown { assertEquals(0, cps.size()); /* Add a custom property. */ - MutableProperty p = new MutableProperty(); + Property p = new Property(); p.setID(ID_1); p.setType(Variant.VT_LPWSTR); p.setValue(VALUE_1); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@poi.apache.org For additional commands, e-mail: commits-h...@poi.apache.org