You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ki...@apache.org on 2021/04/14 22:53:38 UTC
svn commit: r1888780 [7/13] - in /poi/trunk:
poi-examples/src/main/java/org/apache/poi/examples/hslf/
poi-examples/src/main/java/org/apache/poi/examples/hssf/eventusermodel/
poi-examples/src/main/java/org/apache/poi/examples/hssf/usermodel/
poi-example...
Modified: poi/trunk/poi/src/main/java/org/apache/poi/hssf/record/aggregates/WorksheetProtectionBlock.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/hssf/record/aggregates/WorksheetProtectionBlock.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/hssf/record/aggregates/WorksheetProtectionBlock.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/hssf/record/aggregates/WorksheetProtectionBlock.java Wed Apr 14 22:53:33 2021
@@ -21,7 +21,6 @@ import org.apache.poi.hssf.model.RecordS
import org.apache.poi.hssf.record.ObjectProtectRecord;
import org.apache.poi.hssf.record.PasswordRecord;
import org.apache.poi.hssf.record.ProtectRecord;
-import org.apache.poi.hssf.record.Record;
import org.apache.poi.hssf.record.ScenarioProtectRecord;
import org.apache.poi.poifs.crypt.CryptoFunctions;
import org.apache.poi.util.RecordFormatException;
@@ -32,8 +31,6 @@ import org.apache.poi.util.RecordFormatE
*
* See OOO excelfileformat.pdf sec 4.18.2 'Sheet Protection in a Workbook
* (BIFF5-BIFF8)'
- *
- * @author Josh Micich
*/
public final class WorksheetProtectionBlock extends RecordAggregate {
// Every one of these component records is optional
@@ -51,7 +48,7 @@ public final class WorksheetProtectionBl
}
/**
- * @return <code>true</code> if the specified Record sid is one belonging to
+ * @return {@code true} if the specified Record sid is one belonging to
* the 'Page Settings Block'.
*/
public static boolean isComponentRecord(int sid) {
@@ -97,7 +94,8 @@ public final class WorksheetProtectionBl
}
}
- public void visitContainedRecords(RecordVisitor rv) {
+ @Override
+ public void visitContainedRecords(RecordVisitor rv) {
// Replicates record order from Excel 2007, though this is not critical
visitIfPresent(_protectRecord, rv);
@@ -121,7 +119,7 @@ public final class WorksheetProtectionBl
}
/**
- * This method reads {@link WorksheetProtectionBlock} records from the supplied RecordStream
+ * This method reads WorksheetProtectionBlock records from the supplied RecordStream
* until the first non-WorksheetProtectionBlock record is encountered. As each record is read,
* it is incorporated into this WorksheetProtectionBlock.
* <p>
@@ -170,7 +168,7 @@ public final class WorksheetProtectionBl
* protect a spreadsheet with a password (not encrypted, just sets protect
* flags and the password.
*
- * @param password to set. Pass <code>null</code> to remove all protection
+ * @param password to set. Pass {@code null} to remove all protection
* @param shouldProtectObjects are protected
* @param shouldProtectScenarios are protected
*/
Modified: poi/trunk/poi/src/main/java/org/apache/poi/hssf/record/cont/ContinuableRecordOutput.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/hssf/record/cont/ContinuableRecordOutput.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/hssf/record/cont/ContinuableRecordOutput.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/hssf/record/cont/ContinuableRecordOutput.java Wed Apr 14 22:53:33 2021
@@ -92,7 +92,7 @@ public final class ContinuableRecordOutp
* Notes:
* <ul>
* <li>The value of the 'is16bitEncoded' flag is determined by the actual character data
- * of <tt>text</tt></li>
+ * of {@code text}</li>
* <li>The string options flag is never separated (by a {@link ContinueRecord}) from the
* first chunk of character data it refers to.</li>
* <li>The 'ushort length' field is assumed to have been explicitly written earlier. Hence,
@@ -132,7 +132,7 @@ public final class ContinuableRecordOutp
* Notes:
* <ul>
* <li>The value of the 'is16bitEncoded' flag is determined by the actual character data
- * of <tt>text</tt></li>
+ * of {@code text}</li>
* <li>The string header fields are never separated (by a {@link ContinueRecord}) from the
* first chunk of character data (i.e. the first character is always encoded in the same
* record as the string header).</li>
@@ -185,7 +185,7 @@ public final class ContinuableRecordOutp
}
} else {
while(true) {
- int nWritableChars = Math.min(nChars-i, _ulrOutput.getAvailableSpace() / 1);
+ int nWritableChars = Math.min(nChars-i, _ulrOutput.getAvailableSpace());
for ( ; nWritableChars > 0; nWritableChars--) {
_ulrOutput.writeByte(text.charAt(i++));
}
@@ -198,16 +198,18 @@ public final class ContinuableRecordOutp
}
}
+ @Override
public void write(byte[] b) {
writeContinueIfRequired(b.length);
_ulrOutput.write(b);
}
+ @Override
public void write(byte[] b, int offset, int len) {
int i=0;
while(true) {
- int nWritableChars = Math.min(len - i, _ulrOutput.getAvailableSpace() / 1);
+ int nWritableChars = Math.min(len - i, _ulrOutput.getAvailableSpace());
for ( ; nWritableChars > 0; nWritableChars--) {
_ulrOutput.writeByte(b[offset + i++]);
}
@@ -218,22 +220,27 @@ public final class ContinuableRecordOutp
}
}
+ @Override
public void writeByte(int v) {
writeContinueIfRequired(1);
_ulrOutput.writeByte(v);
}
+ @Override
public void writeDouble(double v) {
writeContinueIfRequired(8);
_ulrOutput.writeDouble(v);
}
+ @Override
public void writeInt(int v) {
writeContinueIfRequired(4);
_ulrOutput.writeInt(v);
}
+ @Override
public void writeLong(long v) {
writeContinueIfRequired(8);
_ulrOutput.writeLong(v);
}
+ @Override
public void writeShort(int v) {
writeContinueIfRequired(2);
_ulrOutput.writeShort(v);
@@ -244,27 +251,35 @@ public final class ContinuableRecordOutp
*/
private static final LittleEndianOutput NOPOutput = new DelayableLittleEndianOutput() {
+ @Override
public LittleEndianOutput createDelayedOutput(int size) {
return this;
}
+ @Override
public void write(byte[] b) {
// does nothing
}
+ @Override
public void write(byte[] b, int offset, int len) {
// does nothing
}
+ @Override
public void writeByte(int v) {
// does nothing
}
+ @Override
public void writeDouble(double v) {
// does nothing
}
+ @Override
public void writeInt(int v) {
// does nothing
}
+ @Override
public void writeLong(long v) {
// does nothing
}
+ @Override
public void writeShort(int v) {
// does nothing
}
Modified: poi/trunk/poi/src/main/java/org/apache/poi/hssf/record/crypto/Biff8DecryptingStream.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/hssf/record/crypto/Biff8DecryptingStream.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/hssf/record/crypto/Biff8DecryptingStream.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/hssf/record/crypto/Biff8DecryptingStream.java Wed Apr 14 22:53:33 2021
@@ -40,7 +40,7 @@ public final class Biff8DecryptingStream
//arbitrarily selected; may need to increase
private static final int MAX_RECORD_LENGTH = 100_000;
- private ChunkedCipherInputStream ccis;
+ private final ChunkedCipherInputStream ccis;
private final byte[] buffer = new byte[LittleEndianConsts.LONG_SIZE];
private boolean shouldSkipEncryptionOnCurrentRecord;
@@ -58,7 +58,7 @@ public final class Biff8DecryptingStream
Decryptor dec = info.getDecryptor();
dec.setChunkSize(RC4_REKEYING_INTERVAL);
ccis = (ChunkedCipherInputStream)dec.getDataStream(stream, Integer.MAX_VALUE, 0);
-
+
if (initialOffset > 0) {
ccis.readFully(initialBuf);
}
@@ -124,7 +124,7 @@ public final class Biff8DecryptingStream
public int readUByte() {
return readByte() & 0xFF;
}
-
+
@Override
public byte readByte() {
if (shouldSkipEncryptionOnCurrentRecord) {
@@ -139,7 +139,7 @@ public final class Biff8DecryptingStream
public int readUShort() {
return readShort() & 0xFFFF;
}
-
+
@Override
public short readShort() {
if (shouldSkipEncryptionOnCurrentRecord) {
@@ -176,11 +176,11 @@ public final class Biff8DecryptingStream
public long getPosition() {
return ccis.getPos();
}
-
+
/**
* TODO: Additionally, the lbPlyPos (position_of_BOF) field of the BoundSheet8 record MUST NOT be encrypted.
*
- * @return <code>true</code> if record type specified by <tt>sid</tt> is never encrypted
+ * @return {@code true} if record type specified by {@code sid} is never encrypted
*/
public static boolean isNeverEncryptedRecord(int sid) {
switch (sid) {
Modified: poi/trunk/poi/src/main/java/org/apache/poi/hssf/record/pivottable/ViewFieldsRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/hssf/record/pivottable/ViewFieldsRecord.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/hssf/record/pivottable/ViewFieldsRecord.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/hssf/record/pivottable/ViewFieldsRecord.java Wed Apr 14 22:53:33 2021
@@ -33,15 +33,15 @@ import org.apache.poi.util.StringUtil;
public final class ViewFieldsRecord extends StandardRecord {
public static final short sid = 0x00B1;
- /** the value of the <tt>cchName</tt> field when the {@link #_name} is not present */
+ /** the value of the {@code cchName} field when the {@link #_name} is not present */
private static final int STRING_NOT_PRESENT_LEN = 0xFFFF;
/** 5 shorts */
private static final int BASE_SIZE = 10;
- private int _sxaxis;
- private int _cSub;
- private int _grbitSub;
- private int _cItm;
+ private final int _sxaxis;
+ private final int _cSub;
+ private final int _grbitSub;
+ private final int _cItm;
private String _name;
@@ -54,7 +54,7 @@ public final class ViewFieldsRecord exte
COLUMN(2),
PAGE(4),
DATA(8);
- int id;
+ final int id;
Axis(int id) {
this.id = id;
}
Modified: poi/trunk/poi/src/main/java/org/apache/poi/hssf/usermodel/DVConstraint.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/hssf/usermodel/DVConstraint.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/hssf/usermodel/DVConstraint.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/hssf/usermodel/DVConstraint.java Wed Apr 14 22:53:33 2021
@@ -53,19 +53,19 @@ public class DVConstraint implements Dat
public Ptg[] getFormula2() {
return _formula2;
}
-
+
}
-
+
private final int _validationType;
private int _operator;
private String[] _explicitListValues;
-
+
private String _formula1;
private String _formula2;
private Double _value1;
private Double _value2;
-
+
private DVConstraint(int validationType, int comparisonOperator, String formulaA,
String formulaB, Double value1, Double value2, String[] explicitListValues) {
_validationType = validationType;
@@ -76,8 +76,8 @@ public class DVConstraint implements Dat
_value2 = value2;
_explicitListValues = (explicitListValues == null) ? null : explicitListValues.clone();
}
-
-
+
+
/**
* Creates a list constraint
*/
@@ -88,9 +88,9 @@ public class DVConstraint implements Dat
/**
* Creates a number based data validation constraint. The text values entered for expr1 and expr2
- * can be either standard Excel formulas or formatted number values. If the expression starts
- * with '=' it is parsed as a formula, otherwise it is parsed as a formatted number.
- *
+ * can be either standard Excel formulas or formatted number values. If the expression starts
+ * with '=' it is parsed as a formula, otherwise it is parsed as a formatted number.
+ *
* @param validationType one of {@link org.apache.poi.ss.usermodel.DataValidationConstraint.ValidationType#ANY},
* {@link org.apache.poi.ss.usermodel.DataValidationConstraint.ValidationType#DECIMAL},
* {@link org.apache.poi.ss.usermodel.DataValidationConstraint.ValidationType#INTEGER},
@@ -99,7 +99,7 @@ public class DVConstraint implements Dat
* @param expr1 date formula (when first char is '=') or formatted number value
* @param expr2 date formula (when first char is '=') or formatted number value
*/
- public static DVConstraint createNumericConstraint(int validationType, int comparisonOperator,
+ public static DVConstraint createNumericConstraint(int validationType, int comparisonOperator,
String expr1, String expr2) {
switch (validationType) {
case ValidationType.ANY:
@@ -134,15 +134,15 @@ public class DVConstraint implements Dat
public static DVConstraint createExplicitListConstraint(String[] explicitListValues) {
return new DVConstraint(null, explicitListValues);
}
-
-
+
+
/**
* Creates a time based data validation constraint. The text values entered for expr1 and expr2
- * can be either standard Excel formulas or formatted time values. If the expression starts
- * with '=' it is parsed as a formula, otherwise it is parsed as a formatted time. To parse
- * formatted times, two formats are supported: "HH:MM" or "HH:MM:SS". This is contrary to
+ * can be either standard Excel formulas or formatted time values. If the expression starts
+ * with '=' it is parsed as a formula, otherwise it is parsed as a formatted time. To parse
+ * formatted times, two formats are supported: "HH:MM" or "HH:MM:SS". This is contrary to
* Excel which uses the default time format from the OS.
- *
+ *
* @param comparisonOperator constant from {@link org.apache.poi.ss.usermodel.DataValidationConstraint.OperatorType} enum
* @param expr1 date formula (when first char is '=') or formatted time value
* @param expr2 date formula (when first char is '=') or formatted time value
@@ -152,7 +152,7 @@ public class DVConstraint implements Dat
throw new IllegalArgumentException("expr1 must be supplied");
}
OperatorType.validateSecondArg(comparisonOperator, expr1);
-
+
// formula1 and value1 are mutually exclusive
String formula1 = getFormulaFromTextExpression(expr1);
Double value1 = formula1 == null ? convertTime(expr1) : null;
@@ -161,19 +161,19 @@ public class DVConstraint implements Dat
Double value2 = formula2 == null ? convertTime(expr2) : null;
return new DVConstraint(ValidationType.TIME, comparisonOperator, formula1, formula2, value1, value2, null);
}
-
+
/**
* Creates a date based data validation constraint. The text values entered for expr1 and expr2
- * can be either standard Excel formulas or formatted date values. If the expression starts
- * with '=' it is parsed as a formula, otherwise it is parsed as a formatted date (Excel uses
+ * can be either standard Excel formulas or formatted date values. If the expression starts
+ * with '=' it is parsed as a formula, otherwise it is parsed as a formatted date (Excel uses
* the same convention). To parse formatted dates, a date format needs to be specified. This
* is contrary to Excel which uses the default short date format from the OS.
- *
+ *
* @param comparisonOperator constant from {@link org.apache.poi.ss.usermodel.DataValidationConstraint.OperatorType} enum
* @param expr1 date formula (when first char is '=') or formatted date value
* @param expr2 date formula (when first char is '=') or formatted date value
* @param dateFormat ignored if both expr1 and expr2 are formulas. Default value is "YYYY/MM/DD"
- * otherwise any other valid argument for <tt>SimpleDateFormat</tt> can be used
+ * otherwise any other valid argument for {@code SimpleDateFormat} can be used
* @see <a href='http://java.sun.com/j2se/1.5.0/docs/api/java/text/DateFormat.html'>SimpleDateFormat</a>
*/
public static DVConstraint createDateConstraint(int comparisonOperator, String expr1, String expr2, String dateFormat) {
@@ -186,7 +186,7 @@ public class DVConstraint implements Dat
df = new SimpleDateFormat(dateFormat, LocaleUtil.getUserLocale());
df.setTimeZone(LocaleUtil.getUserTimeZone());
}
-
+
// formula1 and value1 are mutually exclusive
String formula1 = getFormulaFromTextExpression(expr1);
Double value1 = formula1 == null ? convertDate(expr1, df) : null;
@@ -195,17 +195,17 @@ public class DVConstraint implements Dat
Double value2 = formula2 == null ? convertDate(expr2, df) : null;
return new DVConstraint(ValidationType.DATE, comparisonOperator, formula1, formula2, value1, value2, null);
}
-
+
/**
- * Distinguishes formula expressions from simple value expressions. This logic is only
+ * Distinguishes formula expressions from simple value expressions. This logic is only
* required by a few factory methods in this class that create data validation constraints
* from more or less the same parameters that would have been entered in the Excel UI. The
* data validation dialog box uses the convention that formulas begin with '='. Other methods
- * in this class follow the POI convention (formulas and values are distinct), so the '='
+ * in this class follow the POI convention (formulas and values are distinct), so the '='
* convention is not used there.
- *
+ *
* @param textExpr a formula or value expression
- * @return all text after '=' if textExpr begins with '='. Otherwise <code>null</code> if textExpr does not begin with '='
+ * @return all text after '=' if textExpr begins with '='. Otherwise {@code null} if textExpr does not begin with '='
*/
private static String getFormulaFromTextExpression(String textExpr) {
if (textExpr == null) {
@@ -222,7 +222,7 @@ public class DVConstraint implements Dat
/**
- * @return <code>null</code> if numberStr is <code>null</code>
+ * @return {@code null} if numberStr is {@code null}
*/
private static Double convertNumber(String numberStr) {
if (numberStr == null) {
@@ -231,40 +231,40 @@ public class DVConstraint implements Dat
try {
return Double.valueOf(numberStr);
} catch (NumberFormatException e) {
- throw new RuntimeException("The supplied text '" + numberStr
+ throw new RuntimeException("The supplied text '" + numberStr
+ "' could not be parsed as a number");
}
}
/**
- * @return <code>null</code> if timeStr is <code>null</code>
+ * @return {@code null} if timeStr is {@code null}
*/
private static Double convertTime(String timeStr) {
if (timeStr == null) {
return null;
}
- return Double.valueOf(DateUtil.convertTime(timeStr));
+ return DateUtil.convertTime(timeStr);
}
/**
- * @param dateFormat pass <code>null</code> for default YYYYMMDD
- * @return <code>null</code> if timeStr is <code>null</code>
+ * @param dateFormat pass {@code null} for default YYYYMMDD
+ * @return {@code null} if timeStr is {@code null}
*/
private static Double convertDate(String dateStr, SimpleDateFormat dateFormat) {
if (dateStr == null) {
return null;
}
- Date dateVal;
+ Date dateVal;
if (dateFormat == null) {
dateVal = DateUtil.parseYYYYMMDDDate(dateStr);
} else {
try {
dateVal = dateFormat.parse(dateStr);
} catch (ParseException e) {
- throw new RuntimeException("Failed to parse date '" + dateStr
+ throw new RuntimeException("Failed to parse date '" + dateStr
+ "' using specified format '" + dateFormat + "'", e);
}
}
- return Double.valueOf(DateUtil.getExcelDate(dateVal));
+ return DateUtil.getExcelDate(dateVal);
}
public static DVConstraint createCustomFormulaConstraint(String formula) {
@@ -273,23 +273,24 @@ public class DVConstraint implements Dat
}
return new DVConstraint(ValidationType.FORMULA, OperatorType.IGNORED, formula, null, null, null, null);
}
-
+
/* (non-Javadoc)
* @see org.apache.poi.hssf.usermodel.DataValidationConstraint#getValidationType()
*/
+ @Override
public int getValidationType() {
return _validationType;
}
/**
* Convenience method
- * @return <code>true</code> if this constraint is a 'list' validation
+ * @return {@code true} if this constraint is a 'list' validation
*/
public boolean isListValidationType() {
return _validationType == ValidationType.LIST;
}
/**
* Convenience method
- * @return <code>true</code> if this constraint is a 'list' validation with explicit values
+ * @return {@code true} if this constraint is a 'list' validation with explicit values
*/
public boolean isExplicitList() {
return _validationType == ValidationType.LIST && _explicitListValues != null;
@@ -297,25 +298,29 @@ public class DVConstraint implements Dat
/* (non-Javadoc)
* @see org.apache.poi.hssf.usermodel.DataValidationConstraint#getOperator()
*/
+ @Override
public int getOperator() {
return _operator;
}
/* (non-Javadoc)
* @see org.apache.poi.hssf.usermodel.DataValidationConstraint#setOperator(int)
*/
+ @Override
public void setOperator(int operator) {
_operator = operator;
}
-
+
/* (non-Javadoc)
* @see org.apache.poi.hssf.usermodel.DataValidationConstraint#getExplicitListValues()
*/
+ @Override
public String[] getExplicitListValues() {
return _explicitListValues;
}
/* (non-Javadoc)
* @see org.apache.poi.hssf.usermodel.DataValidationConstraint#setExplicitListValues(java.lang.String[])
*/
+ @Override
public void setExplicitListValues(String[] explicitListValues) {
if (_validationType != ValidationType.LIST) {
throw new RuntimeException("Cannot setExplicitListValues on non-list constraint");
@@ -327,12 +332,14 @@ public class DVConstraint implements Dat
/* (non-Javadoc)
* @see org.apache.poi.hssf.usermodel.DataValidationConstraint#getFormula1()
*/
+ @Override
public String getFormula1() {
return _formula1;
}
/* (non-Javadoc)
* @see org.apache.poi.hssf.usermodel.DataValidationConstraint#setFormula1(java.lang.String)
*/
+ @Override
public void setFormula1(String formula1) {
_value1 = null;
_explicitListValues = null;
@@ -342,19 +349,21 @@ public class DVConstraint implements Dat
/* (non-Javadoc)
* @see org.apache.poi.hssf.usermodel.DataValidationConstraint#getFormula2()
*/
+ @Override
public String getFormula2() {
return _formula2;
}
/* (non-Javadoc)
* @see org.apache.poi.hssf.usermodel.DataValidationConstraint#setFormula2(java.lang.String)
*/
+ @Override
public void setFormula2(String formula2) {
_value2 = null;
_formula2 = formula2;
}
/**
- * @return the numeric value for expression 1. May be <code>null</code>
+ * @return the numeric value for expression 1. May be {@code null}
*/
public Double getValue1() {
return _value1;
@@ -364,11 +373,11 @@ public class DVConstraint implements Dat
*/
public void setValue1(double value1) {
_formula1 = null;
- _value1 = Double.valueOf(value1);
+ _value1 = value1;
}
/**
- * @return the numeric value for expression 2. May be <code>null</code>
+ * @return the numeric value for expression 2. May be {@code null}
*/
public Double getValue2() {
return _value2;
@@ -378,11 +387,11 @@ public class DVConstraint implements Dat
*/
public void setValue2(double value2) {
_formula2 = null;
- _value2 = Double.valueOf(value2);
+ _value2 = value2;
}
-
+
/**
- * @return both parsed formulas (for expression 1 and 2).
+ * @return both parsed formulas (for expression 1 and 2).
*/
/* package */ FormulaPair createFormulas(HSSFSheet sheet) {
Ptg[] formula1;
@@ -414,14 +423,14 @@ public class DVConstraint implements Dat
sb.append('\0'); // list delimiter is the nul char
}
sb.append(_explicitListValues[i]);
-
+
}
return new Ptg[] { new StringPtg(sb.toString()), };
}
/**
- * @return The parsed token array representing the formula or value specified.
- * Empty array if both formula and value are <code>null</code>
+ * @return The parsed token array representing the formula or value specified.
+ * Empty array if both formula and value are {@code null}
*/
@SuppressWarnings("resource")
private static Ptg[] convertDoubleFormula(String formula, Double value, HSSFSheet sheet) {
@@ -429,14 +438,14 @@ public class DVConstraint implements Dat
if (value == null) {
return Ptg.EMPTY_PTG_ARRAY;
}
- return new Ptg[] { new NumberPtg(value.doubleValue()), };
+ return new Ptg[] { new NumberPtg(value), };
}
if (value != null) {
throw new IllegalStateException("Both formula and value cannot be present");
}
HSSFWorkbook wb = sheet.getWorkbook();
return HSSFFormulaParser.parse(formula, wb, FormulaType.CELL, wb.getSheetIndex(sheet));
- }
+ }
static DVConstraint createDVConstraint(DVRecord dvRecord, FormulaRenderingWorkbook book) {
switch (dvRecord.getDataType()) {
Modified: poi/trunk/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFConditionalFormatting.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFConditionalFormatting.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFConditionalFormatting.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFConditionalFormatting.java Wed Apr 14 22:53:33 2021
@@ -23,55 +23,45 @@ import org.apache.poi.ss.usermodel.Condi
import org.apache.poi.ss.util.CellRangeAddress;
/**
- * HSSFConditionalFormatting class encapsulates all settings of Conditional Formatting.
- *
- * The class can be used
- *
- * <UL>
- * <LI>
- * to make a copy HSSFConditionalFormatting settings.
- * </LI>
- *
- *
+ * HSSFConditionalFormatting class encapsulates all settings of Conditional Formatting.
+ *
+ * The class can be used to make a copy HSSFConditionalFormatting settings.
+ *
+ *
* For example:
- * <PRE>
+ * <pre>{@code
* HSSFConditionalFormatting cf = sheet.getConditionalFormattingAt(index);
* newSheet.addConditionalFormatting(cf);
- * </PRE>
- *
- * <LI>
- * or to modify existing Conditional Formatting settings (formatting regions and/or rules).
- * </LI>
- * </UL>
- *
+ * }</pre>
+ *
+ * or to modify existing Conditional Formatting settings (formatting regions and/or rules).<p>
+ *
* Use {@link org.apache.poi.hssf.usermodel.HSSFSheet#getSheetConditionalFormatting()} to get access to an instance of this class.
* <P>
* To create a new Conditional Formatting set use the following approach:
- *
- * <PRE>
- *
+ *
+ * <pre>{@code
* // Define a Conditional Formatting rule, which triggers formatting
* // when cell's value is greater or equal than 100.0 and
* // applies patternFormatting defined below.
* HSSFConditionalFormattingRule rule = sheet.createConditionalFormattingRule(
- * ComparisonOperator.GE,
- * "100.0", // 1st formula
+ * ComparisonOperator.GE,
+ * "100.0", // 1st formula
* null // 2nd formula is not used for comparison operator GE
* );
- *
+ *
* // Create pattern with red background
* HSSFPatternFormatting patternFmt = rule.cretePatternFormatting();
* patternFormatting.setFillBackgroundColor(HSSFColor.RED.index);
- *
+ *
* // Define a region containing first column
- * Region [] regions =
- * {
+ * Region [] regions = {
* new Region(1,(short)1,-1,(short)1)
* };
- *
- * // Apply Conditional Formatting rule defined above to the regions
+ *
+ * // Apply Conditional Formatting rule defined above to the regions
* sheet.addConditionalFormatting(regions, rule);
- * </PRE>
+ * }</pre>
*/
public final class HSSFConditionalFormatting implements ConditionalFormatting {
private final HSSFSheet sheet;
@@ -84,7 +74,7 @@ public final class HSSFConditionalFormat
if(cfAggregate == null) {
throw new IllegalArgumentException("cfAggregate must not be null");
}
- this.sheet = sheet;
+ this.sheet = sheet;
this.cfAggregate = cfAggregate;
}
CFRecordsAggregate getCFRecordsAggregate() {
@@ -92,7 +82,7 @@ public final class HSSFConditionalFormat
}
/**
- * @return array of <tt>CellRangeAddress</tt>s. never <code>null</code>
+ * @return array of {@code CellRangeAddress}s. never {@code null}
*/
@Override
public CellRangeAddress[] getFormattingRanges() {
@@ -106,11 +96,11 @@ public final class HSSFConditionalFormat
}
/**
- * Replaces an existing Conditional Formatting rule at position idx.
+ * Replaces an existing Conditional Formatting rule at position idx.
* Older versions of Excel only allow up to 3 Conditional Formatting rules,
* and will ignore rules beyond that, while newer versions are fine.
* This method can be useful to modify existing Conditional Formatting rules.
- *
+ *
* @param idx position of the rule. Should be between 0 and 2 for older Excel versions
* @param cfRule - Conditional Formatting rule
*/
@@ -124,7 +114,7 @@ public final class HSSFConditionalFormat
}
/**
- * add a Conditional Formatting rule.
+ * add a Conditional Formatting rule.
* Excel allows to create up to 3 Conditional Formatting rules.
* @param cfRule - Conditional Formatting rule
*/
Modified: poi/trunk/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFSheetConditionalFormatting.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFSheetConditionalFormatting.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFSheetConditionalFormatting.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFSheetConditionalFormatting.java Wed Apr 14 22:53:33 2021
@@ -31,7 +31,7 @@ import org.apache.poi.ss.usermodel.Sheet
import org.apache.poi.ss.util.CellRangeAddress;
/**
- * The 'Conditional Formatting' facet of <tt>HSSFSheet</tt>
+ * The 'Conditional Formatting' facet of {@code HSSFSheet}
*/
public final class HSSFSheetConditionalFormatting implements SheetConditionalFormatting {
private final HSSFSheet _sheet;
@@ -48,7 +48,7 @@ public final class HSSFSheetConditionalF
* TODO - formulas containing cell references are currently not parsed properly
*
* @param comparisonOperation - a constant value from
- * <tt>{@link org.apache.poi.hssf.record.CFRuleBase.ComparisonOperator}</tt>: <p>
+ * {@code {@link org.apache.poi.hssf.record.CFRuleBase.ComparisonOperator}}:
* <ul>
* <li>BETWEEN</li>
* <li>NOT_BETWEEN</li>
@@ -59,12 +59,13 @@ public final class HSSFSheetConditionalF
* <li>GE</li>
* <li>LE</li>
* </ul>
- * </p>
+ *
* @param formula1 - formula for the valued, compared with the cell
* @param formula2 - second formula (only used with
* {@link org.apache.poi.hssf.record.CFRuleBase.ComparisonOperator#BETWEEN}) and
* {@link org.apache.poi.hssf.record.CFRuleBase.ComparisonOperator#NOT_BETWEEN} operations)
*/
+ @Override
public HSSFConditionalFormattingRule createConditionalFormattingRule(
byte comparisonOperation,
String formula1,
@@ -73,6 +74,7 @@ public final class HSSFSheetConditionalF
return new HSSFConditionalFormattingRule(_sheet, rr);
}
+ @Override
public HSSFConditionalFormattingRule createConditionalFormattingRule(
byte comparisonOperation,
String formula1) {
@@ -87,6 +89,7 @@ public final class HSSFSheetConditionalF
* TODO - formulas containing cell references are currently not parsed properly
* @param formula - formula for the valued, compared with the cell
*/
+ @Override
public HSSFConditionalFormattingRule createConditionalFormattingRule(String formula) {
CFRuleRecord rr = CFRuleRecord.create(_sheet, formula);
return new HSSFConditionalFormattingRule(_sheet, rr);
@@ -101,6 +104,7 @@ public final class HSSFSheetConditionalF
* then
* {@link HSSFIconMultiStateFormatting#getThresholds()}
*/
+ @Override
public HSSFConditionalFormattingRule createConditionalFormattingRule(
IconSet iconSet) {
CFRule12Record rr = CFRule12Record.create(_sheet, iconSet);
@@ -121,6 +125,7 @@ public final class HSSFSheetConditionalF
CFRule12Record rr = CFRule12Record.create(_sheet, color.getExtendedColor());
return new HSSFConditionalFormattingRule(_sheet, rr);
}
+ @Override
public HSSFConditionalFormattingRule createConditionalFormattingRule(ExtendedColor color) {
return createConditionalFormattingRule((HSSFExtendedColor)color);
}
@@ -135,6 +140,7 @@ public final class HSSFSheetConditionalF
* and
* {@link HSSFColorScaleFormatting#getColors()}
*/
+ @Override
public HSSFConditionalFormattingRule createConditionalFormattingColorScaleRule() {
CFRule12Record rr = CFRule12Record.createColorScale(_sheet);
return new HSSFConditionalFormattingRule(_sheet, rr);
@@ -158,6 +164,7 @@ public final class HSSFSheetConditionalF
return _conditionalFormattingTable.add(cfraClone);
}
+ @Override
public int addConditionalFormatting( ConditionalFormatting cf ) {
return addConditionalFormatting((HSSFConditionalFormatting)cf);
}
@@ -194,6 +201,7 @@ public final class HSSFSheetConditionalF
return _conditionalFormattingTable.add(cfra);
}
+ @Override
public int addConditionalFormatting(CellRangeAddress[] regions, ConditionalFormattingRule[] cfRules) {
HSSFConditionalFormattingRule[] hfRules;
if(cfRules instanceof HSSFConditionalFormattingRule[]) {
@@ -212,6 +220,7 @@ public final class HSSFSheetConditionalF
);
}
+ @Override
public int addConditionalFormatting(CellRangeAddress[] regions,
ConditionalFormattingRule rule1) {
return addConditionalFormatting(regions, (HSSFConditionalFormattingRule)rule1);
@@ -224,6 +233,7 @@ public final class HSSFSheetConditionalF
new HSSFConditionalFormattingRule[] { rule1, rule2 });
}
+ @Override
public int addConditionalFormatting(CellRangeAddress[] regions,
ConditionalFormattingRule rule1,
ConditionalFormattingRule rule2) {
@@ -240,6 +250,7 @@ public final class HSSFSheetConditionalF
* of the Conditional Formatting object to fetch
* @return Conditional Formatting object
*/
+ @Override
public HSSFConditionalFormatting getConditionalFormattingAt(int index) {
CFRecordsAggregate cf = _conditionalFormattingTable.get(index);
if (cf == null) {
@@ -251,6 +262,7 @@ public final class HSSFSheetConditionalF
/**
* @return number of Conditional Formatting objects of the sheet
*/
+ @Override
public int getNumConditionalFormattings() {
return _conditionalFormattingTable.size();
}
@@ -259,6 +271,7 @@ public final class HSSFSheetConditionalF
* removes a Conditional Formatting object by index
* @param index of a Conditional Formatting object to remove
*/
+ @Override
public void removeConditionalFormatting(int index) {
_conditionalFormattingTable.remove(index);
}
Modified: poi/trunk/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java Wed Apr 14 22:53:33 2021
@@ -177,7 +177,7 @@ public final class HSSFWorkbook extends
* this holds the HSSFName objects attached to this workbook
*/
- private ArrayList<HSSFName> names;
+ private final ArrayList<HSSFName> names;
/**
* this holds the HSSFFont objects attached to this workbook.
@@ -212,7 +212,7 @@ public final class HSSFWorkbook extends
* The locator of user-defined functions.
* By default includes functions from the Excel Analysis Toolpack
*/
- private UDFFinder _udfFinder = new IndexedUDFFinder(AggregatingUDFFinder.DEFAULT);
+ private final UDFFinder _udfFinder = new IndexedUDFFinder(AggregatingUDFFinder.DEFAULT);
public static HSSFWorkbook create(InternalWorkbook book) {
return new HSSFWorkbook(book);
@@ -583,7 +583,7 @@ public final class HSSFWorkbook extends
/**
* Selects multiple sheets as a group. This is distinct from
* the 'active' sheet (which is the sheet with focus).
- * Unselects sheets that are not in <code>indexes</code>.
+ * Unselects sheets that are not in {@code indexes}.
*
* @param indexes Array of sheets to select, the index is 0-based.
*/
@@ -598,7 +598,7 @@ public final class HSSFWorkbook extends
/**
* Selects multiple sheets as a group. This is distinct from
* the 'active' sheet (which is the sheet with focus).
- * Unselects sheets that are not in <code>indexes</code>.
+ * Unselects sheets that are not in {@code indexes}.
*
* @param indexes Collection of sheets to select, the index is 0-based.
*/
@@ -770,7 +770,7 @@ public final class HSSFWorkbook extends
* Returns the index of the given sheet
*
* @param sheet the sheet to look up
- * @return index of the sheet (0 based). <tt>-1</tt> if not found
+ * @return index of the sheet (0 based). {@code -1} if not found
*/
@Override
public int getSheetIndex(Sheet sheet) {
@@ -873,11 +873,11 @@ public final class HSSFWorkbook extends
* POI's SpreadsheetAPI silently truncates the input argument to 31 characters.
* Example:
*
- * <pre><code>
+ * <pre>{@code
* Sheet sheet = workbook.createSheet("My very long sheet name which is longer than 31 chars"); // will be truncated
* assert 31 == sheet.getSheetName().length();
* assert "My very long sheet name which i" == sheet.getSheetName();
- * </code></pre>
+ * }</pre>
* </p>
* <p>
* Except the 31-character constraint, Excel applies some other rules:
@@ -1009,7 +1009,7 @@ public final class HSSFWorkbook extends
* Get sheet with the given name (case insensitive match)
*
* @param name of the sheet
- * @return HSSFSheet with the name provided or <code>null</code> if it does not exist
+ * @return HSSFSheet with the name provided or {@code null} if it does not exist
*/
@Override
@@ -1027,7 +1027,7 @@ public final class HSSFWorkbook extends
}
/**
- * Removes sheet at the given index.<p>
+ * Removes sheet at the given index.
* <p>
* Care must be taken if the removed sheet is the currently active or only selected sheet in
* the workbook. There are a few situations when Excel must have a selection and/or active
@@ -1408,7 +1408,7 @@ public final class HSSFWorkbook extends
*/
private static final class SheetRecordCollector implements RecordVisitor {
- private List<Record> _list;
+ private final List<Record> _list;
private int _totalSize;
public SheetRecordCollector() {
@@ -1836,7 +1836,7 @@ public final class HSSFWorkbook extends
* Adds a picture to the workbook.
*
* @param pictureData The bytes of the picture
- * @param format The format of the picture. One of <code>PICTURE_TYPE_*</code>
+ * @param format The format of the picture. One of {@code PICTURE_TYPE_*}
* @return the index to this picture (1 based).
* @see #PICTURE_TYPE_WMF
* @see #PICTURE_TYPE_EMF
Modified: poi/trunk/poi/src/main/java/org/apache/poi/hssf/util/HSSFColor.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/hssf/util/HSSFColor.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/hssf/util/HSSFColor.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/hssf/util/HSSFColor.java Wed Apr 14 22:53:33 2021
@@ -43,9 +43,9 @@ public class HSSFColor implements Color
private static Map<Integer,HSSFColor> indexHash;
private static Map<HSSFColorPredefined,HSSFColor> enumList;
- private java.awt.Color color;
- private int index;
- private int index2;
+ private final java.awt.Color color;
+ private final int index;
+ private final int index2;
/**
* Predefined HSSFColors with their given palette index (and an optional 2nd index)
@@ -108,7 +108,7 @@ public class HSSFColor implements Color
*/
AUTOMATIC (0x40, -1, 0x000000);
- private HSSFColor color;
+ private final HSSFColor color;
HSSFColorPredefined(int index, int index2, int rgb) {
this.color = new HSSFColor(index, index2, new java.awt.Color(rgb));
@@ -167,7 +167,7 @@ public class HSSFColor implements Color
* This function returns all the colours in an unmodifiable Map.
* The map is cached on first use.
*
- * @return a Map containing all colours keyed by <tt>Integer</tt> excel-style palette indexes
+ * @return a Map containing all colours keyed by {@code Integer} excel-style palette indexes
*/
public static synchronized Map<Integer,HSSFColor> getIndexHash() {
if(indexHash == null) {
@@ -344,7 +344,7 @@ public class HSSFColor implements Color
if (index != hssfColor.index) return false;
if (index2 != hssfColor.index2) return false;
- return color != null ? color.equals(hssfColor.color) : hssfColor.color == null;
+ return Objects.equals(color, hssfColor.color);
}
@Override
@@ -353,7 +353,7 @@ public class HSSFColor implements Color
}
/**
- * Checked type cast <tt>color</tt> to an HSSFColor.
+ * Checked type cast {@code color} to an HSSFColor.
*
* @param color the color to type cast
* @return the type casted color
Modified: poi/trunk/poi/src/main/java/org/apache/poi/poifs/dev/POIFSViewEngine.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/poifs/dev/POIFSViewEngine.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/poifs/dev/POIFSViewEngine.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/poifs/dev/POIFSViewEngine.java Wed Apr 14 22:53:33 2021
@@ -15,7 +15,7 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
+
package org.apache.poi.poifs.dev;
@@ -28,8 +28,6 @@ import java.util.List;
/**
* This class contains methods used to inspect POIFSViewable objects
- *
- * @author Marc Johnson (mjohnson at apache dot org)
*/
public class POIFSViewEngine
Modified: poi/trunk/poi/src/main/java/org/apache/poi/poifs/dev/POIFSViewable.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/poifs/dev/POIFSViewable.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/poifs/dev/POIFSViewable.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/poifs/dev/POIFSViewable.java Wed Apr 14 22:53:33 2021
@@ -15,7 +15,7 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
+
package org.apache.poi.poifs.dev;
@@ -31,8 +31,6 @@ import java.util.Iterator;
* A POIFSViewable object is also expected to provide a short
* description of itself, that can be used by a viewer when the
* viewable object is collapsed.
- *
- * @author Marc Johnson (mjohnson at apache dot org)
*/
public interface POIFSViewable
@@ -46,7 +44,7 @@ public interface POIFSViewable
*/
public Object [] getViewableArray();
-
+
/**
* Get an Iterator of objects, some of which may implement
* POIFSViewable
Modified: poi/trunk/poi/src/main/java/org/apache/poi/poifs/dev/POIFSViewer.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/poifs/dev/POIFSViewer.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/poifs/dev/POIFSViewer.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/poifs/dev/POIFSViewer.java Wed Apr 14 22:53:33 2021
@@ -15,7 +15,7 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
+
package org.apache.poi.poifs.dev;
@@ -27,8 +27,6 @@ import org.apache.poi.poifs.filesystem.P
/**
* A simple viewer for POIFS files
- *
- * @author Marc Johnson (mjohnson at apache dot org)
*/
public final class POIFSViewer {
Modified: poi/trunk/poi/src/main/java/org/apache/poi/poifs/eventfilesystem/POIFSReaderListener.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/poifs/eventfilesystem/POIFSReaderListener.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/poifs/eventfilesystem/POIFSReaderListener.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/poifs/eventfilesystem/POIFSReaderListener.java Wed Apr 14 22:53:33 2021
@@ -15,15 +15,12 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
+
package org.apache.poi.poifs.eventfilesystem;
/**
* Interface POIFSReaderListener
- *
- * @author Marc Johnson (mjohnson at apache dot org)
- * @version %I%, %G%
*/
public interface POIFSReaderListener
Modified: poi/trunk/poi/src/main/java/org/apache/poi/poifs/eventfilesystem/POIFSReaderRegistry.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/poifs/eventfilesystem/POIFSReaderRegistry.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/poifs/eventfilesystem/POIFSReaderRegistry.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/poifs/eventfilesystem/POIFSReaderRegistry.java Wed Apr 14 22:53:33 2021
@@ -15,7 +15,7 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
+
package org.apache.poi.poifs.eventfilesystem;
@@ -27,9 +27,6 @@ import org.apache.poi.poifs.filesystem.P
/**
* A registry for POIFSReaderListeners and the DocumentDescriptors of
* the documents those listeners are interested in
- *
- * @author Marc Johnson (mjohnson at apache dot org)
- * @version %I%, %G%
*/
class POIFSReaderRegistry
Modified: poi/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/BATManaged.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/BATManaged.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/BATManaged.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/BATManaged.java Wed Apr 14 22:53:33 2021
@@ -15,15 +15,13 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
+
package org.apache.poi.poifs.filesystem;
/**
* This interface defines behaviors for objects managed by the Block
* Allocation Table (BAT).
- *
- * @author Marc Johnson (mjohnson at apache dot org)
*/
public interface BATManaged
Modified: poi/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/DirectoryEntry.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/DirectoryEntry.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/DirectoryEntry.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/DirectoryEntry.java Wed Apr 14 22:53:33 2021
@@ -30,8 +30,6 @@ import org.apache.poi.hpsf.ClassID;
/**
* This interface defines methods specific to Directory objects
* managed by a Filesystem instance.
- *
- * @author Marc Johnson (mjohnson at apache dot org)
*/
public interface DirectoryEntry
@@ -50,14 +48,14 @@ public interface DirectoryEntry
*/
public Iterator<Entry> getEntries();
-
+
/**
* get the names of all the Entries contained directly in this
* instance (in other words, names of children only; no grandchildren
* etc).
*
* @return the names of all the entries that may be retrieved with
- * getEntry(String), which may be empty (if this
+ * getEntry(String), which may be empty (if this
* DirectoryEntry is empty)
*/
public Set<String> getEntryNames();
Modified: poi/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/DocumentDescriptor.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/DocumentDescriptor.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/DocumentDescriptor.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/DocumentDescriptor.java Wed Apr 14 22:53:33 2021
@@ -15,15 +15,12 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
+
package org.apache.poi.poifs.filesystem;
/**
* Class DocumentDescriptor
- *
- * @author Marc Johnson (mjohnson at apache dot org)
- * @version %I%, %G%
*/
public class DocumentDescriptor
Modified: poi/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/DocumentEntry.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/DocumentEntry.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/DocumentEntry.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/DocumentEntry.java Wed Apr 14 22:53:33 2021
@@ -15,15 +15,13 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
+
package org.apache.poi.poifs.filesystem;
/**
* This interface defines methods specific to Document objects
* managed by a Filesystem instance.
- *
- * @author Marc Johnson (mjohnson at apache dot org)
*/
public interface DocumentEntry
Modified: poi/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/Entry.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/Entry.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/Entry.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/Entry.java Wed Apr 14 22:53:33 2021
@@ -15,7 +15,7 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
+
package org.apache.poi.poifs.filesystem;
@@ -23,8 +23,6 @@ package org.apache.poi.poifs.filesystem;
* This interface provides access to an object managed by a Filesystem
* instance. Entry objects are further divided into DocumentEntry and
* DirectoryEntry instances.
- *
- * @author Marc Johnson (mjohnson at apache dot org)
*/
public interface Entry
Modified: poi/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/EntryNode.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/EntryNode.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/EntryNode.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/EntryNode.java Wed Apr 14 22:53:33 2021
@@ -15,7 +15,7 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
+
package org.apache.poi.poifs.filesystem;
@@ -28,8 +28,6 @@ import org.apache.poi.poifs.property.Pro
* appropriate
*
* Extending classes must override isDeleteOK()
- *
- * @author Marc Johnson (mjohnson at apache dot org)
*/
public abstract class EntryNode
Modified: poi/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/POIFSFileSystem.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/POIFSFileSystem.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/POIFSFileSystem.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/POIFSFileSystem.java Wed Apr 14 22:53:33 2021
@@ -67,7 +67,7 @@ public class POIFSFileSystem extends Blo
/**
* Maximum number size (in blocks) of the allocation table as supported by
- * POI.<p>
+ * POI.
* <p>
* This constant has been chosen to help POI identify corrupted data in the
* header block (rather than crash immediately with {@link OutOfMemoryError}
@@ -135,8 +135,8 @@ public class POIFSFileSystem extends Blo
}
/**
- * <p>Creates a POIFSFileSystem from a <tt>File</tt>. This uses less memory than
- * creating from an <tt>InputStream</tt>. The File will be opened read-only</p>
+ * <p>Creates a POIFSFileSystem from a {@code File}. This uses less memory than
+ * creating from an {@code InputStream}. The File will be opened read-only</p>
*
* <p>Note that with this constructor, you will need to call {@link #close()}
* when you're done to have the underlying file closed, as the file is
@@ -151,8 +151,8 @@ public class POIFSFileSystem extends Blo
}
/**
- * <p>Creates a POIFSFileSystem from a <tt>File</tt>. This uses less memory than
- * creating from an <tt>InputStream</tt>.</p>
+ * <p>Creates a POIFSFileSystem from a {@code File}. This uses less memory than
+ * creating from an {@code InputStream}.</p>
*
* <p>Note that with this constructor, you will need to call {@link #close()}
* when you're done to have the underlying file closed, as the file is
@@ -168,8 +168,8 @@ public class POIFSFileSystem extends Blo
}
/**
- * <p>Creates a POIFSFileSystem from an open <tt>FileChannel</tt>. This uses
- * less memory than creating from an <tt>InputStream</tt>. The stream will
+ * <p>Creates a POIFSFileSystem from an open {@code FileChannel}. This uses
+ * less memory than creating from an {@code InputStream}. The stream will
* be used in read-only mode.</p>
*
* <p>Note that with this constructor, you will need to call {@link #close()}
@@ -185,8 +185,8 @@ public class POIFSFileSystem extends Blo
}
/**
- * <p>Creates a POIFSFileSystem from an open <tt>FileChannel</tt>. This uses
- * less memory than creating from an <tt>InputStream</tt>.</p>
+ * <p>Creates a POIFSFileSystem from an open {@code FileChannel}. This uses
+ * less memory than creating from an {@code InputStream}.</p>
*
* <p>Note that with this constructor, you will need to call {@link #close()}
* when you're done to have the underlying Channel closed, as the channel is
@@ -240,21 +240,21 @@ public class POIFSFileSystem extends Blo
}
/**
- * Create a POIFSFileSystem from an <tt>InputStream</tt>. Normally the stream is read until
- * EOF. The stream is always closed.<p>
+ * Create a POIFSFileSystem from an {@code InputStream}. Normally the stream is read until
+ * EOF. The stream is always closed.
* <p>
- * Some streams are usable after reaching EOF (typically those that return <code>true</code>
- * for <tt>markSupported()</tt>). In the unlikely case that the caller has such a stream
+ * Some streams are usable after reaching EOF (typically those that return {@code true}
+ * for {@code markSupported()}). In the unlikely case that the caller has such a stream
* <i>and</i> needs to use it after this constructor completes, a work around is to wrap the
- * stream in order to trap the <tt>close()</tt> call. A convenience method (
- * <tt>createNonClosingInputStream()</tt>) has been provided for this purpose:
+ * stream in order to trap the {@code close()} call. A convenience method (
+ * {@code createNonClosingInputStream()}) has been provided for this purpose:
* <pre>
* InputStream wrappedStream = POIFSFileSystem.createNonClosingInputStream(is);
* HSSFWorkbook wb = new HSSFWorkbook(wrappedStream);
* is.reset();
* doSomethingElse(is);
* </pre>
- * Note also the special case of <tt>ByteArrayInputStream</tt> for which the <tt>close()</tt>
+ * Note also the special case of {@code ByteArrayInputStream} for which the {@code close()}
* method does nothing.
* <pre>
* ByteArrayInputStream bais = ...
@@ -316,7 +316,7 @@ public class POIFSFileSystem extends Blo
/**
* @param stream the stream to be closed
- * @param success <code>false</code> if an exception is currently being thrown in the calling method
+ * @param success {@code false} if an exception is currently being thrown in the calling method
*/
private void closeInputStream(InputStream stream, boolean success) {
try {
@@ -902,12 +902,12 @@ public class POIFSFileSystem extends Blo
}
/**
- * Creates a new {@link POIFSFileSystem} in a new {@link File}.
+ * Creates a new POIFSFileSystem in a new {@link File}.
* Use {@link #POIFSFileSystem(File)} to open an existing File,
* this should only be used to create a new empty filesystem.
*
* @param file The file to create and open
- * @return The created and opened {@link POIFSFileSystem}
+ * @return The created and opened POIFSFileSystem
*/
public static POIFSFileSystem create(File file) throws IOException {
// Create a new empty POIFS in the file
Modified: poi/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/POIFSWriterEvent.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/POIFSWriterEvent.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/POIFSWriterEvent.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/POIFSWriterEvent.java Wed Apr 14 22:53:33 2021
@@ -15,15 +15,12 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
+
package org.apache.poi.poifs.filesystem;
/**
* Class POIFSWriterEvent
- *
- * @author Marc Johnson (mjohnson at apache dot org)
- * @version %I%, %G%
*/
public class POIFSWriterEvent
Modified: poi/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/POIFSWriterListener.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/POIFSWriterListener.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/POIFSWriterListener.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/POIFSWriterListener.java Wed Apr 14 22:53:33 2021
@@ -15,15 +15,12 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
+
package org.apache.poi.poifs.filesystem;
/**
* Interface POIFSWriterListener
- *
- * @author Marc Johnson (mjohnson at apache dot org)
- * @version %I%, %G%
*/
public interface POIFSWriterListener
Modified: poi/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/TempFilePOIFSFileSystem.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/TempFilePOIFSFileSystem.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/TempFilePOIFSFileSystem.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/TempFilePOIFSFileSystem.java Wed Apr 14 22:53:33 2021
@@ -32,6 +32,7 @@ import java.io.IOException;
public class TempFilePOIFSFileSystem extends POIFSFileSystem {
File tempFile;
+ @Override
protected void createNewDataSource() {
try {
tempFile = TempFile.createTempFile("poifs", ".tmp");
@@ -41,6 +42,7 @@ public class TempFilePOIFSFileSystem ext
}
}
+ @Override
public void close() throws IOException {
if (tempFile != null && tempFile.exists()) tempFile.delete();
super.close();
Modified: poi/trunk/poi/src/main/java/org/apache/poi/poifs/macros/VBAMacroExtractor.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/poifs/macros/VBAMacroExtractor.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/poifs/macros/VBAMacroExtractor.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/poifs/macros/VBAMacroExtractor.java Wed Apr 14 22:53:33 2021
@@ -30,7 +30,7 @@ import org.apache.poi.util.StringUtil;
/**
* This tool extracts out the source of all VBA Modules of an office file,
* both OOXML (eg XLSM) and OLE2/POIFS (eg DOC), to STDOUT or a directory.
- *
+ *
* @since 3.15-beta2
*/
public class VBAMacroExtractor {
@@ -43,24 +43,24 @@ public class VBAMacroExtractor {
System.err.println("Otherwise they are output to the screen");
System.exit(1);
}
-
+
File input = new File(args[0]);
File output = null;
if (args.length > 1) {
output = new File(args[1]);
}
-
+
VBAMacroExtractor extractor = new VBAMacroExtractor();
extractor.extract(input, output);
}
-
+
/**
* Extracts the VBA modules from a macro-enabled office file and writes them
- * to files in <tt>outputDir</tt>.
+ * to files in {@code outputDir}.
*
- * Creates the <tt>outputDir</tt>, directory, including any necessary but
- * nonexistent parent directories, if <tt>outputDir</tt> does not exist.
- * If <tt>outputDir</tt> is null, writes the contents to standard out instead.
+ * Creates the {@code outputDir}, directory, including any necessary but
+ * nonexistent parent directories, if {@code outputDir} does not exist.
+ * If {@code outputDir} is null, writes the contents to standard out instead.
*
* @param input the macro-enabled office file.
* @param outputDir the directory to write the extracted VBA modules to.
@@ -83,7 +83,7 @@ public class VBAMacroExtractor {
try (VBAMacroReader reader = new VBAMacroReader(input)) {
macros = reader.readMacros();
}
-
+
final String divider = "---------------------------------------";
for (Entry<String, String> entry : macros.entrySet()) {
String moduleName = entry.getKey();
@@ -109,12 +109,12 @@ public class VBAMacroExtractor {
/**
* Extracts the VBA modules from a macro-enabled office file and writes them
- * to <tt>.vba</tt> files in <tt>outputDir</tt>.
- *
- * Creates the <tt>outputDir</tt>, directory, including any necessary but
- * nonexistent parent directories, if <tt>outputDir</tt> does not exist.
- * If <tt>outputDir</tt> is null, writes the contents to standard out instead.
- *
+ * to {@code .vba} files in {@code outputDir}.
+ *
+ * Creates the {@code outputDir}, directory, including any necessary but
+ * nonexistent parent directories, if {@code outputDir} does not exist.
+ * If {@code outputDir} is null, writes the contents to standard out instead.
+ *
* @param input the macro-enabled office file.
* @param outputDir the directory to write the extracted VBA modules to.
* @since 3.15-beta2
Modified: poi/trunk/poi/src/main/java/org/apache/poi/poifs/macros/VBAMacroReader.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/poifs/macros/VBAMacroReader.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/poifs/macros/VBAMacroReader.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/poifs/macros/VBAMacroReader.java Wed Apr 14 22:53:33 2021
@@ -121,6 +121,7 @@ public class VBAMacroReader implements C
throw new IllegalArgumentException("No VBA project found");
}
+ @Override
public void close() throws IOException {
fs.close();
fs = null;
@@ -171,9 +172,11 @@ public class VBAMacroReader implements C
out.close();
buf = out.toByteArray();
}
+ @Override
public String getContent() {
return new String(buf, charset);
}
+ @Override
public ModuleType geModuleType() {
return moduleType;
}
@@ -183,9 +186,9 @@ public class VBAMacroReader implements C
}
/**
- * Recursively traverses directory structure rooted at <tt>dir</tt>.
+ * Recursively traverses directory structure rooted at {@code dir}.
* For each macro module that is found, the module's name and code are
- * added to <tt>modules<tt>.
+ * added to {@code modules}.
*
* @param dir The directory of entries to look at
* @param modules The resulting map of modules
@@ -264,11 +267,10 @@ public class VBAMacroReader implements C
module.read(decompressed);
}
return;
- } catch (IllegalArgumentException | IllegalStateException e) {
+ } catch (IllegalArgumentException | IllegalStateException ignored) {
}
//bad module.offset, try brute force
- ;
byte[] decompressedBytes;
try (InputStream compressed = new DocumentInputStream(documentNode)) {
decompressedBytes = findCompressedStreamWBruteForce(compressed);
@@ -282,7 +284,7 @@ public class VBAMacroReader implements C
}
/**
- * Skips <tt>n</tt> bytes in an input stream, throwing IOException if the
+ * Skips {@code n} bytes in an input stream, throwing IOException if the
* number of bytes skipped is different than requested.
* @throws IOException If skipping would exceed the available data or skipping did not work.
*/
@@ -311,7 +313,7 @@ public class VBAMacroReader implements C
/**
* Reads VBA Project modules from a VBA Project directory located at
- * <tt>macroDir</tt> into <tt>modules</tt>.
+ * {@code macroDir} into {@code modules}.
*
* @since 3.15-beta2
*/
@@ -634,8 +636,8 @@ public class VBAMacroReader implements C
Map<String, String> moduleNames, Charset charset) throws IOException {
//see 2.3.3 PROJECTwm Stream: Module Name Information
//multibytecharstring
- String mbcs = null;
- String unicode = null;
+ String mbcs;
+ String unicode;
//arbitrary sanity threshold
final int maxNameRecords = 10000;
int records = 0;
@@ -701,7 +703,7 @@ public class VBAMacroReader implements C
}
/**
- * Read <tt>length</tt> bytes of MBCS (multi-byte character set) characters from the stream
+ * Read {@code length} bytes of MBCS (multi-byte character set) characters from the stream
*
* @param stream the inputstream to read from
* @param length number of bytes to read from stream
@@ -789,7 +791,7 @@ public class VBAMacroReader implements C
* This relies on some, er, heuristics, admittedly.
*
* @param is full module inputstream to read
- * @return uncompressed bytes if found, <code>null</code> otherwise
+ * @return uncompressed bytes if found, {@code null} otherwise
* @throws IOException for a true IOException copying the is to a byte array
*/
private static byte[] findCompressedStreamWBruteForce(InputStream is) throws IOException {
Modified: poi/trunk/poi/src/main/java/org/apache/poi/poifs/property/Child.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/poifs/property/Child.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/poifs/property/Child.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/poifs/property/Child.java Wed Apr 14 22:53:33 2021
@@ -15,15 +15,13 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
+
package org.apache.poi.poifs.property;
/**
* This interface defines methods for finding and setting sibling
* Property instances
- *
- * @author Marc Johnson (mjohnson at apache dot org)
*/
public interface Child {
Modified: poi/trunk/poi/src/main/java/org/apache/poi/poifs/property/Property.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/poifs/property/Property.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/poifs/property/Property.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/poifs/property/Property.java Wed Apr 14 22:53:33 2021
@@ -34,8 +34,6 @@ import org.apache.poi.util.ShortField;
/**
* This abstract base class is the ancestor of all classes
* implementing POIFS Property behavior.
- *
- * @author Marc Johnson (mjohnson at apache dot org)
*/
public abstract class Property implements Child, POIFSViewable {
Modified: poi/trunk/poi/src/main/java/org/apache/poi/poifs/property/PropertyFactory.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/poifs/property/PropertyFactory.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/poifs/property/PropertyFactory.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/poifs/property/PropertyFactory.java Wed Apr 14 22:53:33 2021
@@ -15,7 +15,7 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
+
package org.apache.poi.poifs.property;
@@ -31,8 +31,6 @@ import org.apache.poi.poifs.common.POIFS
* should correspond to a Property, but which does not map to a proper
* Property (i.e., a DirectoryProperty, DocumentProperty, or
* RootProperty) will get mapped to a null Property in the array.
- *
- * @author Marc Johnson (mjohnson at apache dot org)
*/
final class PropertyFactory {
@@ -69,7 +67,7 @@ final class PropertyFactory {
properties.add(null);
break;
}
-
+
offset += POIFSConstants.PROPERTY_SIZE;
}
}
Modified: poi/trunk/poi/src/main/java/org/apache/poi/poifs/storage/BlockWritable.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/poifs/storage/BlockWritable.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/poifs/storage/BlockWritable.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/poifs/storage/BlockWritable.java Wed Apr 14 22:53:33 2021
@@ -15,7 +15,7 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
+
package org.apache.poi.poifs.storage;
@@ -24,12 +24,8 @@ import java.io.OutputStream;
/**
* An interface for persisting block storage of POIFS components.
- *
- * @author Marc Johnson (mjohnson at apache dot org)
*/
-
-public interface BlockWritable
-{
+public interface BlockWritable {
/**
* Write the storage to an OutputStream
Modified: poi/trunk/poi/src/main/java/org/apache/poi/poifs/storage/HeaderBlockConstants.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/poifs/storage/HeaderBlockConstants.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/poifs/storage/HeaderBlockConstants.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/poifs/storage/HeaderBlockConstants.java Wed Apr 14 22:53:33 2021
@@ -22,8 +22,6 @@ import org.apache.poi.util.LittleEndianC
/**
* Constants used in reading/writing the Header block
- *
- * @author Marc Johnson (mjohnson at apache dot org)
*/
public interface HeaderBlockConstants
{
@@ -37,7 +35,7 @@ public interface HeaderBlockConstants
// BAT ~= FAT
// SBAT ~= MiniFAT
// XBAT ~= DIFat
-
+
// useful offsets
int _signature_offset = 0;
int _bat_count_offset = 0x2C;
Modified: poi/trunk/poi/src/main/java/org/apache/poi/sl/usermodel/ShapeContainer.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/sl/usermodel/ShapeContainer.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/sl/usermodel/ShapeContainer.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/sl/usermodel/ShapeContainer.java Wed Apr 14 22:53:33 2021
@@ -41,7 +41,7 @@ public interface ShapeContainer<
* it is unchanged.
*
* @param shape the shape to be removed from this sheet, if present
- * @return <tt>true</tt> if this sheet contained the specified element
+ * @return {@code true} if this sheet contained the specified element
* @throws IllegalArgumentException if the type of the specified shape
* is incompatible with this sheet (optional)
*/
@@ -61,22 +61,22 @@ public interface ShapeContainer<
* create a text box
*/
TextBox<S,P> createTextBox();
-
+
/**
* create a connector
*/
ConnectorShape<S,P> createConnector();
-
+
/**
* create a group of shapes belonging to this container
*/
GroupShape<S,P> createGroup();
-
+
/**
* create a picture belonging to this container
*/
PictureShape<S,P> createPicture(PictureData pictureData);
-
+
/**
* Create a new Table of the given number of rows and columns
*
@@ -84,7 +84,7 @@ public interface ShapeContainer<
* @param numCols the number of columns
*/
TableShape<S,P> createTable(int numRows, int numCols);
-
+
/**
* Create a new OLE object shape with the given pictureData as preview image
*
Modified: poi/trunk/poi/src/main/java/org/apache/poi/sl/usermodel/VerticalAlignment.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/sl/usermodel/VerticalAlignment.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/sl/usermodel/VerticalAlignment.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/sl/usermodel/VerticalAlignment.java Wed Apr 14 22:53:33 2021
@@ -20,11 +20,9 @@ package org.apache.poi.sl.usermodel;
/**
* Specifies a list of available anchoring types for text
- *
+ *
* <!-- FIXME: Identical to {@link org.apache.poi.ss.usermodel.VerticalAlignment}. Should merge these to
* {@link org.apache.poi.common.usermodel}.VerticalAlignment in the future. -->
- *
- * @author Yegor Kozlov
*/
public enum VerticalAlignment {
/**
Modified: poi/trunk/poi/src/main/java/org/apache/poi/ss/format/CellDateFormatter.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/ss/format/CellDateFormatter.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/ss/format/CellDateFormatter.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/ss/format/CellDateFormatter.java Wed Apr 14 22:53:33 2021
@@ -162,7 +162,7 @@ public class CellDateFormatter extends C
dateFmt.setTimeZone(LocaleUtil.getUserTimeZone());
}
- /** {@inheritDoc} */
+ @Override
public synchronized void formatValue(StringBuffer toAppendTo, Object value) {
if (value == null)
value = 0.0;
@@ -221,8 +221,9 @@ public class CellDateFormatter extends C
/**
* {@inheritDoc}
* <p>
- * For a date, this is <tt>"mm/d/y"</tt>.
+ * For a date, this is {@code "mm/d/y"}.
*/
+ @Override
public void simpleValue(StringBuffer toAppendTo, Object value) {
synchronized (CellDateFormatter.class) {
if (SIMPLE_DATE == null || !SIMPLE_DATE.EXCEL_EPOCH_CAL.equals(EXCEL_EPOCH_CAL)) {
Modified: poi/trunk/poi/src/main/java/org/apache/poi/ss/format/CellElapsedFormatter.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/ss/format/CellElapsedFormatter.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/ss/format/CellElapsedFormatter.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/ss/format/CellElapsedFormatter.java Wed Apr 14 22:53:33 2021
@@ -26,8 +26,6 @@ import java.util.regex.Pattern;
/**
* This class implements printing out an elapsed time format.
- *
- * @author Ken Arnold, Industrious Media LLC
*/
public class CellElapsedFormatter extends CellFormatter {
private final List<TimeSpec> specs;
@@ -74,6 +72,7 @@ public class CellElapsedFormatter extend
// only special character for this is '%', so we have to handle all the
// quoting in this method ourselves.
+ @Override
public String handlePart(Matcher m, String part, CellFormatType type,
StringBuffer desc) {
@@ -186,7 +185,7 @@ public class CellElapsedFormatter extend
}
}
- /** {@inheritDoc} */
+ @Override
public void formatValue(StringBuffer toAppendTo, Object value) {
double elapsed = ((Number) value).doubleValue();
@@ -208,8 +207,9 @@ public class CellElapsedFormatter extend
/**
* {@inheritDoc}
* <p>
- * For a date, this is <tt>"mm/d/y"</tt>.
+ * For a date, this is {@code "mm/d/y"}.
*/
+ @Override
public void simpleValue(StringBuffer toAppendTo, Object value) {
formatValue(toAppendTo, value);
}
Modified: poi/trunk/poi/src/main/java/org/apache/poi/ss/format/CellFormat.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/ss/format/CellFormat.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/ss/format/CellFormat.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/ss/format/CellFormat.java Wed Apr 14 22:53:33 2021
@@ -48,17 +48,17 @@ import org.apache.poi.util.LocaleUtil;
* specifies what to do with particular kinds of values, depending on the number
* of parts given:
* <dl>
- * <dt>One part (example: <tt>[Green]#.##</tt>)</dt>
+ * <dt>One part (example: {@code [Green]#.##})</dt>
* <dd>If the value is a number, display according to this one part (example: green text,
* with up to two decimal points). If the value is text, display it as is.</dd>
*
- * <dt>Two parts (example: <tt>[Green]#.##;[Red]#.##</tt>)</dt>
+ * <dt>Two parts (example: {@code [Green]#.##;[Red]#.##})</dt>
* <dd>If the value is a positive number or zero, display according to the first part (example: green
* text, with up to two decimal points); if it is a negative number, display
* according to the second part (example: red text, with up to two decimal
* points). If the value is text, display it as is.</dd>
*
- * <dt>Three parts (example: <tt>[Green]#.##;[Black]#.##;[Red]#.##</tt>)</dt>
+ * <dt>Three parts (example: {@code [Green]#.##;[Black]#.##;[Red]#.##})</dt>
* <dd>If the value is a positive
* number, display according to the first part (example: green text, with up to
* two decimal points); if it is zero, display according to the second part
@@ -66,7 +66,7 @@ import org.apache.poi.util.LocaleUtil;
* number, display according to the third part (example: red text, with up to
* two decimal points). If the value is text, display it as is.</dd>
*
- * <dt>Four parts (example: <tt>[Green]#.##;[Black]#.##;[Red]#.##;[@]</tt>)</dt>
+ * <dt>Four parts (example: {@code [Green]#.##;[Black]#.##;[Red]#.##;[@]})</dt>
* <dd>If the value is a positive number, display according to the first part (example: green text,
* with up to two decimal points); if it is zero, display according to the
* second part (example: black text, with up to two decimal points); if it is a
@@ -77,7 +77,7 @@ import org.apache.poi.util.LocaleUtil;
* </dl>
* <p>
* A given format part may specify a given Locale, by including something
- * like <tt>[$$-409]</tt> or <tt>[$£-809]</tt> or <tt>[$-40C]</tt>. These
+ * like {@code [$$-409]} or {@code [$£-809]} or {@code [$-40C]}. These
* are (currently) largely ignored. You can use {@link DateFormatConverter}
* to look these up into Java Locales if desired.
* <p>
@@ -136,25 +136,25 @@ public class CellFormat {
new WeakHashMap<>();
/**
- * Returns a {@link CellFormat} that applies the given format. Two calls
+ * Returns a CellFormat that applies the given format. Two calls
* with the same format may or may not return the same object.
*
* @param format The format.
*
- * @return A {@link CellFormat} that applies the given format.
+ * @return A CellFormat that applies the given format.
*/
public static CellFormat getInstance(String format) {
return getInstance(LocaleUtil.getUserLocale(), format);
}
/**
- * Returns a {@link CellFormat} that applies the given format. Two calls
+ * Returns a CellFormat that applies the given format. Two calls
* with the same format may or may not return the same object.
*
* @param locale The locale.
* @param format The format.
*
- * @return A {@link CellFormat} that applies the given format.
+ * @return A CellFormat that applies the given format.
*/
public static synchronized CellFormat getInstance(Locale locale, String format) {
Map<String, CellFormat> formatMap = formatCache.computeIfAbsent(locale, k -> new WeakHashMap<>());
@@ -255,7 +255,7 @@ public class CellFormat {
} else if (value instanceof java.util.Date) {
// Don't know (and can't get) the workbook date windowing (1900 or 1904)
// so assume 1900 date windowing
- Double numericValue = DateUtil.getExcelDate((Date) value);
+ double numericValue = DateUtil.getExcelDate((Date) value);
if (DateUtil.isValidExcelDate(numericValue)) {
return getApplicableFormatPart(numericValue).apply(value);
} else {
@@ -294,7 +294,7 @@ public class CellFormat {
case BOOLEAN:
return apply(c.getBooleanCellValue());
case NUMERIC:
- Double value = c.getNumericCellValue();
+ double value = c.getNumericCellValue();
if (getApplicableFormatPart(value).getCellFormatType() == CellFormatType.DATE) {
if (DateUtil.isValidExcelDate(value)) {
return apply(c.getDateCellValue(), value);
@@ -364,7 +364,7 @@ public class CellFormat {
case BOOLEAN:
return apply(label, c.getBooleanCellValue());
case NUMERIC:
- Double value = c.getNumericCellValue();
+ double value = c.getNumericCellValue();
if (getApplicableFormatPart(value).getCellFormatType() == CellFormatType.DATE) {
if (DateUtil.isValidExcelDate(value)) {
return apply(label, c.getDateCellValue(), value);
@@ -450,12 +450,12 @@ public class CellFormat {
}
/**
- * Returns <tt>true</tt> if the other object is a {@link CellFormat} object
+ * Returns {@code true} if the other object is a CellFormat object
* with the same format.
*
* @param obj The other object.
*
- * @return <tt>true</tt> if the two objects are equal.
+ * @return {@code true} if the two objects are equal.
*/
@Override
public boolean equals(Object obj) {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org