Author: centic
Date: Wed Oct 19 06:52:44 2016
New Revision: 1765538
URL: http://svn.apache.org/viewvc?rev=1765538&view=rev
Log:
Fix some IDE warnings/javadoc/...
Modified:
poi/trunk/src/java/org/apache/poi/poifs/macros/VBAMacroReader.java
poi/trunk/src/java/org/apache/poi/poifs/property/Child.java
poi/trunk/src/java/org/apache/poi/poifs/property/DocumentProperty.java
poi/trunk/src/java/org/apache/poi/poifs/property/NPropertyTable.java
poi/trunk/src/java/org/apache/poi/poifs/property/Parent.java
poi/trunk/src/java/org/apache/poi/poifs/property/Property.java
poi/trunk/src/java/org/apache/poi/poifs/property/PropertyConstants.java
poi/trunk/src/java/org/apache/poi/poifs/property/PropertyFactory.java
poi/trunk/src/java/org/apache/poi/poifs/property/PropertyTable.java
Modified: poi/trunk/src/java/org/apache/poi/poifs/macros/VBAMacroReader.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/poifs/macros/VBAMacroReader.java?rev=1765538&r1=1765537&r2=1765538&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/poifs/macros/VBAMacroReader.java
(original)
+++ poi/trunk/src/java/org/apache/poi/poifs/macros/VBAMacroReader.java Wed Oct
19 06:52:44 2016
@@ -147,9 +147,9 @@ public class VBAMacroReader implements C
* For each macro module that is found, the module's name and code are
* added to <tt>modules<tt>.
*
- * @param dir
- * @param modules
- * @throws IOException
+ * @param dir The directory of entries to look at
+ * @param modules The resulting map of modules
+ * @throws IOException If reading the VBA module fails
* @since 3.15-beta2
*/
protected void findMacros(DirectoryNode dir, ModuleMap modules) throws
IOException {
@@ -173,7 +173,7 @@ public class VBAMacroReader implements C
* @param length number of bytes to read from stream
* @param charset the character set encoding of the bytes in the stream
* @return a java String in the supplied character set
- * @throws IOException
+ * @throws IOException If reading from the stream fails
*/
private static String readString(InputStream stream, int length, Charset
charset) throws IOException {
byte[] buffer = new byte[length];
@@ -191,7 +191,7 @@ public class VBAMacroReader implements C
* @param in the run-length encoded input stream to read from
* @param streamName the stream name of the module
* @param modules a map to store the modules
- * @throws IOException
+ * @throws IOException If reading data from the stream or from modules
fails
*/
private static void readModule(RLEDecompressingInputStream in, String
streamName, ModuleMap modules) throws IOException {
int moduleOffset = in.readInt();
@@ -240,7 +240,7 @@ public class VBAMacroReader implements C
/**
* Skips <tt>n</tt> bytes in an input stream, throwing IOException if the
* number of bytes skipped is different than requested.
- * @throws IOException
+ * @throws IOException If skipping would exceed the available data or
skipping did not work.
*/
private static void trySkip(InputStream in, long n) throws IOException {
long skippedBytes = in.skip(n);
@@ -260,16 +260,23 @@ public class VBAMacroReader implements C
// Constants from MS-OVBA:
https://msdn.microsoft.com/en-us/library/office/cc313094(v=office.12).aspx
private static final int EOF = -1;
private static final int VERSION_INDEPENDENT_TERMINATOR = 0x0010;
+ @SuppressWarnings("unused")
private static final int VERSION_DEPENDENT_TERMINATOR = 0x002B;
private static final int PROJECTVERSION = 0x0009;
private static final int PROJECTCODEPAGE = 0x0003;
private static final int STREAMNAME = 0x001A;
private static final int MODULEOFFSET = 0x0031;
+ @SuppressWarnings("unused")
private static final int MODULETYPE_PROCEDURAL = 0x0021;
+ @SuppressWarnings("unused")
private static final int MODULETYPE_DOCUMENT_CLASS_OR_DESIGNER = 0x0022;
+ @SuppressWarnings("unused")
private static final int PROJECTLCID = 0x0002;
+ @SuppressWarnings("unused")
private static final int MODULE_NAME = 0x0019;
+ @SuppressWarnings("unused")
private static final int MODULE_NAME_UNICODE = 0x0047;
+ @SuppressWarnings("unused")
private static final int MODULE_DOC_STRING = 0x001c;
private static final int STREAMNAME_RESERVED = 0x0032;
@@ -291,7 +298,6 @@ public class VBAMacroReader implements C
// process DIR
RLEDecompressingInputStream in = new
RLEDecompressingInputStream(dis);
String streamName = null;
- String streamNameUnicode = null;
int recordId = 0;
try {
while (true) {
@@ -317,8 +323,8 @@ public class VBAMacroReader implements C
Integer.toHexString(reserved));
}
int unicodeNameRecordLength = in.readInt();
- streamNameUnicode = readUnicodeString(in,
unicodeNameRecordLength);
- //do something with this at some point
+ readUnicodeString(in, unicodeNameRecordLength);
+ // do something with this at some point
break;
case MODULEOFFSET:
readModule(in, streamName, modules);
Modified: poi/trunk/src/java/org/apache/poi/poifs/property/Child.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/poifs/property/Child.java?rev=1765538&r1=1765537&r2=1765538&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/poifs/property/Child.java (original)
+++ poi/trunk/src/java/org/apache/poi/poifs/property/Child.java Wed Oct 19
06:52:44 2016
@@ -26,9 +26,7 @@ package org.apache.poi.poifs.property;
* @author Marc Johnson (mjohnson at apache dot org)
*/
-public interface Child
-{
-
+public interface Child {
/**
* Get the next Child, if any
*
@@ -62,5 +60,4 @@ public interface Child
*/
public void setPreviousChild(final Child child);
-} // end public interface Child
-
+}
Modified: poi/trunk/src/java/org/apache/poi/poifs/property/DocumentProperty.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/poifs/property/DocumentProperty.java?rev=1765538&r1=1765537&r2=1765538&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/poifs/property/DocumentProperty.java
(original)
+++ poi/trunk/src/java/org/apache/poi/poifs/property/DocumentProperty.java Wed
Oct 19 06:52:44 2016
@@ -24,11 +24,7 @@ import org.apache.poi.poifs.filesystem.O
/**
* Trivial extension of Property for POIFSDocuments
*/
-
-public class DocumentProperty
- extends Property
-{
-
+public class DocumentProperty extends Property {
// the POIFSDocument this property is associated with
private OPOIFSDocument _document;
@@ -56,7 +52,6 @@ public class DocumentProperty
* @param array byte data
* @param offset offset into byte data
*/
-
protected DocumentProperty(final int index, final byte [] array,
final int offset)
{
@@ -69,7 +64,6 @@ public class DocumentProperty
*
* @param doc the associated POIFSDocument
*/
-
public void setDocument(OPOIFSDocument doc)
{
_document = doc;
@@ -80,7 +74,6 @@ public class DocumentProperty
*
* @return the associated document
*/
-
public OPOIFSDocument getDocument()
{
return _document;
@@ -93,7 +86,6 @@ public class DocumentProperty
*
* @return true if this property should use small blocks
*/
-
public boolean shouldUseSmallBlocks()
{
return super.shouldUseSmallBlocks();
@@ -102,7 +94,6 @@ public class DocumentProperty
/**
* @return true if a directory type Property
*/
-
public boolean isDirectory()
{
return false;
@@ -112,7 +103,6 @@ public class DocumentProperty
* Perform whatever activities need to be performed prior to
* writing
*/
-
protected void preWrite()
{
@@ -128,5 +118,4 @@ public class DocumentProperty
}
/* ********** END extension of Property ********** */
-} // end public class DocumentProperty
-
+}
Modified: poi/trunk/src/java/org/apache/poi/poifs/property/NPropertyTable.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/poifs/property/NPropertyTable.java?rev=1765538&r1=1765537&r2=1765538&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/poifs/property/NPropertyTable.java
(original)
+++ poi/trunk/src/java/org/apache/poi/poifs/property/NPropertyTable.java Wed
Oct 19 06:52:44 2016
@@ -73,12 +73,6 @@ public final class NPropertyTable extend
_bigBigBlockSize = headerBlock.getBigBlockSize();
}
- /**
- * Builds
- * @param startAt
- * @param filesystem
- * @throws IOException
- */
private static List<Property> buildProperties(final Iterator<ByteBuffer>
dataSource,
final POIFSBigBlockSize bigBlockSize) throws IOException
{
Modified: poi/trunk/src/java/org/apache/poi/poifs/property/Parent.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/poifs/property/Parent.java?rev=1765538&r1=1765537&r2=1765538&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/poifs/property/Parent.java (original)
+++ poi/trunk/src/java/org/apache/poi/poifs/property/Parent.java Wed Oct 19
06:52:44 2016
@@ -1,4 +1,3 @@
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -15,7 +14,6 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
package org.apache.poi.poifs.property;
@@ -28,7 +26,6 @@ import java.io.IOException;
*
* @author Marc [email protected]
*/
-
public interface Parent
extends Child
{
@@ -71,8 +68,4 @@ public interface Parent
*/
public void setNextChild(final Child child);
-
- /** *** end methods from interface Child *** */
-
-} // end public interface Parent
-
+}
Modified: poi/trunk/src/java/org/apache/poi/poifs/property/Property.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/poifs/property/Property.java?rev=1765538&r1=1765537&r2=1765538&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/poifs/property/Property.java (original)
+++ poi/trunk/src/java/org/apache/poi/poifs/property/Property.java Wed Oct 19
06:52:44 2016
@@ -1,4 +1,3 @@
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
@@ -16,7 +15,6 @@
limitations under the License.
==================================================================== */
-
package org.apache.poi.poifs.property;
import java.io.IOException;
@@ -522,11 +520,7 @@ public abstract class Property implement
*
* @return short description
*/
- public String getShortDescription()
- {
- StringBuffer buffer = new StringBuffer();
-
- buffer.append("Property: \"").append(getName()).append("\"");
- return buffer.toString();
+ public String getShortDescription() {
+ return "Property: \"" + getName() + "\"";
}
}
Modified:
poi/trunk/src/java/org/apache/poi/poifs/property/PropertyConstants.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/poifs/property/PropertyConstants.java?rev=1765538&r1=1765537&r2=1765538&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/poifs/property/PropertyConstants.java
(original)
+++ poi/trunk/src/java/org/apache/poi/poifs/property/PropertyConstants.java Wed
Oct 19 06:52:44 2016
@@ -31,5 +31,4 @@ public interface PropertyConstants
public static final byte DIRECTORY_TYPE = 1;
public static final byte DOCUMENT_TYPE = 2;
public static final byte ROOT_TYPE = 5;
-} // end public interface PropertyConstants
-
+}
Modified: poi/trunk/src/java/org/apache/poi/poifs/property/PropertyFactory.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/poifs/property/PropertyFactory.java?rev=1765538&r1=1765537&r2=1765538&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/poifs/property/PropertyFactory.java
(original)
+++ poi/trunk/src/java/org/apache/poi/poifs/property/PropertyFactory.java Wed
Oct 19 06:52:44 2016
@@ -38,8 +38,7 @@ import org.apache.poi.poifs.storage.List
* @author Marc Johnson (mjohnson at apache dot org)
*/
-class PropertyFactory
-{
+class PropertyFactory {
// no need for an accessible constructor
private PropertyFactory()
{
@@ -60,8 +59,8 @@ class PropertyFactory
{
List<Property> properties = new ArrayList<Property>();
- for (int j = 0; j < blocks.length; j++) {
- byte[] data = blocks[ j ].getData();
+ for (ListManagedBlock block : blocks) {
+ byte[] data = block.getData();
convertToProperties(data, properties);
}
return properties;
@@ -101,6 +100,4 @@ class PropertyFactory
offset += POIFSConstants.PROPERTY_SIZE;
}
}
-
-} // end package scope class PropertyFactory
-
+}
Modified: poi/trunk/src/java/org/apache/poi/poifs/property/PropertyTable.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/poifs/property/PropertyTable.java?rev=1765538&r1=1765537&r2=1765538&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/poifs/property/PropertyTable.java
(original)
+++ poi/trunk/src/java/org/apache/poi/poifs/property/PropertyTable.java Wed Oct
19 06:52:44 2016
@@ -86,9 +86,8 @@ public final class PropertyTable extends
_blocks = PropertyBlock.createPropertyBlockArray(_bigBigBlockSize,
_properties);
// prepare each property for writing
- for (int k = 0; k < properties.length; k++)
- {
- properties[ k ].preWrite();
+ for (Property property : properties) {
+ property.preWrite();
}
}
@@ -117,9 +116,8 @@ public final class PropertyTable extends
{
if (_blocks != null)
{
- for (int j = 0; j < _blocks.length; j++)
- {
- _blocks[ j ].writeBlocks(stream);
+ for (BlockWritable _block : _blocks) {
+ _block.writeBlocks(stream);
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]