diff options
author | Dominik Stadler <centic@apache.org> | 2017-09-16 08:27:23 +0000 |
---|---|---|
committer | Dominik Stadler <centic@apache.org> | 2017-09-16 08:27:23 +0000 |
commit | 0cfa1ede4cbc9c00d2f5d3946ae9f57a6dd74d48 (patch) | |
tree | b7f6385f47dbeda7309986def1a4450c64499eb0 /src/java/org/apache/poi/poifs | |
parent | 3e70d75cfb84a6eb6ddb06d1028e636cf03914d1 (diff) | |
download | poi-0cfa1ede4cbc9c00d2f5d3946ae9f57a6dd74d48.tar.gz poi-0cfa1ede4cbc9c00d2f5d3946ae9f57a6dd74d48.zip |
Remove unnecessary type arguments (Java 8)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808516 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/poi/poifs')
20 files changed, 40 insertions, 40 deletions
diff --git a/src/java/org/apache/poi/poifs/crypt/cryptoapi/CryptoAPIEncryptor.java b/src/java/org/apache/poi/poifs/crypt/cryptoapi/CryptoAPIEncryptor.java index 2dec416034..2105997068 100644 --- a/src/java/org/apache/poi/poifs/crypt/cryptoapi/CryptoAPIEncryptor.java +++ b/src/java/org/apache/poi/poifs/crypt/cryptoapi/CryptoAPIEncryptor.java @@ -128,7 +128,7 @@ public class CryptoAPIEncryptor extends Encryptor implements Cloneable { byte buf[] = new byte[8]; bos.write(buf, 0, 8); // skip header - List<StreamDescriptorEntry> descList = new ArrayList<StreamDescriptorEntry>(); + List<StreamDescriptorEntry> descList = new ArrayList<>(); int block = 0; for (Entry entry : entries.getRoot()) { diff --git a/src/java/org/apache/poi/poifs/dev/POIFSViewEngine.java b/src/java/org/apache/poi/poifs/dev/POIFSViewEngine.java index 84f2a54632..dc4dd547cc 100644 --- a/src/java/org/apache/poi/poifs/dev/POIFSViewEngine.java +++ b/src/java/org/apache/poi/poifs/dev/POIFSViewEngine.java @@ -55,7 +55,7 @@ public class POIFSViewEngine final int indentLevel, final String indentString) { - List<String> objects = new ArrayList<String>(); + List<String> objects = new ArrayList<>(); if (viewable instanceof POIFSViewable) { diff --git a/src/java/org/apache/poi/poifs/eventfilesystem/POIFSReaderRegistry.java b/src/java/org/apache/poi/poifs/eventfilesystem/POIFSReaderRegistry.java index 1ea85f7c81..0a6c29bd9f 100644 --- a/src/java/org/apache/poi/poifs/eventfilesystem/POIFSReaderRegistry.java +++ b/src/java/org/apache/poi/poifs/eventfilesystem/POIFSReaderRegistry.java @@ -57,9 +57,9 @@ class POIFSReaderRegistry POIFSReaderRegistry() { - omnivorousListeners = new HashSet<POIFSReaderListener>(); - selectiveListeners = new HashMap<POIFSReaderListener, Set<DocumentDescriptor>>(); - chosenDocumentDescriptors = new HashMap<DocumentDescriptor,Set<POIFSReaderListener>>(); + omnivorousListeners = new HashSet<>(); + selectiveListeners = new HashMap<>(); + chosenDocumentDescriptors = new HashMap<>(); } /** @@ -85,7 +85,7 @@ class POIFSReaderRegistry { // this listener has not registered before - descriptors = new HashSet<DocumentDescriptor>(); + descriptors = new HashSet<>(); selectiveListeners.put(listener, descriptors); } DocumentDescriptor descriptor = new DocumentDescriptor(path, @@ -104,7 +104,7 @@ class POIFSReaderRegistry { // nobody was listening for this document before - listeners = new HashSet<POIFSReaderListener>(); + listeners = new HashSet<>(); chosenDocumentDescriptors.put(descriptor, listeners); } listeners.add(listener); @@ -143,7 +143,7 @@ class POIFSReaderRegistry Iterator<POIFSReaderListener> getListeners(final POIFSDocumentPath path, final String name) { - Set<POIFSReaderListener> rval = new HashSet<POIFSReaderListener>(omnivorousListeners); + Set<POIFSReaderListener> rval = new HashSet<>(omnivorousListeners); Set<POIFSReaderListener> selectiveListenersInner = chosenDocumentDescriptors.get(new DocumentDescriptor(path, name)); diff --git a/src/java/org/apache/poi/poifs/filesystem/DirectoryNode.java b/src/java/org/apache/poi/poifs/filesystem/DirectoryNode.java index b38881021b..9497711e70 100644 --- a/src/java/org/apache/poi/poifs/filesystem/DirectoryNode.java +++ b/src/java/org/apache/poi/poifs/filesystem/DirectoryNode.java @@ -107,8 +107,8 @@ public class DirectoryNode property.getName() }); } - _byname = new HashMap<String, Entry>(); - _entries = new ArrayList<Entry>(); + _byname = new HashMap<>(); + _entries = new ArrayList<>(); Iterator<Property> iter = property.getChildren(); while (iter.hasNext()) @@ -588,7 +588,7 @@ public class DirectoryNode */ public Iterator<Object> getViewableIterator() { - List<Object> components = new ArrayList<Object>(); + List<Object> components = new ArrayList<>(); components.add(getProperty()); Iterator<Entry> iter = _entries.iterator(); diff --git a/src/java/org/apache/poi/poifs/filesystem/DocumentNode.java b/src/java/org/apache/poi/poifs/filesystem/DocumentNode.java index fa49ae4900..19143fd745 100644 --- a/src/java/org/apache/poi/poifs/filesystem/DocumentNode.java +++ b/src/java/org/apache/poi/poifs/filesystem/DocumentNode.java @@ -131,7 +131,7 @@ public class DocumentNode public Iterator<Object> getViewableIterator() { - List<Object> components = new ArrayList<Object>(); + List<Object> components = new ArrayList<>(); components.add(getProperty()); if (_document != null) { diff --git a/src/java/org/apache/poi/poifs/filesystem/EntryUtils.java b/src/java/org/apache/poi/poifs/filesystem/EntryUtils.java index 3d9b9c6615..e2ba3dc3bd 100644 --- a/src/java/org/apache/poi/poifs/filesystem/EntryUtils.java +++ b/src/java/org/apache/poi/poifs/filesystem/EntryUtils.java @@ -153,7 +153,7 @@ public class EntryUtils } // Next, check entries and their types/sizes - Map<String,Integer> aSizes = new HashMap<String, Integer>(); + Map<String,Integer> aSizes = new HashMap<>(); final int isDirectory = -12345; for (Entry a : dirA) { String aName = a.getName(); diff --git a/src/java/org/apache/poi/poifs/filesystem/FilteringDirectoryNode.java b/src/java/org/apache/poi/poifs/filesystem/FilteringDirectoryNode.java index 3296ddb888..9d621dd8b1 100644 --- a/src/java/org/apache/poi/poifs/filesystem/FilteringDirectoryNode.java +++ b/src/java/org/apache/poi/poifs/filesystem/FilteringDirectoryNode.java @@ -64,8 +64,8 @@ public class FilteringDirectoryNode implements DirectoryEntry this.directory = directory; // Process the excludes - this.excludes = new HashSet<String>(); - this.childExcludes = new HashMap<String, List<String>>(); + this.excludes = new HashSet<>(); + this.childExcludes = new HashMap<>(); for (String excl : excludes) { int splitAt = excl.indexOf('/'); if (splitAt == -1) { @@ -76,7 +76,7 @@ public class FilteringDirectoryNode implements DirectoryEntry String child = excl.substring(0, splitAt); String childExcl = excl.substring(splitAt+1); if (! this.childExcludes.containsKey(child)) { - this.childExcludes.put(child, new ArrayList<String>()); + this.childExcludes.put(child, new ArrayList<>()); } this.childExcludes.get(child).add(childExcl); } @@ -116,7 +116,7 @@ public class FilteringDirectoryNode implements DirectoryEntry } public Set<String> getEntryNames() { - Set<String> names = new HashSet<String>(); + Set<String> names = new HashSet<>(); for (String name : directory.getEntryNames()) { if (!excludes.contains(name)) { names.add(name); diff --git a/src/java/org/apache/poi/poifs/filesystem/NPOIFSFileSystem.java b/src/java/org/apache/poi/poifs/filesystem/NPOIFSFileSystem.java index fdd8647a72..7429fb58d5 100644 --- a/src/java/org/apache/poi/poifs/filesystem/NPOIFSFileSystem.java +++ b/src/java/org/apache/poi/poifs/filesystem/NPOIFSFileSystem.java @@ -97,9 +97,9 @@ public class NPOIFSFileSystem extends BlockStore { _header = new HeaderBlock(bigBlockSize); _property_table = new NPropertyTable(_header); - _mini_store = new NPOIFSMiniStore(this, _property_table.getRoot(), new ArrayList<BATBlock>(), _header); - _xbat_blocks = new ArrayList<BATBlock>(); - _bat_blocks = new ArrayList<BATBlock>(); + _mini_store = new NPOIFSMiniStore(this, _property_table.getRoot(), new ArrayList<>(), _header); + _xbat_blocks = new ArrayList<>(); + _bat_blocks = new ArrayList<>(); _root = null; if(newFS) { @@ -426,7 +426,7 @@ public class NPOIFSFileSystem extends BlockStore // Finally read the Small Stream FAT (SBAT) blocks BATBlock sfat; - List<BATBlock> sbats = new ArrayList<BATBlock>(); + List<BATBlock> sbats = new ArrayList<>(); _mini_store = new NPOIFSMiniStore(this, _property_table.getRoot(), sbats, _header); nextAt = _header.getSBATStart(); for(int i=0; i<_header.getSBATCount() && nextAt != POIFSConstants.END_OF_CHAIN; i++) { diff --git a/src/java/org/apache/poi/poifs/filesystem/OPOIFSDocument.java b/src/java/org/apache/poi/poifs/filesystem/OPOIFSDocument.java index a7479f3194..8ad74a0163 100644 --- a/src/java/org/apache/poi/poifs/filesystem/OPOIFSDocument.java +++ b/src/java/org/apache/poi/poifs/filesystem/OPOIFSDocument.java @@ -149,7 +149,7 @@ public final class OPOIFSDocument implements BATManaged, BlockWritable, POIFSVie * @param stream the InputStream we read data from */ public OPOIFSDocument(String name, POIFSBigBlockSize bigBlockSize, InputStream stream) throws IOException { - List<DocumentBlock> blocks = new ArrayList<DocumentBlock>(); + List<DocumentBlock> blocks = new ArrayList<>(); _size = 0; _bigBigBlockSize = bigBlockSize; diff --git a/src/java/org/apache/poi/poifs/filesystem/OPOIFSFileSystem.java b/src/java/org/apache/poi/poifs/filesystem/OPOIFSFileSystem.java index 071288c2ac..925fcbaefd 100644 --- a/src/java/org/apache/poi/poifs/filesystem/OPOIFSFileSystem.java +++ b/src/java/org/apache/poi/poifs/filesystem/OPOIFSFileSystem.java @@ -88,7 +88,7 @@ public class OPOIFSFileSystem { HeaderBlock header_block = new HeaderBlock(bigBlockSize); _property_table = new PropertyTable(header_block); - _documents = new ArrayList<OPOIFSDocument>(); + _documents = new ArrayList<>(); _root = null; } @@ -309,7 +309,7 @@ public class OPOIFSFileSystem // create a list of BATManaged objects: the documents plus the // property table and the small block table - List<Object> bm_objects = new ArrayList<Object>(); + List<Object> bm_objects = new ArrayList<>(); bm_objects.addAll(_documents); bm_objects.add(_property_table); @@ -362,7 +362,7 @@ public class OPOIFSFileSystem // property table, the small block store, the small block // allocation table, the block allocation table, and the // extended block allocation table blocks) - List<Object> writers = new ArrayList<Object>(); + List<Object> writers = new ArrayList<>(); writers.add(header_block_writer); writers.addAll(_documents); diff --git a/src/java/org/apache/poi/poifs/macros/VBAMacroReader.java b/src/java/org/apache/poi/poifs/macros/VBAMacroReader.java index a0a1990895..bdcd838313 100644 --- a/src/java/org/apache/poi/poifs/macros/VBAMacroReader.java +++ b/src/java/org/apache/poi/poifs/macros/VBAMacroReader.java @@ -125,7 +125,7 @@ public class VBAMacroReader implements Closeable { final ModuleMap modules = new ModuleMap(); findMacros(fs.getRoot(), modules); - Map<String, String> moduleSources = new HashMap<String, String>(); + Map<String, String> moduleSources = new HashMap<>(); for (Map.Entry<String, Module> entry : modules.entrySet()) { Module module = entry.getValue(); if (module.buf != null && module.buf.length > 0) { // Skip empty modules diff --git a/src/java/org/apache/poi/poifs/nio/FileBackedDataSource.java b/src/java/org/apache/poi/poifs/nio/FileBackedDataSource.java index 69f3617910..88094f2e62 100644 --- a/src/java/org/apache/poi/poifs/nio/FileBackedDataSource.java +++ b/src/java/org/apache/poi/poifs/nio/FileBackedDataSource.java @@ -54,7 +54,7 @@ public class FileBackedDataSource extends DataSource { // See https://bz.apache.org/bugzilla/show_bug.cgi?id=58480, // http://stackoverflow.com/questions/3602783/file-access-synchronized-on-java-object and // http://bugs.java.com/view_bug.do?bug_id=4724038 for related discussions - private List<ByteBuffer> buffersToClean = new ArrayList<ByteBuffer>(); + private List<ByteBuffer> buffersToClean = new ArrayList<>(); public FileBackedDataSource(File file) throws FileNotFoundException { this(newSrcFile(file, "r"), true); diff --git a/src/java/org/apache/poi/poifs/property/DirectoryProperty.java b/src/java/org/apache/poi/poifs/property/DirectoryProperty.java index ef4ff3499c..12d0cc855d 100644 --- a/src/java/org/apache/poi/poifs/property/DirectoryProperty.java +++ b/src/java/org/apache/poi/poifs/property/DirectoryProperty.java @@ -46,8 +46,8 @@ public class DirectoryProperty extends Property implements Parent, Iterable<Prop public DirectoryProperty(String name) { super(); - _children = new ArrayList<Property>(); - _children_names = new HashSet<String>(); + _children = new ArrayList<>(); + _children_names = new HashSet<>(); setName(name); setSize(0); setPropertyType(PropertyConstants.DIRECTORY_TYPE); @@ -66,8 +66,8 @@ public class DirectoryProperty extends Property implements Parent, Iterable<Prop final int offset) { super(index, array, offset); - _children = new ArrayList<Property>(); - _children_names = new HashSet<String>(); + _children = new ArrayList<>(); + _children_names = new HashSet<>(); } /** diff --git a/src/java/org/apache/poi/poifs/property/NPropertyTable.java b/src/java/org/apache/poi/poifs/property/NPropertyTable.java index 12b4ffe194..fe948baf2c 100644 --- a/src/java/org/apache/poi/poifs/property/NPropertyTable.java +++ b/src/java/org/apache/poi/poifs/property/NPropertyTable.java @@ -76,7 +76,7 @@ public final class NPropertyTable extends PropertyTableBase { private static List<Property> buildProperties(final Iterator<ByteBuffer> dataSource, final POIFSBigBlockSize bigBlockSize) throws IOException { - List<Property> properties = new ArrayList<Property>(); + List<Property> properties = new ArrayList<>(); while(dataSource.hasNext()) { ByteBuffer bb = dataSource.next(); @@ -126,7 +126,7 @@ public final class NPropertyTable extends PropertyTableBase { * Prepare to be written */ public void preWrite() { - List<Property> pList = new ArrayList<Property>(); + List<Property> pList = new ArrayList<>(); // give each property its index int i=0; for (Property p : _properties) { diff --git a/src/java/org/apache/poi/poifs/property/PropertyFactory.java b/src/java/org/apache/poi/poifs/property/PropertyFactory.java index df3dcba294..1fdf924682 100644 --- a/src/java/org/apache/poi/poifs/property/PropertyFactory.java +++ b/src/java/org/apache/poi/poifs/property/PropertyFactory.java @@ -57,7 +57,7 @@ class PropertyFactory { static List<Property> convertToProperties(ListManagedBlock [] blocks) throws IOException { - List<Property> properties = new ArrayList<Property>(); + List<Property> properties = new ArrayList<>(); for (ListManagedBlock block : blocks) { byte[] data = block.getData(); diff --git a/src/java/org/apache/poi/poifs/property/PropertyTableBase.java b/src/java/org/apache/poi/poifs/property/PropertyTableBase.java index 82f57bf724..a4ed5ace90 100644 --- a/src/java/org/apache/poi/poifs/property/PropertyTableBase.java +++ b/src/java/org/apache/poi/poifs/property/PropertyTableBase.java @@ -44,7 +44,7 @@ public abstract class PropertyTableBase implements BATManaged { public PropertyTableBase(final HeaderBlock header_block) { _header_block = header_block; - _properties = new ArrayList<Property>(); + _properties = new ArrayList<>(); addProperty(new RootProperty()); } @@ -110,7 +110,7 @@ public abstract class PropertyTableBase implements BATManaged { // property has no children return; } - Stack<Property> children = new Stack<Property>(); + Stack<Property> children = new Stack<>(); children.push(_properties.get(index)); while (!children.empty()) diff --git a/src/java/org/apache/poi/poifs/storage/BlockAllocationTableReader.java b/src/java/org/apache/poi/poifs/storage/BlockAllocationTableReader.java index b96ec20886..50341b33c8 100644 --- a/src/java/org/apache/poi/poifs/storage/BlockAllocationTableReader.java +++ b/src/java/org/apache/poi/poifs/storage/BlockAllocationTableReader.java @@ -206,7 +206,7 @@ public final class BlockAllocationTableReader { */ ListManagedBlock[] fetchBlocks(int startBlock, int headerPropertiesStartBlock, BlockList blockList) throws IOException { - List<ListManagedBlock> blocks = new ArrayList<ListManagedBlock>(); + List<ListManagedBlock> blocks = new ArrayList<>(); int currentBlock = startBlock; boolean firstPass = true; ListManagedBlock dataBlock = null; diff --git a/src/java/org/apache/poi/poifs/storage/RawDataBlockList.java b/src/java/org/apache/poi/poifs/storage/RawDataBlockList.java index eb8bcc085c..fd468b6486 100644 --- a/src/java/org/apache/poi/poifs/storage/RawDataBlockList.java +++ b/src/java/org/apache/poi/poifs/storage/RawDataBlockList.java @@ -48,7 +48,7 @@ public class RawDataBlockList public RawDataBlockList(final InputStream stream, POIFSBigBlockSize bigBlockSize) throws IOException { - List<RawDataBlock> blocks = new ArrayList<RawDataBlock>(); + List<RawDataBlock> blocks = new ArrayList<>(); while (true) { diff --git a/src/java/org/apache/poi/poifs/storage/SmallBlockTableWriter.java b/src/java/org/apache/poi/poifs/storage/SmallBlockTableWriter.java index 9c98bb4595..3d2b16fe5b 100644 --- a/src/java/org/apache/poi/poifs/storage/SmallBlockTableWriter.java +++ b/src/java/org/apache/poi/poifs/storage/SmallBlockTableWriter.java @@ -55,7 +55,7 @@ public class SmallBlockTableWriter final RootProperty root) { _sbat = new BlockAllocationTableWriter(bigBlockSize); - _small_blocks = new ArrayList<SmallDocumentBlock>(); + _small_blocks = new ArrayList<>(); _root = root; for (OPOIFSDocument doc : documents) diff --git a/src/java/org/apache/poi/poifs/storage/SmallDocumentBlock.java b/src/java/org/apache/poi/poifs/storage/SmallDocumentBlock.java index d09bf9ecf5..711a2d56a3 100644 --- a/src/java/org/apache/poi/poifs/storage/SmallDocumentBlock.java +++ b/src/java/org/apache/poi/poifs/storage/SmallDocumentBlock.java @@ -171,7 +171,7 @@ public final class SmallDocumentBlock implements BlockWritable, ListManagedBlock { int _blocks_per_big_block = getBlocksPerBigBlock(bigBlockSize); - List<SmallDocumentBlock> sdbs = new ArrayList<SmallDocumentBlock>(); + List<SmallDocumentBlock> sdbs = new ArrayList<>(); for (int j = 0; j < blocks.length; j++) { |