diff options
author | Andreas Beeker <kiwiwings@apache.org> | 2021-04-14 22:53:33 +0000 |
---|---|---|
committer | Andreas Beeker <kiwiwings@apache.org> | 2021-04-14 22:53:33 +0000 |
commit | bb5d321b79193b98051f435621f5044842716c4e (patch) | |
tree | bec508518798239131c7cdf3825d4328a7d0e831 | |
parent | 7c67bba960e46433d8bf11674ef862153403cfdc (diff) | |
download | poi-bb5d321b79193b98051f435621f5044842716c4e.tar.gz poi-bb5d321b79193b98051f435621f5044842716c4e.zip |
fix javadocs - remove @author tags (http://apache-poi.1045710.n5.nabble.com/Javadocs-clean-up-remove-author-tags-tp5737663.html)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1888780 13f79535-47bb-0310-9956-ffa450edef68
730 files changed, 1934 insertions, 3378 deletions
diff --git a/poi-examples/src/main/java/org/apache/poi/examples/hslf/ApacheconEU08.java b/poi-examples/src/main/java/org/apache/poi/examples/hslf/ApacheconEU08.java index 53d3c46077..e71ec75b10 100644 --- a/poi-examples/src/main/java/org/apache/poi/examples/hslf/ApacheconEU08.java +++ b/poi-examples/src/main/java/org/apache/poi/examples/hslf/ApacheconEU08.java @@ -45,8 +45,6 @@ import org.apache.poi.sl.usermodel.VerticalAlignment; /** * Presentation for Fast Feather Track on ApacheconEU 2008 - * - * @author Yegor Kozlov */ @SuppressWarnings("java:S1192") public final class ApacheconEU08 { diff --git a/poi-examples/src/main/java/org/apache/poi/examples/hssf/eventusermodel/XLS2CSVmra.java b/poi-examples/src/main/java/org/apache/poi/examples/hssf/eventusermodel/XLS2CSVmra.java index a0b393cf5b..a608499e67 100644 --- a/poi-examples/src/main/java/org/apache/poi/examples/hssf/eventusermodel/XLS2CSVmra.java +++ b/poi-examples/src/main/java/org/apache/poi/examples/hssf/eventusermodel/XLS2CSVmra.java @@ -50,7 +50,6 @@ import org.apache.poi.poifs.filesystem.POIFSFileSystem; /** * A XLS -> CSV processor, that uses the MissingRecordAware * EventModel code to ensure it outputs all columns and rows. - * @author Nick Burch */ @SuppressWarnings({"java:S106","java:S4823"}) public class XLS2CSVmra implements HSSFListener { diff --git a/poi-examples/src/main/java/org/apache/poi/examples/hssf/usermodel/Alignment.java b/poi-examples/src/main/java/org/apache/poi/examples/hssf/usermodel/Alignment.java index 25affcb0f8..253dbaba97 100644 --- a/poi-examples/src/main/java/org/apache/poi/examples/hssf/usermodel/Alignment.java +++ b/poi-examples/src/main/java/org/apache/poi/examples/hssf/usermodel/Alignment.java @@ -31,8 +31,6 @@ import org.apache.poi.ss.usermodel.HorizontalAlignment; /** * Shows how various alignment options work. - * - * @author Glen Stampoultzis (glens at apache.org) */ public class Alignment { public static void main(String[] args) throws IOException { diff --git a/poi-examples/src/main/java/org/apache/poi/examples/hssf/usermodel/CreateCells.java b/poi-examples/src/main/java/org/apache/poi/examples/hssf/usermodel/CreateCells.java index 8994d6f17e..c12884f743 100644 --- a/poi-examples/src/main/java/org/apache/poi/examples/hssf/usermodel/CreateCells.java +++ b/poi-examples/src/main/java/org/apache/poi/examples/hssf/usermodel/CreateCells.java @@ -27,8 +27,6 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook; /** * Illustrates how to create cell values. - * - * @author Glen Stampoultzis (glens at apache.org) */ public class CreateCells { public static void main(String[] args) throws IOException { diff --git a/poi-examples/src/main/java/org/apache/poi/examples/hssf/usermodel/InCellLists.java b/poi-examples/src/main/java/org/apache/poi/examples/hssf/usermodel/InCellLists.java index 76d0172f82..cfec4222d8 100644 --- a/poi-examples/src/main/java/org/apache/poi/examples/hssf/usermodel/InCellLists.java +++ b/poi-examples/src/main/java/org/apache/poi/examples/hssf/usermodel/InCellLists.java @@ -46,8 +46,6 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook; * are not strictly necessary. If the inputs to the listInCell() and * multilLevelListInCell() methods are constructed to include the bullet * character or the item numbers then these methods alone may be sufficient. - * - * @author Mark Beardsley [msb at apache.org] */ @SuppressWarnings({"java:S106","java:S4823"}) public class InCellLists { diff --git a/poi-examples/src/main/java/org/apache/poi/examples/hssf/usermodel/OfficeDrawingWithGraphics.java b/poi-examples/src/main/java/org/apache/poi/examples/hssf/usermodel/OfficeDrawingWithGraphics.java index eca55d4378..61f536f6f7 100644 --- a/poi-examples/src/main/java/org/apache/poi/examples/hssf/usermodel/OfficeDrawingWithGraphics.java +++ b/poi-examples/src/main/java/org/apache/poi/examples/hssf/usermodel/OfficeDrawingWithGraphics.java @@ -35,8 +35,6 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook; /** * Demonstrates the use of the EscherGraphics2d library. - * - * @author Glen Stampoultzis (glens at apache.org) */ public class OfficeDrawingWithGraphics { public static void main( String[] args ) throws IOException { diff --git a/poi-examples/src/main/java/org/apache/poi/examples/hssf/usermodel/ReadWriteWorkbook.java b/poi-examples/src/main/java/org/apache/poi/examples/hssf/usermodel/ReadWriteWorkbook.java index e36b7ad26c..873fde498f 100644 --- a/poi-examples/src/main/java/org/apache/poi/examples/hssf/usermodel/ReadWriteWorkbook.java +++ b/poi-examples/src/main/java/org/apache/poi/examples/hssf/usermodel/ReadWriteWorkbook.java @@ -30,8 +30,6 @@ import org.apache.poi.poifs.filesystem.POIFSFileSystem; /** * This example demonstrates opening a workbook, modifying it and writing * the results back out. - * - * @author Glen Stampoultzis (glens at apache.org) */ public class ReadWriteWorkbook { public static void main(String[] args) throws IOException { diff --git a/poi-examples/src/main/java/org/apache/poi/examples/hssf/usermodel/ZoomSheet.java b/poi-examples/src/main/java/org/apache/poi/examples/hssf/usermodel/ZoomSheet.java index e958489cf7..a3ddcc2f5f 100644 --- a/poi-examples/src/main/java/org/apache/poi/examples/hssf/usermodel/ZoomSheet.java +++ b/poi-examples/src/main/java/org/apache/poi/examples/hssf/usermodel/ZoomSheet.java @@ -27,8 +27,6 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook; /** * Sets the zoom magnication for a sheet. - * - * @author Glen Stampoultzis (glens at apache.org) */ public class ZoomSheet { diff --git a/poi-examples/src/main/java/org/apache/poi/examples/ss/AddDimensionedImage.java b/poi-examples/src/main/java/org/apache/poi/examples/ss/AddDimensionedImage.java index 6e102038b6..c35e636304 100644 --- a/poi-examples/src/main/java/org/apache/poi/examples/ss/AddDimensionedImage.java +++ b/poi-examples/src/main/java/org/apache/poi/examples/ss/AddDimensionedImage.java @@ -180,7 +180,6 @@ import org.apache.poi.util.IOUtils; * grow in size of the column is made wider or the row higher but it will shrink * if the columns width or rows height are reduced. * - * @author Mark Beardsley [msb at apache.org] and Mark Southern [southern at scripps.edu] * @version 1.00 5th August 2009. * 2.00 26th February 2010. * Ported to make use of the the SS usermodel classes. @@ -859,7 +858,6 @@ public class AddDimensionedImage { * either how far the image should be inset from the top or the left hand * edge of the cell. * - * @author Mark Beardsley [msb at apache.org] * @version 1.00 5th August 2009. */ public class ClientAnchorDetail { @@ -928,7 +926,6 @@ public class AddDimensionedImage { * size measurements into pixels and/or millimetres. The class also contains * various constants that are required in other calculations. * - * @author xio[darjino@hotmail.com] * @version 1.01 30th July 2009. * Added by Mark Beardsley [msb at apache.org]. * Additional constants. diff --git a/poi-examples/src/main/java/org/apache/poi/examples/ss/BusinessPlan.java b/poi-examples/src/main/java/org/apache/poi/examples/ss/BusinessPlan.java index a4865a32a3..e9fe39c173 100644 --- a/poi-examples/src/main/java/org/apache/poi/examples/ss/BusinessPlan.java +++ b/poi-examples/src/main/java/org/apache/poi/examples/ss/BusinessPlan.java @@ -44,8 +44,6 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook; * A business plan demo * Usage: * BusinessPlan -xls|xlsx - * - * @author Yegor Kozlov */ @SuppressWarnings({"java:S106","java:S4823","java:S1192"}) public final class BusinessPlan { diff --git a/poi-examples/src/main/java/org/apache/poi/examples/ss/CalendarDemo.java b/poi-examples/src/main/java/org/apache/poi/examples/ss/CalendarDemo.java index ead4093ac4..da16f7290a 100644 --- a/poi-examples/src/main/java/org/apache/poi/examples/ss/CalendarDemo.java +++ b/poi-examples/src/main/java/org/apache/poi/examples/ss/CalendarDemo.java @@ -45,8 +45,6 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook; * Usage: * CalendarDemo -xls|xlsx <year> * </pre> - * - * @author Yegor Kozlov */ @SuppressWarnings({"java:S106","java:S4823","java:S1192"}) public final class CalendarDemo { diff --git a/poi-examples/src/main/java/org/apache/poi/examples/ss/LinkedDropDownLists.java b/poi-examples/src/main/java/org/apache/poi/examples/ss/LinkedDropDownLists.java index 5cbc63be60..106b3c14f9 100644 --- a/poi-examples/src/main/java/org/apache/poi/examples/ss/LinkedDropDownLists.java +++ b/poi-examples/src/main/java/org/apache/poi/examples/ss/LinkedDropDownLists.java @@ -60,7 +60,6 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook; * better to include the name of the sheet when calling the setRefersToFormula() * method. * - * @author Mark Beardsley [msb at apache.org] * @version 1.00 30th March 2012 */ public class LinkedDropDownLists { diff --git a/poi-examples/src/main/java/org/apache/poi/examples/ss/LoanCalculator.java b/poi-examples/src/main/java/org/apache/poi/examples/ss/LoanCalculator.java index 28d1c648f0..26d12f3f12 100644 --- a/poi-examples/src/main/java/org/apache/poi/examples/ss/LoanCalculator.java +++ b/poi-examples/src/main/java/org/apache/poi/examples/ss/LoanCalculator.java @@ -42,8 +42,6 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook; * * Usage: * LoanCalculator -xls|xlsx - * - * @author Yegor Kozlov */ @SuppressWarnings({"java:S106","java:S4823","java:S1192"}) public final class LoanCalculator { diff --git a/poi-examples/src/main/java/org/apache/poi/examples/ss/TimesheetDemo.java b/poi-examples/src/main/java/org/apache/poi/examples/ss/TimesheetDemo.java index 77b55c826d..59407551b0 100644 --- a/poi-examples/src/main/java/org/apache/poi/examples/ss/TimesheetDemo.java +++ b/poi-examples/src/main/java/org/apache/poi/examples/ss/TimesheetDemo.java @@ -41,8 +41,6 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook; * A weekly timesheet created using Apache POI. * Usage: * TimesheetDemo -xls|xlsx - * - * @author Yegor Kozlov */ @SuppressWarnings({"java:S106","java:S4823","java:S1192"}) public final class TimesheetDemo { diff --git a/poi-examples/src/main/java/org/apache/poi/examples/ss/ToCSV.java b/poi-examples/src/main/java/org/apache/poi/examples/ss/ToCSV.java index 1c39838cd3..c38709bbfc 100644 --- a/poi-examples/src/main/java/org/apache/poi/examples/ss/ToCSV.java +++ b/poi-examples/src/main/java/org/apache/poi/examples/ss/ToCSV.java @@ -118,7 +118,7 @@ import org.apache.poi.ss.usermodel.WorkbookFactory; * class has to be modified to produce files to suit a specific application * or requirement. * </p> - * @author Mark B + * * @version 1.00 9th April 2010 * 1.10 13th April 2010 - Added support for processing all Excel * workbooks in a folder along with the ability diff --git a/poi-examples/src/main/java/org/apache/poi/examples/ss/formula/CalculateMortgage.java b/poi-examples/src/main/java/org/apache/poi/examples/ss/formula/CalculateMortgage.java index 2675df181b..fc08d18aa9 100644 --- a/poi-examples/src/main/java/org/apache/poi/examples/ss/formula/CalculateMortgage.java +++ b/poi-examples/src/main/java/org/apache/poi/examples/ss/formula/CalculateMortgage.java @@ -26,10 +26,6 @@ import org.apache.poi.ss.formula.functions.FreeRefFunction; /** * A simple user-defined function to calculate principal and interest. - * - * @author Jon Svede ( jon [at] loquatic [dot] com ) - * @author Brian Bush ( brian [dot] bush [at] nrel [dot] gov ) - * */ public class CalculateMortgage implements FreeRefFunction { @@ -81,7 +77,7 @@ public class CalculateMortgage implements FreeRefFunction { /** * Excel does not support infinities and NaNs, rather, it gives a #NUM! error in these cases * - * @throws EvaluationException (#NUM!) if <tt>result</tt> is <tt>NaN</> or <tt>Infinity</tt> + * @throws EvaluationException (#NUM!) if {@code result} is {@code NaN} or {@code Infinity} */ private void checkValue(double result) throws EvaluationException { if (Double.isNaN(result) || Double.isInfinite(result)) { diff --git a/poi-examples/src/main/java/org/apache/poi/examples/ss/html/HtmlHelper.java b/poi-examples/src/main/java/org/apache/poi/examples/ss/html/HtmlHelper.java index 8747ad4c9d..e8efd40ad7 100644 --- a/poi-examples/src/main/java/org/apache/poi/examples/ss/html/HtmlHelper.java +++ b/poi-examples/src/main/java/org/apache/poi/examples/ss/html/HtmlHelper.java @@ -26,8 +26,6 @@ import org.apache.poi.ss.usermodel.CellStyle; * formats. If you are writing such code, you can add a method to this * interface, and then implement it for both HSSF and XSSF workbooks, letting * the driving code stay independent of format. - * - * @author Ken Arnold, Industrious Media LLC */ public interface HtmlHelper { /** diff --git a/poi-examples/src/main/java/org/apache/poi/examples/ss/html/ToHtml.java b/poi-examples/src/main/java/org/apache/poi/examples/ss/html/ToHtml.java index 65c8878916..5097f34e98 100644 --- a/poi-examples/src/main/java/org/apache/poi/examples/ss/html/ToHtml.java +++ b/poi-examples/src/main/java/org/apache/poi/examples/ss/html/ToHtml.java @@ -125,7 +125,7 @@ public final class ToHtml { /** * Creates a new examples to HTML for the given workbook. If the path ends - * with "<tt>.xlsx</tt>" an {@link XSSFWorkbook} will be used; otherwise + * with "{@code .xlsx}" an {@link XSSFWorkbook} will be used; otherwise * this will use an {@link HSSFWorkbook}. * * @param path The file that has the workbook. diff --git a/poi-examples/src/main/java/org/apache/poi/examples/ss/html/XSSFHtmlHelper.java b/poi-examples/src/main/java/org/apache/poi/examples/ss/html/XSSFHtmlHelper.java index 40bd504818..9784e5dace 100644 --- a/poi-examples/src/main/java/org/apache/poi/examples/ss/html/XSSFHtmlHelper.java +++ b/poi-examples/src/main/java/org/apache/poi/examples/ss/html/XSSFHtmlHelper.java @@ -24,8 +24,6 @@ import org.apache.poi.xssf.usermodel.XSSFColor; /** * Implementation of {@link HtmlHelper} for XSSF files. - * - * @author Ken Arnold, Industrious Media LLC */ public class XSSFHtmlHelper implements HtmlHelper { @Override diff --git a/poi-examples/src/main/java/org/apache/poi/examples/xssf/usermodel/BigGridDemo.java b/poi-examples/src/main/java/org/apache/poi/examples/xssf/usermodel/BigGridDemo.java index 574458f7be..c969ad9bea 100644 --- a/poi-examples/src/main/java/org/apache/poi/examples/xssf/usermodel/BigGridDemo.java +++ b/poi-examples/src/main/java/org/apache/poi/examples/xssf/usermodel/BigGridDemo.java @@ -49,22 +49,19 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook; /** * Demonstrates a workaround you can use to generate large workbooks and avoid OutOfMemory exception. - * + * <p> * Note - You probably <em>don't want to use this approach any more</em>! POI * now includes the SXSSF which handles all of this for you, you should * be using that instead! This code remains mostly for historical interest. * <p> - * See <a "https://poi.apache.org/spreadsheet/how-to.html#sxssf"> - * https://poi.apache.org/spreadsheet/how-to.html#sxssf</a>. - * <p> * If you really want to use this approach, which is also the one that SXSSF * does for you, it works as follows: + * <ol> + * <li>create a template workbook, create sheets and global objects such as cell styles, number formats, etc.</li> + * <li>create an application that streams data in a text file</li> + * <li>Substitute the sheet in the template with the generated data</li> + * </ol> * - * 1. create a template workbook, create sheets and global objects such as cell styles, number formats, etc. - * 2. create an application that streams data in a text file - * 3. Substitute the sheet in the template with the generated data - * - * <p> * Since 3.8 POI provides a low-memory footprint SXSSF API, which implements * ths "BigGridDemo" strategy. SXSSF is an API-compatible streaming extension * of XSSF to be used when very large spreadsheets have to be produced, and @@ -72,9 +69,8 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook; * access to the rows that are within a sliding window, while XSSF gives access * to all rows in the document. Older rows that are no longer in the window * become inaccessible, as they are written to the disk. - * </p> - * See <a "https://poi.apache.org/spreadsheet/how-to.html#sxssf"> - * https://poi.apache.org/spreadsheet/how-to.html#sxssf</a>. + * + * @see <a href="https://poi.apache.org/spreadsheet/how-to.html#sxssf">SXSSF (Streaming Usermodel API)</a>. */ public final class BigGridDemo { private static final String XML_ENCODING = "UTF-8"; diff --git a/poi-examples/src/main/java/org/apache/poi/examples/xssf/usermodel/CalendarDemo.java b/poi-examples/src/main/java/org/apache/poi/examples/xssf/usermodel/CalendarDemo.java index fa06960bfc..9f0da5e740 100644 --- a/poi-examples/src/main/java/org/apache/poi/examples/xssf/usermodel/CalendarDemo.java +++ b/poi-examples/src/main/java/org/apache/poi/examples/xssf/usermodel/CalendarDemo.java @@ -47,8 +47,6 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook; * Usage: * CalendarDemo <year> * </pre> - * - * @author Yegor Kozlov */ public class CalendarDemo { diff --git a/poi-examples/src/main/java/org/apache/poi/examples/xssf/usermodel/CellComments.java b/poi-examples/src/main/java/org/apache/poi/examples/xssf/usermodel/CellComments.java index eb5757779c..c91bc462af 100644 --- a/poi-examples/src/main/java/org/apache/poi/examples/xssf/usermodel/CellComments.java +++ b/poi-examples/src/main/java/org/apache/poi/examples/xssf/usermodel/CellComments.java @@ -39,8 +39,6 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook; * Excel comment is a kind of a text shape, * so inserting a comment is very similar to placing a text box in a worksheet * </p> - * - * @author Yegor Kozlov */ public class CellComments { public static void main(String[] args) throws IOException { diff --git a/poi-examples/src/main/java/org/apache/poi/examples/xwpf/usermodel/SimpleDocumentWithHeader.java b/poi-examples/src/main/java/org/apache/poi/examples/xwpf/usermodel/SimpleDocumentWithHeader.java index 659f6b6f39..baed0ce3a2 100644 --- a/poi-examples/src/main/java/org/apache/poi/examples/xwpf/usermodel/SimpleDocumentWithHeader.java +++ b/poi-examples/src/main/java/org/apache/poi/examples/xwpf/usermodel/SimpleDocumentWithHeader.java @@ -28,11 +28,6 @@ import org.apache.poi.xwpf.usermodel.XWPFRun; import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP; import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTText; -/** - * - * @author Richard Ngo - * - */ public class SimpleDocumentWithHeader { public static void main(String[] args) throws IOException { diff --git a/poi-examples/src/main/java/org/apache/poi/examples/xwpf/usermodel/SimpleTable.java b/poi-examples/src/main/java/org/apache/poi/examples/xwpf/usermodel/SimpleTable.java index 4b9e51e1d1..2f52b627aa 100644 --- a/poi-examples/src/main/java/org/apache/poi/examples/xwpf/usermodel/SimpleTable.java +++ b/poi-examples/src/main/java/org/apache/poi/examples/xwpf/usermodel/SimpleTable.java @@ -45,9 +45,6 @@ import org.openxmlformats.schemas.wordprocessingml.x2006.main.STVerticalJc; * that not all referenced wordprocessingml classes are defined in the * poi-ooxml-lite jar. If this is the case, you'll need to use the * poi-ooxml-full jar library. - * - * @author gisella bronzetti (original) - * @author Gregg Morris (styled table) */ public class SimpleTable { diff --git a/poi-examples/src/main/ruby/java/org/apache/poi/RubyOutputStream.java b/poi-examples/src/main/ruby/java/org/apache/poi/RubyOutputStream.java index e23a0a7d39..0c99f094a8 100644 --- a/poi-examples/src/main/ruby/java/org/apache/poi/RubyOutputStream.java +++ b/poi-examples/src/main/ruby/java/org/apache/poi/RubyOutputStream.java @@ -23,7 +23,6 @@ import java.io.OutputStream; import java.io.IOException; /** - * @author aviks * Wrap a java.io.OutputStream around a Ruby IO object */ diff --git a/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntEvaluateCell.java b/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntEvaluateCell.java index eb446dfde6..fe4109d945 100644 --- a/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntEvaluateCell.java +++ b/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntEvaluateCell.java @@ -29,11 +29,6 @@ import org.apache.tools.ant.Task; * by a WorkbookUtil instance. The evaluate() method of the WorkbookUtil * class returns an EvaluationResult which encapsulates the results and * information from the evaluation. - * - * @author Jon Svede ( jon [at] loquatic [dot] com ) - * @author Brian Bush ( brian [dot] bush [at] nrel [dot] gov ) - - * */ public class ExcelAntEvaluateCell extends Task { diff --git a/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntHandlerTask.java b/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntHandlerTask.java index 75892aa738..23c2583da8 100644 --- a/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntHandlerTask.java +++ b/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntHandlerTask.java @@ -39,10 +39,6 @@ import org.apache.tools.ant.Task; * <code>IExcelAntWorkbookHandler</code> interface. After writing the * class you should package it and it's dependencies into a jar file to * add as library in your Ant build file. - * - * @author Jon Svede ( jon [at] loquatic [dot] com ) - * @author Brian Bush ( brian [dot] bush [at] nrel [dot] gov ) - * */ public class ExcelAntHandlerTask extends Task { diff --git a/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntPrecision.java b/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntPrecision.java index 0739ef5833..f6fd1446af 100644 --- a/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntPrecision.java +++ b/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntPrecision.java @@ -19,20 +19,14 @@ package org.apache.poi.ss.excelant; import org.apache.tools.ant.taskdefs.Typedef; -/** - * - * @author Jon Svede ( jon [at] loquatic [dot] com ) - * @author Brian Bush ( brian [dot] bush [at] nrel [dot] gov ) - * - */ public class ExcelAntPrecision extends Typedef { - + private double value ; - + public void setValue( double precision ) { value = precision ; } - + public double getValue() { return value ; } diff --git a/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntSet.java b/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntSet.java index e62f0623d9..b8a75d5ad8 100644 --- a/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntSet.java +++ b/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntSet.java @@ -20,27 +20,21 @@ package org.apache.poi.ss.excelant; import org.apache.poi.ss.excelant.util.ExcelAntWorkbookUtil; import org.apache.tools.ant.Task; -/** - * - * @author Jon Svede ( jon [at] loquatic [dot] com ) - * @author Brian Bush ( brian [dot] bush [at] nrel [dot] gov ) - * - */ public abstract class ExcelAntSet extends Task { - + protected String cellStr ; - + protected ExcelAntWorkbookUtil wbUtil ; - + public void setCell( String cellName ) { cellStr = cellName ; } - + public String getCell() { return cellStr ; } - - + + public void setWorkbookUtil( ExcelAntWorkbookUtil wb ) { wbUtil = wb ; } diff --git a/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntSetDoubleCell.java b/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntSetDoubleCell.java index 2451a61e68..4908646289 100644 --- a/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntSetDoubleCell.java +++ b/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntSetDoubleCell.java @@ -23,16 +23,12 @@ import org.apache.tools.ant.Project; /** * Class for use in an Ant build script that sets the value of an Excel * sheet cell using the cell id ('Sheet Name'!cellId). - * - * @author Jon Svede ( jon [at] loquatic [dot] com ) - * @author Brian Bush ( brian [dot] bush [at] nrel [dot] gov ) - * */ public class ExcelAntSetDoubleCell extends ExcelAntSet { private double cellValue; - + public ExcelAntSetDoubleCell() {} - + /** * Set the value of the specified cell as the double passed in. * @param value The double-value that should be set when this task is executed. @@ -49,11 +45,11 @@ public class ExcelAntSetDoubleCell extends ExcelAntSet { public double getCellValue() { return cellValue; } - + @Override public void execute() throws BuildException { wbUtil.setDoubleValue(cellStr, cellValue ) ; - + log( "set cell " + cellStr + " to value " + cellValue + " as double.", Project.MSG_DEBUG ) ; } } diff --git a/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntSetFormulaCell.java b/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntSetFormulaCell.java index 8dc599b104..e6f2834627 100644 --- a/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntSetFormulaCell.java +++ b/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntSetFormulaCell.java @@ -23,18 +23,14 @@ import org.apache.tools.ant.Project; /** * Class for use in an Ant build script that sets the formula of an Excel * sheet cell using the cell id ('Sheet Name'!cellId). - * - * @author Jon Svede ( jon [at] loquatic [dot] com ) - * @author Brian Bush ( brian [dot] bush [at] nrel [dot] gov ) - * */ public class ExcelAntSetFormulaCell extends ExcelAntSet { - - + + private String cellValue ; - + public ExcelAntSetFormulaCell() {} - + public void setValue( String value ) { cellValue = value ; } @@ -42,12 +38,12 @@ public class ExcelAntSetFormulaCell extends ExcelAntSet { protected String getCellValue() { return cellValue; } - + @Override public void execute() throws BuildException { - + wbUtil.setFormulaValue( cellStr, cellValue ) ; - + log( "set cell " + cellStr + " to formula " + cellValue, Project.MSG_DEBUG ) ; } } diff --git a/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntSetStringCell.java b/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntSetStringCell.java index e1ab047fbf..41cae25966 100644 --- a/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntSetStringCell.java +++ b/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntSetStringCell.java @@ -23,10 +23,6 @@ import org.apache.tools.ant.Project; /** * Class for use in an Ant build script that sets the value of an Excel * sheet cell using the cell id ('Sheet Name'!cellId). - * - * @author Jon Svede ( jon [at] loquatic [dot] com ) - * @author Brian Bush ( brian [dot] bush [at] nrel [dot] gov ) - * */ public class ExcelAntSetStringCell extends ExcelAntSet { private String stringValue ; @@ -49,11 +45,11 @@ public class ExcelAntSetStringCell extends ExcelAntSet { public String getCellValue() { return stringValue; } - + @Override public void execute() throws BuildException { wbUtil.setStringValue(cellStr, stringValue ) ; - + log( "set cell " + cellStr + " to value " + stringValue + " as String.", Project.MSG_DEBUG ) ; } } diff --git a/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntTest.java b/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntTest.java index 2fd45cab15..fe7819fc41 100644 --- a/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntTest.java +++ b/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntTest.java @@ -31,10 +31,6 @@ import org.apache.tools.ant.Task; * This class represents a single test. In order for the test any and all * ExcelAntEvaluateCell evaluations must pass. Therefore it is recommended * that you use only 1 evaluator but you can use more if you choose. - * - * @author Jon Svede ( jon [at] loquatic [dot] com ) - * @author Brian Bush ( brian [dot] bush [at] nrel [dot] gov ) - * */ @SuppressWarnings("unused") public class ExcelAntTest extends Task{ diff --git a/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntUserDefinedFunction.java b/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntUserDefinedFunction.java index f96a01f996..6877da5054 100644 --- a/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntUserDefinedFunction.java +++ b/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntUserDefinedFunction.java @@ -22,10 +22,6 @@ import org.apache.tools.ant.taskdefs.Typedef; /** * This class encapsulates the Strings necessary to create the User Defined * Function instances that will be passed to POI's Evaluator instance. - * - * @author Jon Svede ( jon [at] loquatic [dot] com ) - * @author Brian Bush ( brian [dot] bush [at] nrel [dot] gov ) - * */ public class ExcelAntUserDefinedFunction extends Typedef { diff --git a/poi-excelant/src/main/java/org/apache/poi/ss/excelant/IExcelAntWorkbookHandler.java b/poi-excelant/src/main/java/org/apache/poi/ss/excelant/IExcelAntWorkbookHandler.java index c8db7008d6..b90e73fb30 100644 --- a/poi-excelant/src/main/java/org/apache/poi/ss/excelant/IExcelAntWorkbookHandler.java +++ b/poi-excelant/src/main/java/org/apache/poi/ss/excelant/IExcelAntWorkbookHandler.java @@ -21,7 +21,7 @@ import org.apache.poi.ss.usermodel.Workbook; /** - * In Excel there are many ways to handle manipulating a workbook based + * In Excel there are many ways to handle manipulating a workbook based * on some arbitrary user action (onChange, etc). You use this interface * to create classes that will handle the workbook in whatever manner is needed * that cannot be handled by POI. @@ -30,13 +30,9 @@ import org.apache.poi.ss.usermodel.Workbook; * does some calculations and updates other cells based on that change. In * ExcelAnt you would set the value of the cell then write your own handler * then call that from your Ant task after the set task. - * - * @author Jon Svede ( jon [at] loquatic [dot] com ) - * @author Brian Bush ( brian [dot] bush [at] nrel [dot] gov ) - * */ public interface IExcelAntWorkbookHandler { public void setWorkbook( Workbook workbook ) ; - + public void execute() ; } diff --git a/poi-excelant/src/main/java/org/apache/poi/ss/excelant/util/ExcelAntEvaluationResult.java b/poi-excelant/src/main/java/org/apache/poi/ss/excelant/util/ExcelAntEvaluationResult.java index 4eecd4faeb..e24952a9c5 100644 --- a/poi-excelant/src/main/java/org/apache/poi/ss/excelant/util/ExcelAntEvaluationResult.java +++ b/poi-excelant/src/main/java/org/apache/poi/ss/excelant/util/ExcelAntEvaluationResult.java @@ -20,52 +20,48 @@ package org.apache.poi.ss.excelant.util; /** * A simple class that encapsulates information about a cell evaluation * from POI. - * - * @author Jon Svede (jon [at] loquatic [dot] com) - * @author Brian Bush (brian [dot] bush [at] nrel [dot] gov) - * */ public class ExcelAntEvaluationResult { - + /** * This boolean flag is used to determine if the evaluation completed - * without error. This alone doesn't ensure that the evaluation was + * without error. This alone doesn't ensure that the evaluation was * successful. */ private boolean evaluationCompletedWithError ; - + /** * This boolean flag is used to determine if the result was within * the specified precision. */ private boolean didPass ; - + /** * This is the actual value returned from the evaluation. */ private double returnValue ; - + /** * Any error message String values that need to be returned. */ private String errorMessage ; - + /** * Stores the absolute value of the delta for this evaluation. */ private double actualDelta ; - + /** * This stores the fully qualified cell name (sheetName!cellId). */ private String cellName ; - - + + public ExcelAntEvaluationResult(boolean completedWithError, - boolean passed, - double retValue, - String errMessage, + boolean passed, + double retValue, + String errMessage, double delta, String cellId) { @@ -84,19 +80,19 @@ public class ExcelAntEvaluationResult { public String getErrorMessage() { return errorMessage; } - + public boolean didTestPass() { return didPass ; } - + public boolean evaluationCompleteWithError() { return evaluationCompletedWithError ; } - + public double getDelta() { return actualDelta ; } - + public String getCellName() { return cellName ; } @@ -108,5 +104,5 @@ public class ExcelAntEvaluationResult { + ", returnValue=" + returnValue + ", errorMessage=" + errorMessage + ", actualDelta=" + actualDelta + ", cellName=" + cellName + "]"; - } + } } diff --git a/poi-excelant/src/main/java/org/apache/poi/ss/excelant/util/ExcelAntWorkbookUtil.java b/poi-excelant/src/main/java/org/apache/poi/ss/excelant/util/ExcelAntWorkbookUtil.java index ee3f443228..69616c5310 100644 --- a/poi-excelant/src/main/java/org/apache/poi/ss/excelant/util/ExcelAntWorkbookUtil.java +++ b/poi-excelant/src/main/java/org/apache/poi/ss/excelant/util/ExcelAntWorkbookUtil.java @@ -49,10 +49,6 @@ import org.apache.tools.ant.taskdefs.Typedef; /** * A general utility class that abstracts the POI details of loading the * workbook, accessing and updating cells. - * - * @author Jon Svede (jon [at] loquatic [dot] com) - * @author Brian Bush (brian [dot] bush [at] nrel [dot] gov) - * */ public class ExcelAntWorkbookUtil extends Typedef { diff --git a/poi-excelant/src/main/java/org/apache/poi/ss/excelant/util/ExcelAntWorkbookUtilFactory.java b/poi-excelant/src/main/java/org/apache/poi/ss/excelant/util/ExcelAntWorkbookUtilFactory.java index 113f0390f7..55c4896705 100644 --- a/poi-excelant/src/main/java/org/apache/poi/ss/excelant/util/ExcelAntWorkbookUtilFactory.java +++ b/poi-excelant/src/main/java/org/apache/poi/ss/excelant/util/ExcelAntWorkbookUtilFactory.java @@ -24,10 +24,6 @@ import java.util.Map; /** * This is a factory class maps file names to WorkbookUtil instances. This * helps ExcelAnt be more efficient when being run many times in an Ant build. - * - * @author Jon Svede (jon [at] loquatic [dot] com) - * @author Brian Bush (brian [dot] bush [at] nrel [dot] gov) - * */ public final class ExcelAntWorkbookUtilFactory { diff --git a/poi-excelant/src/test/java/org/apache/poi/ss/excelant/CalculateMortgageFunction.java b/poi-excelant/src/test/java/org/apache/poi/ss/excelant/CalculateMortgageFunction.java index 73eb984db7..334079756e 100644 --- a/poi-excelant/src/test/java/org/apache/poi/ss/excelant/CalculateMortgageFunction.java +++ b/poi-excelant/src/test/java/org/apache/poi/ss/excelant/CalculateMortgageFunction.java @@ -26,12 +26,6 @@ import org.apache.poi.ss.formula.functions.FreeRefFunction; /** * A simple user-defined function to calculate principal and interest. - * - * Used by {@link org.apache.poi.ss.excelant.util.TestExcelAntWorkbookUtil}. - * - * @author Jon Svede ( jon [at] loquatic [dot] com ) - * @author Brian Bush ( brian [dot] bush [at] nrel [dot] gov ) - * */ public class CalculateMortgageFunction implements FreeRefFunction { @@ -83,7 +77,7 @@ public class CalculateMortgageFunction implements FreeRefFunction { /** * Excel does not support infinities and NaNs, rather, it gives a #NUM! error in these cases * - * @throws EvaluationException (#NUM!) if <tt>result</tt> is <tt>NaN</> or <tt>Infinity</tt> + * @throws EvaluationException (#NUM!) if {@code result} is {@code NaN} or {@code Infinity} */ private void checkValue(double result) throws EvaluationException { if (Double.isNaN(result) || Double.isInfinite(result)) { diff --git a/poi-excelant/src/test/java/org/apache/poi/ss/excelant/util/ExcelAntWorkbookUtilTestHelper.java b/poi-excelant/src/test/java/org/apache/poi/ss/excelant/util/ExcelAntWorkbookUtilTestHelper.java index 16189f1d50..862169b91e 100644 --- a/poi-excelant/src/test/java/org/apache/poi/ss/excelant/util/ExcelAntWorkbookUtilTestHelper.java +++ b/poi-excelant/src/test/java/org/apache/poi/ss/excelant/util/ExcelAntWorkbookUtilTestHelper.java @@ -22,9 +22,6 @@ import org.apache.poi.ss.usermodel.Workbook; /** * A helper class to allow testing of protected methods and constructors. - * - * @author jsvede - * */ public class ExcelAntWorkbookUtilTestHelper extends ExcelAntWorkbookUtil { @@ -46,5 +43,5 @@ public class ExcelAntWorkbookUtilTestHelper extends ExcelAntWorkbookUtil { return super.getEvaluator(excelFileName); } - + } diff --git a/poi-ooxml-full/build.gradle b/poi-ooxml-full/build.gradle index cc9fc88b53..b1fd44de93 100644 --- a/poi-ooxml-full/build.gradle +++ b/poi-ooxml-full/build.gradle @@ -139,6 +139,22 @@ tasks.withType(Jar) { destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}") } +javadoc { + failOnError = true + maxMemory = "1024M" + doFirst { + options { + if (JavaVersion.current().isJava9Compatible()) { + addBooleanOption('html5', true) + } + links 'https://xmlbeans.apache.org/docs/5.0.0/' + use = true + splitIndex = true + source = "1.8" + } + } +} + task sourceJar(type: Jar) { classifier 'sources' from sourceSets.main.allJava diff --git a/poi-ooxml/src/main/java/org/apache/poi/ooxml/POIXMLException.java b/poi-ooxml/src/main/java/org/apache/poi/ooxml/POIXMLException.java index d002fa0e84..58768db78c 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/ooxml/POIXMLException.java +++ b/poi-ooxml/src/main/java/org/apache/poi/ooxml/POIXMLException.java @@ -18,13 +18,10 @@ package org.apache.poi.ooxml; /** * Indicates a generic OOXML error. - * - * @author Yegor Kozlov */ -@SuppressWarnings("serial") public final class POIXMLException extends RuntimeException{ /** - * Create a new <code>POIXMLException</code> with no + * Create a new {@code POIXMLException} with no * detail mesage. */ public POIXMLException() { @@ -32,8 +29,8 @@ public final class POIXMLException extends RuntimeException{ } /** - * Create a new <code>POIXMLException</code> with - * the <code>String</code> specified as an error message. + * Create a new {@code POIXMLException} with + * the {@code String} specified as an error message. * * @param msg The error message for the exception. */ @@ -42,12 +39,12 @@ public final class POIXMLException extends RuntimeException{ } /** - * Create a new <code>POIXMLException</code> with - * the <code>String</code> specified as an error message and the cause. + * Create a new {@code POIXMLException} with + * the {@code String} specified as an error message and the cause. * * @param msg The error message for the exception. * @param cause the cause (which is saved for later retrieval by the - * {@link #getCause()} method). (A <tt>null</tt> value is + * {@link #getCause()} method). (A {@code null} value is * permitted, and indicates that the cause is nonexistent or * unknown.) */ @@ -56,11 +53,11 @@ public final class POIXMLException extends RuntimeException{ } /** - * Create a new <code>POIXMLException</code> with + * Create a new {@code POIXMLException} with * the specified cause. * * @param cause the cause (which is saved for later retrieval by the - * {@link #getCause()} method). (A <tt>null</tt> value is + * {@link #getCause()} method). (A {@code null} value is * permitted, and indicates that the cause is nonexistent or * unknown.) */ diff --git a/poi-ooxml/src/main/java/org/apache/poi/ooxml/util/POIXMLUnits.java b/poi-ooxml/src/main/java/org/apache/poi/ooxml/util/POIXMLUnits.java index d6e020bcc0..cc847cb2ab 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/ooxml/util/POIXMLUnits.java +++ b/poi-ooxml/src/main/java/org/apache/poi/ooxml/util/POIXMLUnits.java @@ -87,11 +87,11 @@ public class POIXMLUnits { } /** - * This type seems to be interpreted as percent value when the trailing percent sign is missing.<br/> + * This type seems to be interpreted as percent value when the trailing percent sign is missing.<p> * sample snippet from settings.xml - * <pre> - * <w:zoom w:percent="50" /> - * <pre> + * <pre>{@code + * <w:zoom w:percent="50" /> + * }</pre> * * @return the percent scaled by 1000, so 100% = 100000 */ @@ -100,11 +100,11 @@ public class POIXMLUnits { } /** - * This type seems to be interpreted as percent value when the trailing percent sign is missing.<br/> + * This type seems to be interpreted as percent value when the trailing percent sign is missing.<p> * sample snippet from settings.xml - * <pre> - * <w:textscale w:w="50" /> - * <pre> + * <pre>{@code + * <w:textscale w:w="50" /> + * }</pre> * * @return the percent scaled by 1000, so 100% = 100000 */ @@ -235,7 +235,7 @@ public class POIXMLUnits { private static long parseLengthInner(org.apache.xmlbeans.XmlAnySimpleType coordUnion, double noUnitEmuFactor) { String strVal = coordUnion.getStringValue().toLowerCase(Locale.ROOT); double digVal = Double.parseDouble(strVal.replaceAll("(mm|cm|in|pt|pc|pi)", "")); - long emu = 0; + long emu; // http://startbigthinksmall.wordpress.com/2010/01/04/points-inches-and-emus-measuring-units-in-office-open-xml/ if (strVal.endsWith("mm")) { emu = (long)(((digVal/10f)/2.54f)*EMU_PER_INCH); diff --git a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/exceptions/OpenXML4JRuntimeException.java b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/exceptions/OpenXML4JRuntimeException.java index 40086aa9fc..d8031b87a1 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/exceptions/OpenXML4JRuntimeException.java +++ b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/exceptions/OpenXML4JRuntimeException.java @@ -22,7 +22,6 @@ package org.apache.poi.openxml4j.exceptions; * set as Runtime in order not to force the user to manage the exception in a * try/catch). * - * @author Julien Chable * @version 1.0 */ @SuppressWarnings("serial") diff --git a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/CertificateEmbeddingOption.java b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/CertificateEmbeddingOption.java index cd7b456941..9c95693d8e 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/CertificateEmbeddingOption.java +++ b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/CertificateEmbeddingOption.java @@ -19,8 +19,6 @@ package org.apache.poi.openxml4j.opc; /** * Specifies the location where the X.509 certificate that is used in signing is stored. - * - * @author Julien Chable */ public enum CertificateEmbeddingOption { /** The certificate is embedded in its own PackagePart. */ diff --git a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/ContentTypes.java b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/ContentTypes.java index 14c0f1b985..5442a5fb05 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/ContentTypes.java +++ b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/ContentTypes.java @@ -22,8 +22,6 @@ import java.util.Locale; /** * Open Packaging Convention content types (see Annex F : Standard Namespaces * and Content Types). - * - * @author CDubettier define some constants, Julien Chable */ public final class ContentTypes { diff --git a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/OPCPackage.java b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/OPCPackage.java index 6e11336bf5..9c92fb5f3e 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/OPCPackage.java +++ b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/OPCPackage.java @@ -602,7 +602,7 @@ public abstract class OPCPackage implements RelationshipSource, Closeable { * * @param partName * Part name of the part to retrieve. - * @return The part with the specified name, else <code>null</code>. + * @return The part with the specified name, else {@code null}. */ public PackagePart getPart(PackagePartName partName) { throwExceptionIfWriteOnly(); @@ -958,7 +958,7 @@ public abstract class OPCPackage implements RelationshipSource, Closeable { * part, then delete all relationships in the source part. * * @param part - * The part to remove. If <code>null</code>, skip the action. + * The part to remove. If {@code null}, skip the action. * @see #removePart(PackagePartName) */ public void removePart(PackagePart part) { @@ -1217,8 +1217,6 @@ public abstract class OPCPackage implements RelationshipSource, Closeable { * @param relationshipType * Type of relationship. * @return The newly created and added relationship - * @see RelationshipSource#addExternalRelationship(String, - * String) */ @Override public PackageRelationship addExternalRelationship(String target, @@ -1347,25 +1345,16 @@ public abstract class OPCPackage implements RelationshipSource, Closeable { } } - /** - * @see RelationshipSource#getRelationship(String) - */ @Override public PackageRelationship getRelationship(String id) { return this.relationships.getRelationshipByID(id); } - /** - * @see RelationshipSource#hasRelationships() - */ @Override public boolean hasRelationships() { return (relationships.size() > 0); } - /** - * @see RelationshipSource#isRelationshipExists(PackageRelationship) - */ @Override public boolean isRelationshipExists(PackageRelationship rel) { for (PackageRelationship r : relationships) { @@ -1559,32 +1548,29 @@ public abstract class OPCPackage implements RelationshipSource, Closeable { throws InvalidFormatException; /** - * Replace a content type in this package. - * - * <p> - * A typical scneario to call this method is to rename a template file to the main format, e.g. - * ".dotx" to ".docx" - * ".dotm" to ".docm" - * ".xltx" to ".xlsx" - * ".xltm" to ".xlsm" - * ".potx" to ".pptx" - * ".potm" to ".pptm" - * </p> + * Replace a content type in this package.<p> + * A typical scneario to call this method is to rename a template file to the main format, e.g. + * <ul> + * <li>".dotx" to ".docx"</li> + * <li>".dotm" to ".docm"</li> + * <li>".xltx" to ".xlsx"</li> + * <li>".xltm" to ".xlsm"</li> + * <li>".potx" to ".pptx"</li> + * <li>".potm" to ".pptm"</li> + * </ul> * For example, a code converting a .xlsm macro workbook to .xlsx would look as follows: - * <p> - * <pre><code> + * <pre>{@code * - * OPCPackage pkg = OPCPackage.open(new FileInputStream("macro-workbook.xlsm")); - * pkg.replaceContentType( - * "application/vnd.ms-excel.sheet.macroEnabled.main+xml", - * "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"); + * OPCPackage pkg = OPCPackage.open(new FileInputStream("macro-workbook.xlsm")); + * pkg.replaceContentType( + * "application/vnd.ms-excel.sheet.macroEnabled.main+xml", + * "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"); * - * FileOutputStream out = new FileOutputStream("workbook.xlsx"); - * pkg.save(out); - * out.close(); + * FileOutputStream out = new FileOutputStream("workbook.xlsx"); + * pkg.save(out); + * out.close(); * - * </code></pre> - * </p> + * }</pre> * * @param oldContentType the content type to be replaced * @param newContentType the replacement diff --git a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/PackageAccess.java b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/PackageAccess.java index 2568822285..e2b8c22ada 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/PackageAccess.java +++ b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/PackageAccess.java @@ -19,8 +19,6 @@ package org.apache.poi.openxml4j.opc; /** * Specifies package access. - * - * @author Julien Chable * @version 1.0 */ public enum PackageAccess { diff --git a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/PackageNamespaces.java b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/PackageNamespaces.java index d1adc519fc..a4e06abecd 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/PackageNamespaces.java +++ b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/PackageNamespaces.java @@ -20,7 +20,6 @@ package org.apache.poi.openxml4j.opc; /** * Open Packaging Convention namespaces URI. * - * @author Julien Chable * @version 1.0 */ public interface PackageNamespaces { diff --git a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/PackagePart.java b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/PackagePart.java index 81519ff2a5..801b700316 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/PackagePart.java +++ b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/PackagePart.java @@ -151,9 +151,8 @@ public abstract class PackagePart implements RelationshipSource, Comparable<Pack * @param relationshipType * Type of relationship. * @return The newly created and added relationship - * @see org.apache.poi.openxml4j.opc.RelationshipSource#addExternalRelationship(java.lang.String, - * java.lang.String) */ + @Override public PackageRelationship addExternalRelationship(String target, String relationshipType) { return addExternalRelationship(target, relationshipType, null); @@ -176,6 +175,7 @@ public abstract class PackagePart implements RelationshipSource, Comparable<Pack * @see org.apache.poi.openxml4j.opc.RelationshipSource#addExternalRelationship(java.lang.String, * java.lang.String) */ + @Override public PackageRelationship addExternalRelationship(String target, String relationshipType, String id) { if (target == null) { @@ -211,9 +211,8 @@ public abstract class PackagePart implements RelationshipSource, Comparable<Pack * @param relationshipType * Type of relationship. * @return The newly created and added relationship - * @see org.apache.poi.openxml4j.opc.RelationshipSource#addRelationship(org.apache.poi.openxml4j.opc.PackagePartName, - * org.apache.poi.openxml4j.opc.TargetMode, java.lang.String) */ + @Override public PackageRelationship addRelationship(PackagePartName targetPartName, TargetMode targetMode, String relationshipType) { return addRelationship(targetPartName, targetMode, relationshipType, @@ -244,9 +243,8 @@ public abstract class PackagePart implements RelationshipSource, Comparable<Pack * invalid nested relations are created. * @throws IllegalArgumentException if targetPartName, targetMode * or relationshipType are passed as null - * @see org.apache.poi.openxml4j.opc.RelationshipSource#addRelationship(org.apache.poi.openxml4j.opc.PackagePartName, - * org.apache.poi.openxml4j.opc.TargetMode, java.lang.String, java.lang.String) */ + @Override public PackageRelationship addRelationship(PackagePartName targetPartName, TargetMode targetMode, String relationshipType, String id) { _container.throwExceptionIfReadOnly(); @@ -347,9 +345,7 @@ public abstract class PackagePart implements RelationshipSource, Comparable<Pack targetMode, relationshipType, id); } - /** - * @see org.apache.poi.openxml4j.opc.RelationshipSource#clearRelationships() - */ + @Override public void clearRelationships() { if (_relationships != null) { _relationships.clear(); @@ -361,8 +357,8 @@ public abstract class PackagePart implements RelationshipSource, Comparable<Pack * * @param id * The ID identified the part to delete. - * @see org.apache.poi.openxml4j.opc.RelationshipSource#removeRelationship(java.lang.String) */ + @Override public void removeRelationship(String id) { this._container.throwExceptionIfReadOnly(); if (this._relationships != null) @@ -375,8 +371,8 @@ public abstract class PackagePart implements RelationshipSource, Comparable<Pack * @return This part's relationships. * @throws InvalidOperationException * Throws if the package is open en write only mode. - * @see org.apache.poi.openxml4j.opc.RelationshipSource#getRelationships() */ + @Override public PackageRelationshipCollection getRelationships() throws InvalidFormatException { return getRelationshipsCore(null); @@ -388,8 +384,8 @@ public abstract class PackagePart implements RelationshipSource, Comparable<Pack * @param id * ID of the package relationship to retrieve. * @return The package relationship - * @see org.apache.poi.openxml4j.opc.RelationshipSource#getRelationship(java.lang.String) */ + @Override public PackageRelationship getRelationship(String id) { return this._relationships.getRelationshipByID(id); } @@ -405,8 +401,8 @@ public abstract class PackagePart implements RelationshipSource, Comparable<Pack * If an error occurs while parsing the part. * @throws InvalidOperationException * If the package is open in write only mode. - * @see org.apache.poi.openxml4j.opc.RelationshipSource#getRelationshipsByType(java.lang.String) */ + @Override public PackageRelationshipCollection getRelationshipsByType( String relationshipType) throws InvalidFormatException { _container.throwExceptionIfWriteOnly(); @@ -443,8 +439,8 @@ public abstract class PackagePart implements RelationshipSource, Comparable<Pack * * @return <b>true</b> if the part have at least one relationship else * <b>false</b>. - * @see org.apache.poi.openxml4j.opc.RelationshipSource#hasRelationships() */ + @Override public boolean hasRelationships() { return (!this._isRelationshipPart && (_relationships != null && _relationships .size() > 0)); @@ -457,8 +453,8 @@ public abstract class PackagePart implements RelationshipSource, Comparable<Pack * The relationship to check. * @return <b>true</b> if the specified relationship exists in this part, * else returns <b>false</b> - * @see org.apache.poi.openxml4j.opc.RelationshipSource#isRelationshipExists(org.apache.poi.openxml4j.opc.PackageRelationship) */ + @Override public boolean isRelationshipExists(PackageRelationship rel) { return rel != null && _relationships.getRelationshipByID(rel.getId()) != null; } @@ -500,7 +496,7 @@ public abstract class PackagePart implements RelationshipSource, Comparable<Pack * Get the input stream of this part to read its content. * * @return The input stream of the content of this part, else - * <code>null</code>. + * {@code null}. * * @throws IOException If creating the input-stream fails. */ diff --git a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/PackageProperties.java b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/PackageProperties.java index 6d832090cd..0c5aa55731 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/PackageProperties.java +++ b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/PackageProperties.java @@ -22,8 +22,7 @@ import java.util.Optional; /** * Represents the core properties of an OPC package. - * - * @author Julien Chable + * * @version 1.0 * @see org.apache.poi.openxml4j.opc.OPCPackage */ diff --git a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/PackageRelationship.java b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/PackageRelationship.java index bec1d00025..4d68234f7e 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/PackageRelationship.java +++ b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/PackageRelationship.java @@ -23,8 +23,6 @@ import java.util.Objects; /** * A part relationship. - * - * @author Julien Chable * @version 1.0 */ public final class PackageRelationship { diff --git a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/PackageRelationshipCollection.java b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/PackageRelationshipCollection.java index 07f8b98a3c..ba507c617f 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/PackageRelationshipCollection.java +++ b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/PackageRelationshipCollection.java @@ -33,9 +33,6 @@ import org.w3c.dom.NodeList; /** * Represents a collection of PackageRelationship elements that are owned by a * given PackagePart or the Package. - * - * @author Julien Chable, CDubettier - * @version 0.1 */ public final class PackageRelationshipCollection implements Iterable<PackageRelationship> { diff --git a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/PackagingURIHelper.java b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/PackagingURIHelper.java index 58231a166a..07a4962cb7 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/PackagingURIHelper.java +++ b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/PackagingURIHelper.java @@ -31,7 +31,6 @@ import org.apache.poi.openxml4j.exceptions.InvalidOperationException; /** * Helper for part and pack URI. * - * @author Julien Chable, CDubet, Kim Ung * @version 0.1 */ public final class PackagingURIHelper { diff --git a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/RelationshipSource.java b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/RelationshipSource.java index 87c424df54..951128700e 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/RelationshipSource.java +++ b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/RelationshipSource.java @@ -34,7 +34,7 @@ public interface RelationshipSource { * Type of relationship. * @return The newly created and added relationship */ - public abstract PackageRelationship addRelationship( + PackageRelationship addRelationship( PackagePartName targetPartName, TargetMode targetMode, String relationshipType); @@ -56,11 +56,8 @@ public interface RelationshipSource { * @param id * Relationship unique id. * @return The newly created and added relationship - * - * @throws InvalidFormatException - * If the URI point to a relationship part URI. */ - public abstract PackageRelationship addRelationship( + PackageRelationship addRelationship( PackagePartName targetPartName, TargetMode targetMode, String relationshipType, String id); @@ -76,9 +73,8 @@ public interface RelationshipSource { * @param target External target of the relationship * @param relationshipType Type of relationship. * @return The newly created and added relationship - * @see org.apache.poi.openxml4j.opc.RelationshipSource#addExternalRelationship(java.lang.String, java.lang.String) */ - public PackageRelationship addExternalRelationship(String target, String relationshipType); + PackageRelationship addExternalRelationship(String target, String relationshipType); /** * Adds an external relationship to a part @@ -95,12 +91,12 @@ public interface RelationshipSource { * @return The newly created and added relationship * @see org.apache.poi.openxml4j.opc.RelationshipSource#addExternalRelationship(java.lang.String, java.lang.String) */ - public PackageRelationship addExternalRelationship(String target, String relationshipType, String id); + PackageRelationship addExternalRelationship(String target, String relationshipType, String id); /** * Delete all the relationships attached to this. */ - public abstract void clearRelationships(); + void clearRelationships(); /** * Delete the relationship specified by its id. @@ -108,16 +104,14 @@ public interface RelationshipSource { * @param id * The ID identified the part to delete. */ - public abstract void removeRelationship(String id); + void removeRelationship(String id); /** * Retrieve all the relationships attached to this. * * @return This part's relationships. - * @throws OpenXML4JException */ - public abstract PackageRelationshipCollection getRelationships() - throws InvalidFormatException, OpenXML4JException; + PackageRelationshipCollection getRelationships() throws OpenXML4JException; /** * Retrieves a package relationship from its id. @@ -126,7 +120,7 @@ public interface RelationshipSource { * ID of the package relationship to retrieve. * @return The package relationship */ - public abstract PackageRelationship getRelationship(String id); + PackageRelationship getRelationship(String id); /** * Retrieve all relationships attached to this part which have the specified @@ -140,9 +134,8 @@ public interface RelationshipSource { * @throws InvalidOperationException * If the package is open in write only mode. */ - public abstract PackageRelationshipCollection getRelationshipsByType( - String relationshipType) throws InvalidFormatException, - IllegalArgumentException, OpenXML4JException; + PackageRelationshipCollection getRelationshipsByType(String relationshipType) + throws IllegalArgumentException, OpenXML4JException; /** * Knows if the part have any relationships. @@ -150,7 +143,7 @@ public interface RelationshipSource { * @return <b>true</b> if the part have at least one relationship else * <b>false</b>. */ - public abstract boolean hasRelationships(); + boolean hasRelationships(); /** * Checks if the specified relationship is part of this package part. @@ -160,6 +153,6 @@ public interface RelationshipSource { * @return <b>true</b> if the specified relationship exists in this part, * else returns <b>false</b> */ - public abstract boolean isRelationshipExists(PackageRelationship rel); + boolean isRelationshipExists(PackageRelationship rel); } diff --git a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/TargetMode.java b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/TargetMode.java index 59f45f5386..99adb023b3 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/TargetMode.java +++ b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/TargetMode.java @@ -18,10 +18,8 @@ package org.apache.poi.openxml4j.opc; /** - * Specifies whether the target of a PackageRelationship is inside or outside a - * Package. + * Specifies whether the target of a PackageRelationship is inside or outside a Package. * - * @author Julien Chable * @version 1.0 */ public enum TargetMode { diff --git a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/ZipPackagePart.java b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/ZipPackagePart.java index 3e1e977f2b..354e212aad 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/ZipPackagePart.java +++ b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/ZipPackagePart.java @@ -32,7 +32,6 @@ import org.apache.poi.util.NotImplemented; /** * Zip implementation of a PackagePart. * - * @author Julien Chable * @version 1.0 * @see PackagePart */ diff --git a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/ContentType.java b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/ContentType.java index 2e186be949..9d2515061f 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/ContentType.java +++ b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/ContentType.java @@ -45,8 +45,6 @@ import org.apache.poi.openxml4j.exceptions.InvalidFormatException; * retrieving a part from a package; format designers shall specify only such * content types for inclusion in the format. * </p> - * @author Julien Chable - * @version 0.1 * * @see <a href="http://www.ietf.org/rfc/rfc2045.txt">http://www.ietf.org/rfc/rfc2045.txt</a> * @see <a href="http://www.ietf.org/rfc/rfc2616.txt">http://www.ietf.org/rfc/rfc2616.txt</a> diff --git a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/ContentTypeManager.java b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/ContentTypeManager.java index f9df88da44..1e53abcc61 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/ContentTypeManager.java +++ b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/ContentTypeManager.java @@ -42,8 +42,6 @@ import org.xml.sax.SAXException; /** * Manage package content types ([Content_Types].xml part). - * - * @author Julien Chable */ public abstract class ContentTypeManager { diff --git a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/FileHelper.java b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/FileHelper.java index 44e3766eb1..b755399a9e 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/FileHelper.java +++ b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/FileHelper.java @@ -25,8 +25,6 @@ import java.nio.channels.FileChannel; /** * Provide useful method to manage file. - * - * @author Julien Chable * @version 0.1 */ public final class FileHelper { @@ -67,7 +65,7 @@ public final class FileHelper { FileOutputStream fos = new FileOutputStream(out); FileChannel sourceChannel = fis.getChannel(); FileChannel destinationChannel = fos.getChannel()) { - + sourceChannel.transferTo(0, sourceChannel.size(), destinationChannel); } } diff --git a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/MemoryPackagePart.java b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/MemoryPackagePart.java index f2d8c31151..0df7364903 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/MemoryPackagePart.java +++ b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/MemoryPackagePart.java @@ -33,8 +33,7 @@ import org.apache.poi.util.IOUtils; /** * Memory version of a package part. Use to - * - * @author Julien Chable + * * @version 1.0 */ public final class MemoryPackagePart extends PackagePart { @@ -46,7 +45,7 @@ public final class MemoryPackagePart extends PackagePart { /** * Constructor. - * + * * @param pack * The owner package. * @param partName @@ -63,7 +62,7 @@ public final class MemoryPackagePart extends PackagePart { /** * Constructor. - * + * * @param pack * The owner package. * @param partName @@ -121,10 +120,10 @@ public final class MemoryPackagePart extends PackagePart { } catch(IOException e) { throw new InvalidFormatException(e.getMessage()); } - + // Save it data = baos.toByteArray(); - + // All done return true; } diff --git a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/MemoryPackagePartOutputStream.java b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/MemoryPackagePartOutputStream.java index cf809d6678..5cd07238e3 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/MemoryPackagePartOutputStream.java +++ b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/MemoryPackagePartOutputStream.java @@ -23,8 +23,6 @@ import java.io.OutputStream; /** * Build an output stream for MemoryPackagePart. - * - * @author Julien Chable */ public final class MemoryPackagePartOutputStream extends OutputStream { diff --git a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/PackagePropertiesPart.java b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/PackagePropertiesPart.java index 34e66326b5..0658a03c6d 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/PackagePropertiesPart.java +++ b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/PackagePropertiesPart.java @@ -41,8 +41,6 @@ import org.apache.poi.util.LocaleUtil; /** * Represents the core properties part of a package. - * - * @author Julien Chable */ public final class PackagePropertiesPart extends PackagePart implements PackageProperties { diff --git a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/PartMarshaller.java b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/PartMarshaller.java index e30d71783a..cb2fb8e464 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/PartMarshaller.java +++ b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/PartMarshaller.java @@ -27,7 +27,6 @@ import org.apache.poi.openxml4j.opc.PackagePart; * marshaller is responsible to marshall a part in order to be save in a * package. * - * @author Julien Chable * @version 0.1 */ public interface PartMarshaller { diff --git a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/PartUnmarshaller.java b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/PartUnmarshaller.java index b3f74323f3..2853172451 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/PartUnmarshaller.java +++ b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/PartUnmarshaller.java @@ -29,9 +29,6 @@ import org.apache.poi.openxml4j.opc.internal.unmarshallers.UnmarshallContext; * Classes implementing this interface are considered as part unmarshaller. A part * unmarshaller is responsible to unmarshall a part in order to load it from a * package. - * - * @author Julien Chable - * @version 0.1 */ public interface PartUnmarshaller { diff --git a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/ZipContentTypeManager.java b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/ZipContentTypeManager.java index 597335efc4..40e3e256b6 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/ZipContentTypeManager.java +++ b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/ZipContentTypeManager.java @@ -33,7 +33,6 @@ import org.w3c.dom.Document; /** * Zip implementation of the ContentTypeManager. * - * @author Julien Chable * @version 1.0 * @see ContentTypeManager */ diff --git a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/marshallers/DefaultMarshaller.java b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/marshallers/DefaultMarshaller.java index 970768cb30..83cf0c4863 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/marshallers/DefaultMarshaller.java +++ b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/marshallers/DefaultMarshaller.java @@ -26,7 +26,6 @@ import org.apache.poi.openxml4j.opc.internal.PartMarshaller; /** * Default marshaller that specified that the part is responsible to marshall its content. * - * @author Julien Chable * @version 1.0 * @see PartMarshaller */ diff --git a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/marshallers/ZipPackagePropertiesMarshaller.java b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/marshallers/ZipPackagePropertiesMarshaller.java index f24a74015c..21522160f8 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/marshallers/ZipPackagePropertiesMarshaller.java +++ b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/marshallers/ZipPackagePropertiesMarshaller.java @@ -29,8 +29,6 @@ import org.apache.poi.openxml4j.opc.internal.ZipHelper; /** * Package core properties marshaller specialized for zipped package. - * - * @author Julien Chable */ public final class ZipPackagePropertiesMarshaller extends PackagePropertiesMarshaller { diff --git a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/unmarshallers/PackagePropertiesUnmarshaller.java b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/unmarshallers/PackagePropertiesUnmarshaller.java index 20d30c443f..ddcd0975c3 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/unmarshallers/PackagePropertiesUnmarshaller.java +++ b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/unmarshallers/PackagePropertiesUnmarshaller.java @@ -41,8 +41,6 @@ import org.xml.sax.SAXException; /** * Package properties unmarshaller. - * - * @author Julien Chable */ public final class PackagePropertiesUnmarshaller implements PartUnmarshaller { diff --git a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/unmarshallers/UnmarshallContext.java b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/unmarshallers/UnmarshallContext.java index d19133f2cb..485b549b72 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/unmarshallers/UnmarshallContext.java +++ b/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/unmarshallers/UnmarshallContext.java @@ -23,8 +23,7 @@ import org.apache.poi.openxml4j.opc.PackagePartName; /** * Context needed for the unmarshall process of a part. This class is immutable. - * - * @author Julien Chable + * * @version 1.0 */ public final class UnmarshallContext { @@ -37,7 +36,7 @@ public final class UnmarshallContext { /** * Constructor. - * + * * @param targetPackage * Container. * @param partName diff --git a/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/facets/EnvelopedSignatureFacet.java b/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/facets/EnvelopedSignatureFacet.java index 6baebff972..87a4a7c86c 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/facets/EnvelopedSignatureFacet.java +++ b/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/facets/EnvelopedSignatureFacet.java @@ -41,8 +41,6 @@ import org.w3c.dom.Document; /** * Signature Facet implementation to create enveloped signatures. - * - * @author Frank Cornelis */ public class EnvelopedSignatureFacet implements SignatureFacet { diff --git a/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/facets/KeyInfoSignatureFacet.java b/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/facets/KeyInfoSignatureFacet.java index d59f4c9acb..84cccecb77 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/facets/KeyInfoSignatureFacet.java +++ b/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/facets/KeyInfoSignatureFacet.java @@ -51,8 +51,6 @@ import org.w3c.dom.NodeList; /** * Signature Facet implementation that adds ds:KeyInfo to the XML signature. - * - * @author Frank Cornelis */ public class KeyInfoSignatureFacet implements SignatureFacet { diff --git a/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/facets/Office2010SignatureFacet.java b/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/facets/Office2010SignatureFacet.java index f9ea3a9662..7546b76c98 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/facets/Office2010SignatureFacet.java +++ b/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/facets/Office2010SignatureFacet.java @@ -41,8 +41,6 @@ import org.w3c.dom.NodeList; * Work-around for Office2010 to accept the XAdES-BES/EPES signature. * * xades:UnsignedProperties/xades:UnsignedSignatureProperties needs to be present. - * - * @author Frank Cornelis */ public class Office2010SignatureFacet implements SignatureFacet { diff --git a/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/facets/XAdESSignatureFacet.java b/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/facets/XAdESSignatureFacet.java index 940b051d7c..eafb2cb387 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/facets/XAdESSignatureFacet.java +++ b/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/facets/XAdESSignatureFacet.java @@ -86,7 +86,6 @@ import org.w3c.dom.Element; * This implementation has been tested against an implementation that * participated multiple ETSI XAdES plugtests. * - * @author Frank Cornelis * @see <a href="http://en.wikipedia.org/wiki/XAdES">XAdES</a> * */ diff --git a/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/facets/XAdESXLSignatureFacet.java b/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/facets/XAdESXLSignatureFacet.java index 18f28f4837..3b00748156 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/facets/XAdESXLSignatureFacet.java +++ b/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/facets/XAdESXLSignatureFacet.java @@ -82,7 +82,6 @@ import org.w3c.dom.NodeList; * This implementation has been tested against an implementation that * participated multiple ETSI XAdES plugtests. * - * @author Frank Cornelis * @see XAdESSignatureFacet */ public class XAdESXLSignatureFacet implements SignatureFacet { diff --git a/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/services/RevocationData.java b/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/services/RevocationData.java index aa40675322..e0bdc05623 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/services/RevocationData.java +++ b/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/services/RevocationData.java @@ -18,9 +18,9 @@ /* ==================================================================== This product contains an ASLv2 licensed version of the OOXML signer package from the eID Applet project - http://code.google.com/p/eid-applet/source/browse/trunk/README.txt + http://code.google.com/p/eid-applet/source/browse/trunk/README.txt Copyright (C) 2008-2014 FedICT. - ================================================================= */ + ================================================================= */ package org.apache.poi.poifs.crypt.dsig.services; @@ -31,9 +31,6 @@ import java.util.List; /** * Container class for PKI revocation data. - * - * @author Frank Cornelis - * */ public class RevocationData { @@ -51,7 +48,7 @@ public class RevocationData { /** * Adds a CRL to this revocation data set. - * + * * @param encodedCrl */ public void addCRL(byte[] encodedCrl) { @@ -60,7 +57,7 @@ public class RevocationData { /** * Adds a CRL to this revocation data set. - * + * * @param crl */ public void addCRL(X509CRL crl) { @@ -76,7 +73,7 @@ public class RevocationData { /** * Adds an OCSP response to this revocation data set. - * + * * @param encodedOcsp */ public void addOCSP(byte[] encodedOcsp) { @@ -85,7 +82,7 @@ public class RevocationData { /** * Gives back a list of all CRLs. - * + * * @return a list of all CRLs */ public List<byte[]> getCRLs() { @@ -94,7 +91,7 @@ public class RevocationData { /** * Gives back a list of all OCSP responses. - * + * * @return a list of all OCSP response */ public List<byte[]> getOCSPs() { @@ -104,7 +101,7 @@ public class RevocationData { /** * Returns <code>true</code> if this revocation data set holds OCSP * responses. - * + * * @return <code>true</code> if this revocation data set holds OCSP * responses. */ @@ -114,7 +111,7 @@ public class RevocationData { /** * Returns <code>true</code> if this revocation data set holds CRLs. - * + * * @return <code>true</code> if this revocation data set holds CRLs. */ public boolean hasCRLs() { @@ -123,7 +120,7 @@ public class RevocationData { /** * Returns <code>true</code> if this revocation data is not empty. - * + * * @return <code>true</code> if this revocation data is not empty. */ public boolean hasRevocationDataEntries() { diff --git a/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/services/RevocationDataService.java b/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/services/RevocationDataService.java index ed5ce29918..5fef803f8c 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/services/RevocationDataService.java +++ b/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/services/RevocationDataService.java @@ -18,9 +18,9 @@ /* ==================================================================== This product contains an ASLv2 licensed version of the OOXML signer package from the eID Applet project - http://code.google.com/p/eid-applet/source/browse/trunk/README.txt + http://code.google.com/p/eid-applet/source/browse/trunk/README.txt Copyright (C) 2008-2014 FedICT. - ================================================================= */ + ================================================================= */ package org.apache.poi.poifs.crypt.dsig.services; @@ -30,16 +30,13 @@ import java.util.List; /** * Interface for a service that retrieves revocation data about some given * certificate chain. - * - * @author Frank Cornelis - * */ public interface RevocationDataService { /** * Gives back the revocation data corresponding with the given certificate * chain. - * + * * @param certificateChain the certificate chain * @return the revocation data corresponding with the given certificate chain. */ diff --git a/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/services/SignaturePolicyService.java b/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/services/SignaturePolicyService.java index 56fd9ba232..86dfb8bec1 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/services/SignaturePolicyService.java +++ b/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/services/SignaturePolicyService.java @@ -18,23 +18,20 @@ /* ==================================================================== This product contains an ASLv2 licensed version of the OOXML signer package from the eID Applet project - http://code.google.com/p/eid-applet/source/browse/trunk/README.txt + http://code.google.com/p/eid-applet/source/browse/trunk/README.txt Copyright (C) 2008-2014 FedICT. - ================================================================= */ + ================================================================= */ package org.apache.poi.poifs.crypt.dsig.services; /** * Interface for the signature policy service. - * - * @author Frank Cornelis - * */ public interface SignaturePolicyService { /** * Gives back the signature policy identifier URI. - * + * * @return the signature policy identifier URI. */ String getSignaturePolicyIdentifier(); @@ -42,7 +39,7 @@ public interface SignaturePolicyService { /** * Gives back the short description of the signature policy or * <code>null</code> if a description is not available. - * + * * @return the description, or <code>null</code>. */ String getSignaturePolicyDescription(); @@ -51,14 +48,14 @@ public interface SignaturePolicyService { * Gives back the download URL where the signature policy document can be * found. Can be <code>null</code> in case such a download location does not * exist. - * + * * @return the download URL, or <code>null</code>. */ String getSignaturePolicyDownloadUrl(); /** * Gives back the signature policy document. - * + * * @return the bytes of the signature policy document. */ byte[] getSignaturePolicyDocument(); diff --git a/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/services/TSPTimeStampService.java b/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/services/TSPTimeStampService.java index 945cf9f709..e0746f60eb 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/services/TSPTimeStampService.java +++ b/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/services/TSPTimeStampService.java @@ -76,9 +76,6 @@ import static org.apache.logging.log4j.util.Unbox.box; /** * A TSP time-stamp service implementation. - * - * @author Frank Cornelis - * */ public class TSPTimeStampService implements TimeStampService { diff --git a/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/services/TimeStampService.java b/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/services/TimeStampService.java index 72561af9bd..f92d2cb4ad 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/services/TimeStampService.java +++ b/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/services/TimeStampService.java @@ -28,8 +28,6 @@ import org.apache.poi.poifs.crypt.dsig.SignatureInfo; /** * Interface for a time-stamp service. - * - * @author Frank Cornelis */ public interface TimeStampService { diff --git a/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/services/TimeStampServiceValidator.java b/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/services/TimeStampServiceValidator.java index 0ea5bbdc1d..e15fbd4f86 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/services/TimeStampServiceValidator.java +++ b/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/dsig/services/TimeStampServiceValidator.java @@ -18,9 +18,9 @@ /* ==================================================================== This product contains an ASLv2 licensed version of the OOXML signer package from the eID Applet project - http://code.google.com/p/eid-applet/source/browse/trunk/README.txt + http://code.google.com/p/eid-applet/source/browse/trunk/README.txt Copyright (C) 2008-2014 FedICT. - ================================================================= */ + ================================================================= */ package org.apache.poi.poifs.crypt.dsig.services; @@ -29,15 +29,12 @@ import java.util.List; /** * Interface for trust validator of a TSP. - * - * @author Frank Cornelis - * */ public interface TimeStampServiceValidator { /** * Validates the given certificate chain. - * + * * @param certificateChain * @param revocationData * the optional data container that should be filled with diff --git a/poi-ooxml/src/main/java/org/apache/poi/xslf/draw/SVGRenderExtension.java b/poi-ooxml/src/main/java/org/apache/poi/xslf/draw/SVGRenderExtension.java index 35536714ed..1af8c2d45e 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xslf/draw/SVGRenderExtension.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xslf/draw/SVGRenderExtension.java @@ -52,8 +52,6 @@ import org.w3c.dom.Element; * Taken (with permission) from https://gist.github.com/msteiger/4509119, * including the fixes that are discussed in the comments * - * @author Martin Steiger - * * @see <a href="https://stackoverflow.com/questions/14258206/">Gradient paints not working in Apache Batik's svggen</a> * @see <a href="https://issues.apache.org/jira/browse/BATIK-1032">BATIK-1032</a> */ diff --git a/poi-ooxml/src/main/java/org/apache/poi/xslf/model/PropertyFetcher.java b/poi-ooxml/src/main/java/org/apache/poi/xslf/model/PropertyFetcher.java index eb157e82e3..c7b68d8866 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xslf/model/PropertyFetcher.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xslf/model/PropertyFetcher.java @@ -24,8 +24,6 @@ import org.apache.poi.xslf.usermodel.XSLFShape; /** * Used internally to navigate the PresentationML text style hierarchy and fetch properties - * - * @author Yegor Kozlov */ @Internal public abstract class PropertyFetcher<T> { diff --git a/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/SlideLayout.java b/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/SlideLayout.java index 729057b13b..2f48dfe957 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/SlideLayout.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/SlideLayout.java @@ -21,8 +21,6 @@ package org.apache.poi.xslf.usermodel; /** * Date: 11/5/11 - * - * @author Yegor Kozlov */ public enum SlideLayout { /** diff --git a/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFAutoShape.java b/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFAutoShape.java index a69af0e0e7..3bba3c5032 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFAutoShape.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFAutoShape.java @@ -32,8 +32,6 @@ import org.openxmlformats.schemas.presentationml.x2006.main.CTShapeNonVisual; /** * Represents a shape with a preset geometry. - * - * @author Yegor Kozlov */ @Beta public class XSLFAutoShape extends XSLFTextShape implements AutoShape<XSLFShape, XSLFTextParagraph> { diff --git a/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFConnectorShape.java b/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFConnectorShape.java index cd15e7d852..5e19efbc7f 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFConnectorShape.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFConnectorShape.java @@ -32,8 +32,6 @@ import org.openxmlformats.schemas.presentationml.x2006.main.CTConnectorNonVisual /** * Specifies a connection shape. - * - * @author Yegor Kozlov */ @Beta public class XSLFConnectorShape extends XSLFSimpleShape diff --git a/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFGroupShape.java b/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFGroupShape.java index 5cf47873f3..4c56fe0a01 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFGroupShape.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFGroupShape.java @@ -50,8 +50,6 @@ import org.openxmlformats.schemas.presentationml.x2006.main.CTShape; /** * Represents a group shape that consists of many shapes grouped together. - * - * @author Yegor Kozlov */ @Beta public class XSLFGroupShape extends XSLFShape diff --git a/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFNotesMaster.java b/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFNotesMaster.java index 6ebe185531..00e7f09819 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFNotesMaster.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFNotesMaster.java @@ -42,8 +42,6 @@ import org.openxmlformats.schemas.presentationml.x2006.main.NotesMasterDocument; * their attached text bodies. Then the notesStyles element specifies the * formatting for the text within each of these shapes. * </p> - * - * @author Yegor Kozlov */ @Beta public class XSLFNotesMaster extends XSLFSheet diff --git a/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFShadow.java b/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFShadow.java index 9ec4e3e6bc..0de14f6645 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFShadow.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFShadow.java @@ -29,8 +29,6 @@ import org.openxmlformats.schemas.drawingml.x2006.main.CTSchemeColor; /** * Represents a shadow of a shape. For now supports only outer shadows. - * - * @author Yegor Kozlov */ public class XSLFShadow extends XSLFShape implements Shadow<XSLFShape,XSLFTextParagraph> { diff --git a/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFSheet.java b/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFSheet.java index 1364cd7228..3c367dd9bb 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFSheet.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFSheet.java @@ -73,7 +73,7 @@ import org.openxmlformats.schemas.presentationml.x2006.main.CTShape; @Beta public abstract class XSLFSheet extends POIXMLDocumentPart implements XSLFShapeContainer, Sheet<XSLFShape,XSLFTextParagraph> { - private static Logger LOG = LogManager.getLogger(XSLFSheet.class); + private static final Logger LOG = LogManager.getLogger(XSLFSheet.class); private XSLFDrawing _drawing; private List<XSLFShape> _shapes; @@ -345,7 +345,7 @@ implements XSLFShapeContainer, Sheet<XSLFShape,XSLFTextParagraph> { * it is unchanged. * * @param xShape 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) */ @@ -461,7 +461,7 @@ implements XSLFShapeContainer, Sheet<XSLFShape,XSLFTextParagraph> { * Append content to this sheet. * * @param src the source sheet - * @return modified <code>this</code>. + * @return modified {@code this}. */ @SuppressWarnings("unused") public XSLFSheet appendContent(XSLFSheet src){ @@ -490,7 +490,7 @@ implements XSLFShapeContainer, Sheet<XSLFShape,XSLFTextParagraph> { /** * @return theme (shared styles) associated with this theme. - * By default returns <code>null</code> which means that this sheet is theme-less. + * By default returns {@code null} which means that this sheet is theme-less. * Sheets that support the notion of themes (slides, masters, layouts, etc.) should override this * method and return the corresponding package part. */ diff --git a/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFTextBox.java b/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFTextBox.java index e3e30d18c6..b8bf5afea6 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFTextBox.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFTextBox.java @@ -29,9 +29,6 @@ import org.openxmlformats.schemas.drawingml.x2006.main.STShapeType; import org.openxmlformats.schemas.presentationml.x2006.main.CTShape; import org.openxmlformats.schemas.presentationml.x2006.main.CTShapeNonVisual; -/** - * @author Yegor Kozlov - */ @Beta public class XSLFTextBox extends XSLFAutoShape implements TextBox<XSLFShape, XSLFTextParagraph> { diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/eventusermodel/XSSFBReader.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/eventusermodel/XSSFBReader.java index 6d4c2eb0b3..e26bfdeb0e 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/eventusermodel/XSSFBReader.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/eventusermodel/XSSFBReader.java @@ -131,6 +131,7 @@ public class XSSFBReader extends XSSFReader { return WORKSHEET_RELS; } + @Override Iterator<XSSFSheetRef> createSheetIteratorFromWB(PackagePart wb) throws IOException { SheetRefLoader sheetRefLoader = new SheetRefLoader(wb.getInputStream()); sheetRefLoader.parse(); diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/eventusermodel/XSSFReader.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/eventusermodel/XSSFReader.java index d31c489e81..7ba0a96df5 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/eventusermodel/XSSFReader.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/eventusermodel/XSSFReader.java @@ -88,7 +88,7 @@ public class XSSFReader { /** * Creates a new XSSFReader, for the given package * - * @param pkg an <code>OPCPackage</code> representing a spreasheet file + * @param pkg an {@code OPCPackage} representing a spreasheet file * @param allowStrictOoxmlFiles whether to try to handle Strict OOXML format files */ public XSSFReader(OPCPackage pkg, boolean allowStrictOoxmlFiles) throws IOException, OpenXML4JException { @@ -226,7 +226,7 @@ public class XSSFReader { XSSFSheetRef xssfSheetRef; /** - * Iterator over CTSheet objects, returns sheets in <tt>logical</tt> order. + * Iterator over CTSheet objects, returns sheets in {@code logical} order. * We can't rely on the Ooxml4J's relationship iterator because it returns objects in physical order, * i.e. as they are stored in the underlying package */ @@ -302,9 +302,9 @@ public class XSSFReader { } /** - * Returns <tt>true</tt> if the iteration has more elements. + * Returns {@code true} if the iteration has more elements. * - * @return <tt>true</tt> if the iterator has more elements. + * @return {@code true} if the iterator has more elements. */ @Override public boolean hasNext() { @@ -366,7 +366,7 @@ public class XSSFReader { protected CommentsTable parseComments(PackagePart commentsPart) throws IOException { return new CommentsTable(commentsPart); } - + /** * Returns the shapes associated with this sheet, * an empty list or null if there is an exception diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/model/CalculationChain.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/model/CalculationChain.java index 58933cdd1e..d46a6af3ee 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/model/CalculationChain.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/model/CalculationChain.java @@ -32,8 +32,6 @@ import org.openxmlformats.schemas.spreadsheetml.x2006.main.CalcChainDocument; /** * The cells in a workbook can be calculated in different orders depending on various optimizations and * dependencies. The calculation chain object specifies the order in which the cells in a workbook were last calculated. - * - * @author Yegor Kozlov */ public class CalculationChain extends POIXMLDocumentPart { private CTCalcChain chain; @@ -50,7 +48,7 @@ public class CalculationChain extends POIXMLDocumentPart { super(part); readFrom(part.getInputStream()); } - + public void readFrom(InputStream is) throws IOException { try { CalcChainDocument doc = CalcChainDocument.Factory.parse(is, DEFAULT_XML_OPTIONS); @@ -80,7 +78,7 @@ public class CalculationChain extends POIXMLDocumentPart { /** * Remove a formula reference from the calculation chain - * + * * @param sheetId the sheet Id of a sheet the formula belongs to. * @param ref A1 style reference to the cell containing the formula. */ diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/model/MapInfo.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/model/MapInfo.java index 10f81c8632..1361e310d9 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/model/MapInfo.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/model/MapInfo.java @@ -37,21 +37,19 @@ import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSchema; import org.openxmlformats.schemas.spreadsheetml.x2006.main.MapInfoDocument; /** - * + * * This class implements the Custom XML Mapping Part (Open Office XML Part 1: * chapter 12.3.6) - * + * * An instance of this part type contains a schema for an XML file, and * information on the behavior that is used when allowing this custom XML schema * to be mapped into the spreadsheet. - * - * @author Roberto Manicardi */ public class MapInfo extends POIXMLDocumentPart { private CTMapInfo mapInfo; - + private Map<Integer, XSSFMap> maps ; public MapInfo() { @@ -66,8 +64,8 @@ public class MapInfo extends POIXMLDocumentPart { public MapInfo(PackagePart part) throws IOException { super(part); readFrom(part.getInputStream()); - } - + } + public void readFrom(InputStream is) throws IOException { try { MapInfoDocument doc = MapInfoDocument.Factory.parse(is, DEFAULT_XML_OPTIONS); @@ -82,7 +80,7 @@ public class MapInfo extends POIXMLDocumentPart { throw new IOException(e.getLocalizedMessage()); } } - + /** * Returns the parent XSSFWorkbook * @@ -91,14 +89,14 @@ public class MapInfo extends POIXMLDocumentPart { public XSSFWorkbook getWorkbook() { return (XSSFWorkbook)getParent(); } - + /** - * + * * @return the internal data object */ public CTMapInfo getCTMapInfo(){ return mapInfo; - + } /** @@ -117,27 +115,27 @@ public class MapInfo extends POIXMLDocumentPart { } return xmlSchema; } - - + + public XSSFMap getXSSFMapById(int id){ return maps.get(id); } - + public XSSFMap getXSSFMapByName(String name){ - + XSSFMap matchedMap = null; - + for(XSSFMap map :maps.values()){ if(map.getCtMap().getName()!=null && map.getCtMap().getName().equals(name)){ matchedMap = map; } - } - + } + return matchedMap; } - + /** - * + * * @return all the mappings configured in this document */ public Collection<XSSFMap> getAllXSSFMaps(){ diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/model/SingleXmlCells.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/model/SingleXmlCells.java index 1ea7eb2824..08b63c451b 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/model/SingleXmlCells.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/model/SingleXmlCells.java @@ -36,16 +36,13 @@ import org.openxmlformats.schemas.spreadsheetml.x2006.main.SingleXmlCellsDocumen /** - * + * * This class implements the Single Cell Tables Part (Open Office XML Part 4: * chapter 3.5.2) - * - * - * @author Roberto Manicardi */ public class SingleXmlCells extends POIXMLDocumentPart { - - + + private CTSingleXmlCells singleXMLCells; public SingleXmlCells() { @@ -70,7 +67,7 @@ public class SingleXmlCells extends POIXMLDocumentPart { throw new IOException(e.getLocalizedMessage()); } } - + public XSSFSheet getXSSFSheet(){ return (XSSFSheet) getParent(); } @@ -88,21 +85,21 @@ public class SingleXmlCells extends POIXMLDocumentPart { writeTo(out); out.close(); } - + public CTSingleXmlCells getCTSingleXMLCells(){ return singleXMLCells; } - + /** - * + * * @return all the SimpleXmlCell contained in this SingleXmlCells element */ public List<XSSFSingleXmlCell> getAllSimpleXmlCell(){ List<XSSFSingleXmlCell> list = new Vector<>(); - + for(CTSingleXmlCell singleXmlCell: singleXMLCells.getSingleXmlCellArray()){ list.add(new XSSFSingleXmlCell(singleXmlCell,this)); - } + } return list; } } diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/OpcOutputStream.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/OpcOutputStream.java index b8253c054d..581606f82d 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/OpcOutputStream.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/OpcOutputStream.java @@ -30,8 +30,6 @@ import java.util.zip.*; * Drop in replacement for `java.util.ZipOutputStream`. * * For more information see https://github.com/rzymek/opczip - * - * @author Krzysztof Rzymkowski */ class OpcOutputStream extends DeflaterOutputStream { diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/Zip64Impl.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/Zip64Impl.java index 5dfc49008a..706004912d 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/Zip64Impl.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/Zip64Impl.java @@ -26,8 +26,6 @@ import static java.nio.charset.StandardCharsets.US_ASCII; /** * Excel compatible Zip64 implementation. * For more information see https://github.com/rzymek/opczip - * - * @author Krzysztof Rzymkowski */ class Zip64Impl { private static final long PK0102 = 0x02014b50L; diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/BaseXSSFEvaluationWorkbook.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/BaseXSSFEvaluationWorkbook.java index 79f003eb9c..01317d0c75 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/BaseXSSFEvaluationWorkbook.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/BaseXSSFEvaluationWorkbook.java @@ -315,6 +315,7 @@ public abstract class BaseXSSFEvaluationWorkbook implements FormulaRenderingWork } } + @Override @NotImplemented public int getExternalSheetIndex(String workbookName, String sheetName) { throw new RuntimeException("not implemented yet"); @@ -387,7 +388,7 @@ public abstract class BaseXSSFEvaluationWorkbook implements FormulaRenderingWork * This is meant to be used on documents whose structure is essentially static at the point formulas are evaluated. * * @param name the data table name (case-insensitive) - * @return The Data table in the workbook named <tt>name</tt>, or <tt>null</tt> if no table is named <tt>name</tt>. + * @return The Data table in the workbook named {@code name}, or {@code null} if no table is named {@code name}. * @since 3.15 beta 2 */ @Override @@ -419,15 +420,18 @@ public abstract class BaseXSSFEvaluationWorkbook implements FormulaRenderingWork _fpBook = fpBook; } + @Override public Ptg[] getNameDefinition() { return FormulaParser.parse(_nameRecord.getRefersToFormula(), _fpBook, FormulaType.NAMEDRANGE, _nameRecord.getSheetIndex()); } + @Override public String getNameText() { return _nameRecord.getNameName(); } + @Override public boolean hasFormula() { // TODO - no idea if this is right CTDefinedName ctn = _nameRecord.getCTName(); @@ -435,13 +439,16 @@ public abstract class BaseXSSFEvaluationWorkbook implements FormulaRenderingWork return !ctn.getFunction() && strVal != null && strVal.length() > 0; } + @Override public boolean isFunctionName() { return _nameRecord.isFunctionName(); } + @Override public boolean isRange() { return hasFormula(); // TODO - is this right? } + @Override public NamePtg createPtg() { return new NamePtg(_index); } diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFAutoFilter.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFAutoFilter.java index d363ab31ab..0e8e9963fa 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFAutoFilter.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFAutoFilter.java @@ -20,8 +20,6 @@ import org.apache.poi.ss.usermodel.AutoFilter; /** * Represents autofiltering for the specified worksheet. - * - * @author Yegor Kozlov */ public final class XSSFAutoFilter implements AutoFilter { private XSSFSheet _sheet; diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFChartSheet.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFChartSheet.java index 883e33a58e..4cf1ec13a0 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFChartSheet.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFChartSheet.java @@ -40,9 +40,6 @@ import org.openxmlformats.schemas.spreadsheetml.x2006.main.ChartsheetDocument; * High level representation of Sheet Parts that are of type 'chartsheet'. * <p> * Chart sheet is a special kind of Sheet that contains only chart and no data. - * </p> - * - * @author Yegor Kozlov */ public class XSSFChartSheet extends XSSFSheet { @@ -56,7 +53,8 @@ public class XSSFChartSheet extends XSSFSheet { protected XSSFChartSheet(PackagePart part) { super(part); } - + + @Override protected void read(InputStream is) throws IOException { //initialize the supeclass with a blank worksheet super.read(new ByteArrayInputStream(BLANK_WORKSHEET)); @@ -81,12 +79,12 @@ public class XSSFChartSheet extends XSSFSheet { protected CTDrawing getCTDrawing() { return chartsheet.getDrawing(); } - + @Override protected CTLegacyDrawing getCTLegacyDrawing() { return chartsheet.getLegacyDrawing(); } - + @Override protected void write(OutputStream out) throws IOException { XmlOptions xmlOptions = new XmlOptions(DEFAULT_XML_OPTIONS); diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFChildAnchor.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFChildAnchor.java index ff727adb2a..c673f2c704 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFChildAnchor.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFChildAnchor.java @@ -22,9 +22,6 @@ import org.openxmlformats.schemas.drawingml.x2006.main.CTPoint2D; import org.openxmlformats.schemas.drawingml.x2006.main.CTPositiveSize2D; import org.openxmlformats.schemas.drawingml.x2006.main.CTTransform2D; -/** - * @author Yegor Kozlov - */ public final class XSSFChildAnchor extends XSSFAnchor { private CTTransform2D t2d; diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFColor.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFColor.java index a8507cd92e..5233bbd5b3 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFColor.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFColor.java @@ -38,7 +38,6 @@ public class XSSFColor extends ExtendedColor { * @return null if color is null, new instance otherwise */ public static XSSFColor from(CTColor color, IndexedColorMap map) { - //noinspection deprecation return color == null ? null : new XSSFColor(color, map); } @@ -84,7 +83,6 @@ public class XSSFColor extends ExtendedColor { * @param colorMap The IndexedColorMap to use instead of the default one */ public XSSFColor(IndexedColorMap colorMap) { - //noinspection deprecation this(CTColor.Factory.newInstance(), colorMap); } @@ -115,7 +113,6 @@ public class XSSFColor extends ExtendedColor { * @param colorMap The IndexedColorMap to use instead of the default one */ public XSSFColor(byte[] rgb, IndexedColorMap colorMap) { - //noinspection deprecation this(CTColor.Factory.newInstance(), colorMap); ctColor.setRgb(rgb); } @@ -125,7 +122,6 @@ public class XSSFColor extends ExtendedColor { * @param colorMap The IndexedColorMap to use instead of the default one */ public XSSFColor(IndexedColors indexedColor, IndexedColorMap colorMap) { - //noinspection deprecation this(CTColor.Factory.newInstance(), colorMap); ctColor.setIndexed(indexedColor.index); } @@ -245,6 +241,7 @@ public class XSSFColor extends ExtendedColor { return ctColor.getRgb(); } + @Override protected byte[] getIndexedRGB() { if (isIndexed()) { if (indexedColorMap != null) return indexedColorMap.getRGB(getIndex()); @@ -262,8 +259,8 @@ public class XSSFColor extends ExtendedColor { } /** - * Index into the <clrScheme> collection, referencing a particular <sysClr> or - * <srgbClr> value expressed in the Theme part. + * Index into the {@code clrScheme} collection, referencing a particular {@code sysClr} or + * {@code srgbClr} value expressed in the Theme part. */ @Override public int getTheme() { @@ -271,8 +268,8 @@ public class XSSFColor extends ExtendedColor { } /** - * Index into the <clrScheme> collection, referencing a particular <sysClr> or - * <srgbClr> value expressed in the Theme part. + * Index into the {@code clrScheme} collection, referencing a particular {@code sysClr} or + * {@code srgbClr} value expressed in the Theme part. * @param theme index */ public void setTheme(int theme) { @@ -382,7 +379,7 @@ public class XSSFColor extends ExtendedColor { } /** - * Checked type cast <tt>color</tt> to an XSSFColor. + * Checked type cast {@code color} to an XSSFColor. * * @param color the color to type cast * @return the type casted color diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFConditionalFormatting.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFConditionalFormatting.java index eff8e375b4..4ec82e0cc4 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFConditionalFormatting.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFConditionalFormatting.java @@ -27,9 +27,6 @@ import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTConditionalFormatti import java.util.ArrayList; import java.util.Collections; -/** - * @author Yegor Kozlov - */ public class XSSFConditionalFormatting implements ConditionalFormatting { private final CTConditionalFormatting _cf; private final XSSFSheet _sh; @@ -50,7 +47,7 @@ public class XSSFConditionalFormatting implements ConditionalFormatting { } /** - * @return array of <tt>CellRangeAddress</tt>s. Never <code>null</code> + * @return array of {@code CellRangeAddress}s. Never {@code null} */ @Override public CellRangeAddress[] getFormattingRanges() { diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFConnector.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFConnector.java index 78d4e402e4..6624d0aa27 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFConnector.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFConnector.java @@ -37,8 +37,6 @@ import org.apache.poi.util.Internal; /** * A connection shape drawing element. A connection shape is a line, etc. * that connects two other shapes in this drawing. - * - * @author Yegor Kozlov */ public final class XSSFConnector extends XSSFShape { diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFDataValidation.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFDataValidation.java index ca451a5d33..4cc723ee2c 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFDataValidation.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFDataValidation.java @@ -31,10 +31,6 @@ import org.openxmlformats.schemas.spreadsheetml.x2006.main.STDataValidationOpera import org.openxmlformats.schemas.spreadsheetml.x2006.main.STDataValidationType; import org.openxmlformats.schemas.spreadsheetml.x2006.main.STDataValidationOperator.Enum; -/** - * @author <a href="rjankiraman@emptoris.com">Radhakrishnan J</a> - * - */ public class XSSFDataValidation implements DataValidation { private static final int MAX_TEXT_LENGTH = 255; @@ -93,7 +89,7 @@ public class XSSFDataValidation implements DataValidation { this.ctDataValidation = ctDataValidation; this.regions = regions; } - + CTDataValidation getCtDataValidation() { return ctDataValidation; } diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFDataValidationConstraint.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFDataValidationConstraint.java index b62a38e0a5..3dc04c2ed3 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFDataValidationConstraint.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFDataValidationConstraint.java @@ -23,10 +23,6 @@ import org.apache.poi.ss.usermodel.DataValidationConstraint; import org.openxmlformats.schemas.spreadsheetml.x2006.main.STDataValidationType; import org.openxmlformats.schemas.spreadsheetml.x2006.main.STDataValidationOperator.Enum; -/** - * @author <a href="rjankiraman@emptoris.com">Radhakrishnan J</a> - * - */ public class XSSFDataValidationConstraint implements DataValidationConstraint { /** * Excel validation constraints with static lists are delimited with optional whitespace and the Windows List Separator, @@ -53,10 +49,10 @@ public class XSSFDataValidationConstraint implements DataValidationConstraint { } this.validationType = ValidationType.LIST; setExplicitListValues(explicitListOfValues); - + validate(); } - + public XSSFDataValidationConstraint(int validationType, String formula1) { super(); setFormula1(formula1); @@ -89,11 +85,11 @@ public class XSSFDataValidationConstraint implements DataValidationConstraint { setFormula2(formula2); this.validationType = validationType; this.operator = operator; - + validate(); - + //FIXME: Need to confirm if this is not a formula. - // empirical testing shows Excel saves explicit lists surrounded by double quotes, + // empirical testing shows Excel saves explicit lists surrounded by double quotes, // range formula expressions can't start with quotes (I think - anyone have a creative counter example?) if ( ValidationType.LIST == validationType && this.formula1 != null @@ -142,7 +138,7 @@ public class XSSFDataValidationConstraint implements DataValidationConstraint { */ public void setExplicitListValues(String[] explicitListValues) { this.explicitListOfValues = explicitListValues; - + // for OOXML we need to set formula1 to the quoted csv list of values (doesn't appear documented, but that's where Excel puts its lists) // further, Excel has no escaping for commas in explicit lists, so we don't need to worry about that. if ( explicitListOfValues!=null && explicitListOfValues.length > 0 ) { @@ -155,7 +151,7 @@ public class XSSFDataValidationConstraint implements DataValidationConstraint { builder.append(string); } builder.append(QUOTE); - setFormula1(builder.toString()); + setFormula1(builder.toString()); } } @@ -201,7 +197,7 @@ public class XSSFDataValidationConstraint implements DataValidationConstraint { if (validationType==ValidationType.ANY) { return; } - + if (validationType==ValidationType.LIST ) { if (isFormulaEmpty(formula1)) { throw new IllegalArgumentException("A valid formula or a list of values must be specified for list validation."); @@ -213,7 +209,7 @@ public class XSSFDataValidationConstraint implements DataValidationConstraint { if( isFormulaEmpty(formula1) ) { throw new IllegalArgumentException("Formula is not specified. Formula is required for all validation types except explicit list validation."); } - + if( validationType!= ValidationType.FORMULA ) { if (operator==-1) { throw new IllegalArgumentException("This validation type requires an operator to be specified."); @@ -224,7 +220,7 @@ public class XSSFDataValidationConstraint implements DataValidationConstraint { } } - + public String prettyPrint() { StringBuilder builder = new StringBuilder(); STDataValidationType.Enum vt = XSSFDataValidation.validationTypeMappings.get(validationType); diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFDataValidationHelper.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFDataValidationHelper.java index 9e62aa07e7..5508411d4b 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFDataValidationHelper.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFDataValidationHelper.java @@ -30,15 +30,11 @@ import org.openxmlformats.schemas.spreadsheetml.x2006.main.STDataValidationError import org.openxmlformats.schemas.spreadsheetml.x2006.main.STDataValidationOperator; import org.openxmlformats.schemas.spreadsheetml.x2006.main.STDataValidationType; -/** - * @author <a href="rjankiraman@emptoris.com">Radhakrishnan J</a> - * - */ public class XSSFDataValidationHelper implements DataValidationHelper { // Findbugs: URF_UNREAD_FIELD. Do not delete without understanding how this class works. //private XSSFSheet xssfSheet; - - + + public XSSFDataValidationHelper(XSSFSheet xssfSheet) { super(); // Findbugs: URF_UNREAD_FIELD. Do not delete without understanding how this class works. @@ -73,8 +69,8 @@ public class XSSFDataValidationHelper implements DataValidationHelper { return new XSSFDataValidationConstraint(ValidationType.LIST, listFormula); } - - + + public DataValidationConstraint createNumericConstraint(int validationType, int operatorType, String formula1, String formula2) { if( validationType==ValidationType.INTEGER) { return createIntegerConstraint(operatorType, formula1, formula2); @@ -122,23 +118,23 @@ public class XSSFDataValidationHelper implements DataValidationHelper { switch(validationType) { case DataValidationConstraint.ValidationType.LIST: newDataValidation.setType(STDataValidationType.LIST); - newDataValidation.setFormula1(constraint.getFormula1()); + newDataValidation.setFormula1(constraint.getFormula1()); break; - case DataValidationConstraint.ValidationType.ANY: - newDataValidation.setType(STDataValidationType.NONE); + case DataValidationConstraint.ValidationType.ANY: + newDataValidation.setType(STDataValidationType.NONE); break; case DataValidationConstraint.ValidationType.TEXT_LENGTH: newDataValidation.setType(STDataValidationType.TEXT_LENGTH); - break; + break; case DataValidationConstraint.ValidationType.DATE: newDataValidation.setType(STDataValidationType.DATE); - break; + break; case DataValidationConstraint.ValidationType.INTEGER: newDataValidation.setType(STDataValidationType.WHOLE); - break; + break; case DataValidationConstraint.ValidationType.DECIMAL: newDataValidation.setType(STDataValidationType.DECIMAL); - break; + break; case DataValidationConstraint.ValidationType.TIME: newDataValidation.setType(STDataValidationType.TIME); break; @@ -146,9 +142,9 @@ public class XSSFDataValidationHelper implements DataValidationHelper { newDataValidation.setType(STDataValidationType.CUSTOM); break; default: - newDataValidation.setType(STDataValidationType.NONE); + newDataValidation.setType(STDataValidationType.NONE); } - + if (validationType!=ValidationType.ANY && validationType!=ValidationType.LIST) { STDataValidationOperator.Enum op = XSSFDataValidation.operatorTypeMappings.get(constraint.getOperator()); if(op != null) { @@ -161,7 +157,7 @@ public class XSSFDataValidationHelper implements DataValidationHelper { newDataValidation.setFormula2(constraint.getFormula2()); } } - + CellRangeAddress[] cellRangeAddresses = cellRangeAddressList.getCellRangeAddresses(); List<String> sqref = new ArrayList<>(); for (int i = 0; i < cellRangeAddresses.length; i++) { @@ -171,7 +167,7 @@ public class XSSFDataValidationHelper implements DataValidationHelper { newDataValidation.setSqref(sqref); newDataValidation.setAllowBlank(true); newDataValidation.setErrorStyle(STDataValidationErrorStyle.STOP); - + return new XSSFDataValidation(dataValidationConstraint,cellRangeAddressList,newDataValidation); } } diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFDialogsheet.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFDialogsheet.java index bb81b5ff50..b736990d19 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFDialogsheet.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFDialogsheet.java @@ -40,6 +40,7 @@ public class XSSFDialogsheet extends XSSFSheet implements Sheet{ this.worksheet = CTWorksheet.Factory.newInstance(); } + @Override public XSSFRow createRow(int rowNum) { return null; } diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFFont.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFFont.java index b6d4465ecc..02bfd2e9de 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFFont.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFFont.java @@ -45,8 +45,6 @@ import org.openxmlformats.schemas.spreadsheetml.x2006.main.STUnderlineValues; /** * Represents a font used in a workbook. - * - * @author Gisella Bronzetti */ public class XSSFFont implements Font { diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFFontFormatting.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFFontFormatting.java index 6b359a2988..ec60fdfae3 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFFontFormatting.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFFontFormatting.java @@ -31,9 +31,6 @@ import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTVerticalAlignFontPr import org.openxmlformats.schemas.spreadsheetml.x2006.main.STUnderlineValues; -/** - * @author Yegor Kozlov - */ public class XSSFFontFormatting implements FontFormatting { private IndexedColorMap _colorMap; private CTFont _font; diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFGraphicFrame.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFGraphicFrame.java index 4a46f641a4..2892e93f0d 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFGraphicFrame.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFGraphicFrame.java @@ -38,8 +38,6 @@ import org.w3c.dom.NodeList; /** * Represents DrawingML GraphicalObjectFrame. - * - * @author Roman Kashitsyn */ public final class XSSFGraphicFrame extends XSSFShape { diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFMap.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFMap.java index 17c12c195b..e4c3891292 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFMap.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFMap.java @@ -37,11 +37,7 @@ import org.w3c.dom.Node; * <p> * This element contains all of the properties related to the XML map, * and the behaviors expected during data refresh operations. - * - * @author Roberto Manicardi */ - - public class XSSFMap { private CTMap ctMap; private MapInfo mapInfo; diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFName.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFName.java index 21300d47e3..aa76fba89d 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFName.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFName.java @@ -50,12 +50,9 @@ import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTDefinedName; * name2.setRefersToFormula("Sheet1!$B$3"); * * </blockquote></pre> - * - * @author Nick Burch - * @author Yegor Kozlov */ public final class XSSFName implements Name { - + /** * A built-in defined name that specifies the workbook's print area */ @@ -356,30 +353,30 @@ public final class XSSFName implements Name { XSSFName cf = (XSSFName) o; return _ctName.toString().equals(cf.getCTName().toString()); } - + /** * https://support.office.com/en-us/article/Define-and-use-names-in-formulas-4D0F13AC-53B7-422E-AFD2-ABD7FF379C64#bmsyntax_rules_for_names - * + * * Valid characters: * First character: { letter | underscore | backslash } * Remaining characters: { letter | number | period | underscore } - * + * * Cell shorthand: cannot be { "C" | "c" | "R" | "r" } - * + * * Cell references disallowed: cannot be a cell reference $A$1 or R1C1 - * + * * Spaces are not valid (follows from valid characters above) - * + * * Name length: (XSSF-specific?) 255 characters maximum - * + * * Case sensitivity: all names are case-insensitive - * + * * Uniqueness: must be unique (for names with the same scope) * * @param name */ private static void validateName(String name) { - + if (name.length() == 0) { throw new IllegalArgumentException("Name cannot be blank"); } @@ -389,7 +386,7 @@ public final class XSSFName implements Name { if (name.equalsIgnoreCase("R") || name.equalsIgnoreCase("C")) { throw new IllegalArgumentException("Invalid name: '"+name+"': cannot be special shorthand R or C"); } - + // is first character valid? char c = name.charAt(0); String allowedSymbols = "_\\"; @@ -397,7 +394,7 @@ public final class XSSFName implements Name { if (!characterIsValid) { throw new IllegalArgumentException("Invalid name: '"+name+"': first character must be underscore or a letter"); } - + // are all other characters valid? allowedSymbols = "_.\\"; //backslashes needed for unicode escape for (final char ch : name.toCharArray()) { @@ -406,13 +403,13 @@ public final class XSSFName implements Name { throw new IllegalArgumentException("Invalid name: '"+name+"': name must be letter, digit, period, or underscore"); } } - + // Is the name a valid $A$1 cell reference // Because $, :, and ! are disallowed characters, A1-style references become just a letter-number combination if (name.matches("[A-Za-z]+\\d+")) { String col = name.replaceAll("\\d", ""); String row = name.replaceAll("[A-Za-z]", ""); - + try { if (CellReference.cellReferenceIsWithinRange(col, row, SpreadsheetVersion.EXCEL2007)) { throw new IllegalArgumentException("Invalid name: '"+name+"': cannot be $A$1-style cell reference"); @@ -422,7 +419,7 @@ public final class XSSFName implements Name { // therefore name passes the not-a-cell-reference criteria } } - + // Is the name a valid R1C1 cell reference? if (name.matches("[Rr]\\d+[Cc]\\d+")) { throw new IllegalArgumentException("Invalid name: '"+name+"': cannot be R1C1-style cell reference"); diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFPatternFormatting.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFPatternFormatting.java index 0f191c28f2..8f5833d6ed 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFPatternFormatting.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFPatternFormatting.java @@ -25,9 +25,6 @@ import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPatternFill; import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTColor; import org.openxmlformats.schemas.spreadsheetml.x2006.main.STPatternType; -/** - * @author Yegor Kozlov - */ public class XSSFPatternFormatting implements PatternFormatting { IndexedColorMap _colorMap; CTFill _fill; @@ -82,7 +79,7 @@ public class XSSFPatternFormatting implements PatternFormatting { ptrn.setBgColor(color); } } - + public void setFillForegroundColor(Color fg) { XSSFColor xcolor = XSSFColor.toXSSFColor(fg); if (xcolor == null) setFillForegroundColor((CTColor)null); diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFPicture.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFPicture.java index 86f3bd917b..a3fcd66719 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFPicture.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFPicture.java @@ -42,8 +42,6 @@ import org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTPictureNo /** * Represents a picture shape in a SpreadsheetML drawing. - * - * @author Yegor Kozlov */ public final class XSSFPicture extends XSSFShape implements Picture { private static final Logger LOG = LogManager.getLogger(XSSFPicture.class); diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java index 571d4fb766..e25f95f1e7 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java @@ -119,6 +119,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { * Kept for backwards-compatibility, use {@link Font#TWIPS_PER_POINT} instead. * @deprecated POI 5.0.0 */ + @Deprecated public static final int TWIPS_PER_POINT = Font.TWIPS_PER_POINT; //TODO make the two variable below private! @@ -357,7 +358,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { * @param region to merge * @param validate whether to validate merged region * @return 0-based index of this region - * @throws IllegalArgumentException if region contains fewer than 2 cells (this check is inexpensive and is performed regardless of <tt>validate</tt>) + * @throws IllegalArgumentException if region contains fewer than 2 cells (this check is inexpensive and is performed regardless of {@code validate}) * @throws IllegalStateException if region intersects with a multi-cell array formula * @throws IllegalStateException if region intersects with an existing region on this sheet */ @@ -596,7 +597,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { * * @param autoCreate if true, then a new VML drawing part is created * - * @return the VML drawing of <code>null</code> if the drawing was not found and autoCreate=false + * @return the VML drawing of {@code null} if the drawing was not found and autoCreate=false */ protected XSSFVMLDrawing getVMLDrawing(boolean autoCreate) { XSSFVMLDrawing drawing = null; @@ -888,7 +889,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { * Vertical page break information used for print layout view, page layout view, drawing print breaks * in normal view, and for printing the worksheet. * - * @return column indexes of all the vertical page breaks, never <code>null</code> + * @return column indexes of all the vertical page breaks, never {@code null} */ @Override public int[] getColumnBreaks() { @@ -1070,7 +1071,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { /** * Flag indicating whether the Fit to Page print option is enabled. * - * @return <code>true</code> + * @return {@code true} */ @Override public boolean getFitToPage() { @@ -1394,7 +1395,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { * Also sets some attributes on the {@link CTSheetProtection} that correspond to * the default values used by Excel * - * @param password to set for protection. Pass <code>null</code> to remove protection + * @param password to set for protection. Pass {@code null} to remove protection */ @Override public void protectSheet(String password) { @@ -1440,7 +1441,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { * defined you get a null. This is to say row 4 represents the fifth row on a sheet. * * @param rownum row to get - * @return <code>XSSFRow</code> representing the rownumber or <code>null</code> if its not defined on the sheet + * @return {@code XSSFRow} representing the rownumber or {@code null} if its not defined on the sheet */ @Override public XSSFRow getRow(int rownum) { @@ -1492,7 +1493,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { * Horizontal page break information used for print layout view, page layout view, drawing print breaks in normal * view, and for printing the worksheet. * - * @return row indexes of all the horizontal page breaks, never <code>null</code> + * @return row indexes of all the horizontal page breaks, never {@code null} */ @Override public int[] getRowBreaks() { @@ -1511,7 +1512,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { * When false a summary row is inserted above the detailed data being summarized and a new outline level * is established on that row. * </p> - * @return <code>true</code> if row summaries appear below detail in the outline + * @return {@code true} if row summaries appear below detail in the outline */ @Override public boolean getRowSumsBelow() { @@ -1532,7 +1533,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { * When false a summary row is inserted above the detailed data being summarized and a new outline level * is established on that row. * </p> - * @param value <code>true</code> if row summaries appear below detail in the outline + * @param value {@code true} if row summaries appear below detail in the outline */ @Override public void setRowSumsBelow(boolean value) { @@ -1550,7 +1551,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { * When false a summary column is inserted to the left of the detailed data being * summarized and a new outline level is established on that column. * </p> - * @return <code>true</code> if col summaries appear right of the detail in the outline + * @return {@code true} if col summaries appear right of the detail in the outline */ @Override public boolean getRowSumsRight() { @@ -1571,7 +1572,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { * When false a summary column is inserted to the left of the detailed data being * summarized and a new outline level is established on that column. * </p> - * @param value <code>true</code> if col summaries appear right of the detail in the outline + * @param value {@code true} if col summaries appear right of the detail in the outline */ @Override public void setRowSumsRight(boolean value) { @@ -1729,7 +1730,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { * Get the hidden state for a given column. * * @param columnIndex - the column to set (0-based) - * @return hidden - <code>false</code> if the column is visible + * @return hidden - {@code false} if the column is visible */ @Override public boolean isColumnHidden(int columnIndex) { @@ -1740,7 +1741,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { /** * Gets the flag indicating whether this sheet should display formulas. * - * @return <code>true</code> if this sheet should display formulas. + * @return {@code true} if this sheet should display formulas. */ @Override public boolean isDisplayFormulas() { @@ -1752,7 +1753,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { * Gets the flag indicating whether this sheet displays the lines * between rows and columns to make editing and reading easier. * - * @return <code>true</code> (default) if this sheet displays gridlines. + * @return {@code true} (default) if this sheet displays gridlines. * @see #isPrintGridlines() to check if printing of gridlines is turned on or off */ @Override @@ -1767,7 +1768,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { * To turn printing of gridlines use {@link #setPrintGridlines(boolean)} * * - * @param show <code>true</code> if this sheet should display gridlines. + * @param show {@code true} if this sheet should display gridlines. * @see #setPrintGridlines(boolean) */ @Override @@ -1786,7 +1787,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { * Column heading are the letters or numbers that appear above the columns of the sheet * </p> * - * @return <code>true</code> (default) if this sheet should display row and column headings. + * @return {@code true} (default) if this sheet should display row and column headings. */ @Override public boolean isDisplayRowColHeadings() { @@ -1803,7 +1804,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { * Column heading are the letters or numbers that appear above the columns of the sheet * </p> * - * @param show <code>true</code> if this sheet should display row and column headings. + * @param show {@code true} if this sheet should display row and column headings. */ @Override public void setDisplayRowColHeadings(boolean show) { @@ -1862,7 +1863,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { * Tests if there is a page break at the indicated row * * @param row index of the row to test - * @return <code>true</code> if there is a page break at the indicated row + * @return {@code true} if there is a page break at the indicated row */ @Override public boolean isRowBroken(int row) { @@ -1891,8 +1892,8 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { * Sets a page break at the indicated row * Breaks occur above the specified row and left of the specified column inclusive. * - * For example, <code>sheet.setColumnBreak(2);</code> breaks the sheet into two parts - * with columns A,B,C in the first and D,E,... in the second. Simuilar, <code>sheet.setRowBreak(2);</code> + * For example, {@code sheet.setColumnBreak(2);} breaks the sheet into two parts + * with columns A,B,C in the first and D,E,... in the second. Simuilar, {@code sheet.setRowBreak(2);} * breaks the sheet into two parts with first three rows (rownum=1...3) in the first part * and rows starting with rownum=4 in the second. * @@ -2100,7 +2101,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { /** * Flag indicating whether the sheet displays Automatic Page Breaks. * - * @return <code>true</code> if the sheet displays Automatic Page Breaks. + * @return {@code true} if the sheet displays Automatic Page Breaks. */ @Override public boolean getAutobreaks() { @@ -2113,7 +2114,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { /** * Flag indicating whether the sheet displays Automatic Page Breaks. * - * @param value <code>true</code> if the sheet displays Automatic Page Breaks. + * @param value {@code true} if the sheet displays Automatic Page Breaks. */ @Override public void setAutobreaks(boolean value) { @@ -2126,8 +2127,8 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { * Sets a page break at the indicated column. * Breaks occur above the specified row and left of the specified column inclusive. * - * For example, <code>sheet.setColumnBreak(2);</code> breaks the sheet into two parts - * with columns A,B,C in the first and D,E,... in the second. Simuilar, <code>sheet.setRowBreak(2);</code> + * For example, {@code sheet.setColumnBreak(2);} breaks the sheet into two parts + * with columns A,B,C in the first and D,E,... in the second. Simuilar, {@code sheet.setRowBreak(2);} * breaks the sheet into two parts with first three rows (rownum=1...3) in the first part * and rows starting with rownum=4 in the second. * @@ -2502,7 +2503,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { * * <p> * Character width is defined as the maximum digit width - * of the numbers <code>0, 1, 2, ... 9</code> as rendered + * of the numbers {@code 0, 1, 2, ... 9} as rendered * using the default font (first font in the workbook). * <br> * Unless you are using a very special font, the default character is '0' (zero), @@ -2518,18 +2519,18 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { * To compute the actual number of visible characters, * Excel uses the following formula (Section 3.3.1.12 of the OOXML spec): * </p> - * <code> + * {@code * width = Truncate([{Number of Visible Characters} * * {Maximum Digit Width} + {5 pixel padding}]/{Maximum Digit Width}*256)/256 - * </code> + * } * <p>Using the Calibri font as an example, the maximum digit width of 11 point font size is 7 pixels (at 96 dpi). - * If you set a column width to be eight characters wide, e.g. <code>setColumnWidth(columnIndex, 8*256)</code>, + * If you set a column width to be eight characters wide, e.g. {@code setColumnWidth(columnIndex, 8*256)}, * then the actual value of visible characters (the value shown in Excel) is derived from the following equation: - * <code> + * {@code Truncate([numChars*7+5]/7*256)/256 = 8; - * </code> + * } * - * which gives <code>7.29</code>. + * which gives {@code 7.29}. * * @param columnIndex - the column to set (0-based) * @param width - the width in units of 1/256th of a character width @@ -2555,7 +2556,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { * This value does not include margin padding or extra padding for gridlines. It is only the * number of characters. * - * @param width the number of characters. Default value is <code>8</code>. + * @param width the number of characters. Default value is {@code 8}. */ @Override public void setDefaultColumnWidth(int width) { @@ -2588,7 +2589,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { /** * Sets the flag indicating whether this sheet should display formulas. * - * @param show <code>true</code> if this sheet should display formulas. + * @param show {@code true} if this sheet should display formulas. */ @Override public void setDisplayFormulas(boolean show) { @@ -2600,7 +2601,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { /** * Flag indicating whether the Fit to Page print option is enabled. * - * @param b <code>true</code> if the Fit to Page print option is enabled. + * @param b {@code true} if the Fit to Page print option is enabled. */ @Override public void setFitToPage(boolean b) { @@ -3342,7 +3343,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { * </p> * Note: multiple sheets can be selected, but only one sheet can be active at one time. * - * @return <code>true</code> if this sheet is selected + * @return {@code true} if this sheet is selected */ @Override public boolean isSelected() { @@ -3359,7 +3360,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { * </p> * Note: multiple sheets can be selected, but only one sheet can be active at one time. * - * @param value <code>true</code> if this sheet is selected + * @param value {@code true} if this sheet is selected */ @Override public void setSelected(boolean value) { @@ -3402,7 +3403,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { } /** - * Return location of the active cell, e.g. <code>A1</code>. + * Return location of the active cell, e.g. {@code A1}. * * @return the location of the active cell. */ @@ -3526,7 +3527,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { * Return a master shared formula by index * * @param sid shared group index - * @return a CTCellFormula bean holding shared formula or <code>null</code> if not found + * @return a CTCellFormula bean holding shared formula or {@code null} if not found */ @Internal public CTCellFormula getSharedFormula(int sid){ @@ -4170,7 +4171,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { /** * Get background color of the sheet tab. - * Returns <tt>null</tt> if no sheet tab color is set. + * Returns {@code null} if no sheet tab color is set. * * @return the background color of the sheet tab */ diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheetConditionalFormatting.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheetConditionalFormatting.java index 9967a2cf79..00829321f9 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheetConditionalFormatting.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheetConditionalFormatting.java @@ -56,7 +56,7 @@ public class XSSFSheetConditionalFormatting implements SheetConditionalFormattin * 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> @@ -67,12 +67,13 @@ public class XSSFSheetConditionalFormatting implements SheetConditionalFormattin * <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.ss.usermodel.ComparisonOperator#BETWEEN}) and * {@link org.apache.poi.ss.usermodel.ComparisonOperator#NOT_BETWEEN} operations) */ + @Override public XSSFConditionalFormattingRule createConditionalFormattingRule( byte comparisonOperation, String formula1, @@ -100,6 +101,7 @@ public class XSSFSheetConditionalFormatting implements SheetConditionalFormattin return rule; } + @Override public XSSFConditionalFormattingRule createConditionalFormattingRule( byte comparisonOperation, String formula) { @@ -112,6 +114,7 @@ public class XSSFSheetConditionalFormatting implements SheetConditionalFormattin * * @param formula - formula for the valued, compared with the cell */ + @Override public XSSFConditionalFormattingRule createConditionalFormattingRule(String formula) { XSSFConditionalFormattingRule rule = new XSSFConditionalFormattingRule(_sheet); CTCfRule cfRule = rule.getCTCfRule(); @@ -122,12 +125,12 @@ public class XSSFSheetConditionalFormatting implements SheetConditionalFormattin /** * Create a Databar conditional formatting rule. - * <p>The thresholds and colour for it will be created, but will be - * empty and require configuring with + * <p>The thresholds and colour for it will be created, but will be + * empty and require configuring with * {@link XSSFConditionalFormattingRule#getDataBarFormatting()} * then * {@link XSSFDataBarFormatting#getMinThreshold()} - * and + * and * {@link XSSFDataBarFormatting#getMaxThreshold()} */ public XSSFConditionalFormattingRule createConditionalFormattingRule(XSSFColor color) { @@ -139,6 +142,7 @@ public class XSSFSheetConditionalFormatting implements SheetConditionalFormattin // All done! return rule; } + @Override public XSSFConditionalFormattingRule createConditionalFormattingRule(ExtendedColor color) { return createConditionalFormattingRule((XSSFColor)color); } @@ -147,11 +151,12 @@ public class XSSFSheetConditionalFormatting implements SheetConditionalFormattin * A factory method allowing the creation of conditional formatting * rules using an Icon Set / Multi-State formatting. * The thresholds for it will be created, but will be empty - * and require configuring with + * and require configuring with * {@link XSSFConditionalFormattingRule#getMultiStateFormatting()} * then * {@link XSSFIconMultiStateFormatting#getThresholds()} */ + @Override public XSSFConditionalFormattingRule createConditionalFormattingRule(IconSet iconSet) { XSSFConditionalFormattingRule rule = new XSSFConditionalFormattingRule(_sheet); @@ -164,14 +169,15 @@ public class XSSFSheetConditionalFormatting implements SheetConditionalFormattin /** * Create a Color Scale / Color Gradient conditional formatting rule. - * <p>The thresholds and colours for it will be created, but will be - * empty and require configuring with + * <p>The thresholds and colours for it will be created, but will be + * empty and require configuring with * {@link XSSFConditionalFormattingRule#getColorScaleFormatting()} * then * {@link XSSFColorScaleFormatting#getThresholds()} * and * {@link XSSFColorScaleFormatting#getColors()} */ + @Override public XSSFConditionalFormattingRule createConditionalFormattingColorScaleRule() { XSSFConditionalFormattingRule rule = new XSSFConditionalFormattingRule(_sheet); @@ -182,6 +188,7 @@ public class XSSFSheetConditionalFormatting implements SheetConditionalFormattin return rule; } + @Override public int addConditionalFormatting(CellRangeAddress[] regions, ConditionalFormattingRule[] cfRules) { if (regions == null) { throw new IllegalArgumentException("regions must not be null"); @@ -214,6 +221,7 @@ public class XSSFSheetConditionalFormatting implements SheetConditionalFormattin return _sheet.getCTWorksheet().sizeOfConditionalFormattingArray() - 1; } + @Override public int addConditionalFormatting(CellRangeAddress[] regions, ConditionalFormattingRule rule1) { @@ -223,6 +231,7 @@ public class XSSFSheetConditionalFormatting implements SheetConditionalFormattin }); } + @Override public int addConditionalFormatting(CellRangeAddress[] regions, ConditionalFormattingRule rule1, ConditionalFormattingRule rule2) { @@ -245,6 +254,7 @@ public class XSSFSheetConditionalFormatting implements SheetConditionalFormattin * @param cf HSSFConditionalFormatting object * @return index of the new Conditional Formatting object */ + @Override public int addConditionalFormatting( ConditionalFormatting cf ) { XSSFConditionalFormatting xcf = (XSSFConditionalFormatting)cf; CTWorksheet sh = _sheet.getCTWorksheet(); @@ -259,6 +269,7 @@ public class XSSFSheetConditionalFormatting implements SheetConditionalFormattin * of the Conditional Formatting object to fetch * @return Conditional Formatting object */ + @Override public XSSFConditionalFormatting getConditionalFormattingAt(int index) { checkIndex(index); CTConditionalFormatting cf = _sheet.getCTWorksheet().getConditionalFormattingArray(index); @@ -268,6 +279,7 @@ public class XSSFSheetConditionalFormatting implements SheetConditionalFormattin /** * @return number of Conditional Formatting objects of the sheet */ + @Override public int getNumConditionalFormattings() { return _sheet.getCTWorksheet().sizeOfConditionalFormattingArray(); } @@ -276,6 +288,7 @@ public class XSSFSheetConditionalFormatting implements SheetConditionalFormattin * removes a Conditional Formatting object by index * @param index of a Conditional Formatting object to remove */ + @Override public void removeConditionalFormatting(int index) { checkIndex(index); _sheet.getCTWorksheet().removeConditionalFormatting(index); diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTable.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTable.java index 62f6158deb..f8b8486ac4 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTable.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTable.java @@ -49,16 +49,13 @@ import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTTableColumns; import org.openxmlformats.schemas.spreadsheetml.x2006.main.TableDocument; /** - * + * * This class implements the Table Part (Open Office XML Part 4: chapter 3.5.1) - * + * * Columns of this table may contains mappings to a subtree of an XML. The root * element of this subtree can occur multiple times (one for each row of the * table). The child nodes of the root element can be only attributes or * elements with maxOccurs=1 property set. - * - * - * @author Roberto Manicardi */ public class XSSFTable extends POIXMLDocumentPart implements Table { @@ -67,8 +64,8 @@ public class XSSFTable extends POIXMLDocumentPart implements Table { private transient List<XSSFTableColumn> tableColumns; private transient HashMap<String, Integer> columnMap; private transient CellReference startCellReference; - private transient CellReference endCellReference; - private transient String commonXPath; + private transient CellReference endCellReference; + private transient String commonXPath; private transient String name; private transient String styleName; @@ -80,7 +77,7 @@ public class XSSFTable extends POIXMLDocumentPart implements Table { ctTable = CTTable.Factory.newInstance(); } - /** + /** * @param part The part used to initialize the table * @throws IOException If reading data from the part fails. * @since POI 3.14-Beta1 @@ -89,7 +86,7 @@ public class XSSFTable extends POIXMLDocumentPart implements Table { super(part); readFrom(part.getInputStream()); } - + /** * Read table XML from an {@link InputStream} * @param is The stream which provides the XML data for the table. @@ -103,7 +100,7 @@ public class XSSFTable extends POIXMLDocumentPart implements Table { throw new IOException(e.getLocalizedMessage()); } } - + /** * @return owning sheet */ @@ -131,7 +128,7 @@ public class XSSFTable extends POIXMLDocumentPart implements Table { writeTo(out); out.close(); } - + /** * get the underlying CTTable XML bean * @return underlying OOXML object @@ -140,7 +137,7 @@ public class XSSFTable extends POIXMLDocumentPart implements Table { public CTTable getCTTable() { return ctTable; } - + /** * Checks if this Table element contains even a single mapping to the map identified by id * @param id the XSSFMap ID @@ -148,22 +145,22 @@ public class XSSFTable extends POIXMLDocumentPart implements Table { */ public boolean mapsTo(long id){ List<XSSFXmlColumnPr> pointers = getXmlColumnPrs(); - + for (XSSFXmlColumnPr pointer: pointers) { if (pointer.getMapId()==id) { return true; } } - + return false; } - + /** - * + * * Calculates the xpath of the root element for the table. This will be the common part * of all the mapping's xpaths * Note: this function caches the result for performance. To flush the cache {@link #updateHeaders()} must be called. - * + * * @return the xpath of the table's root element */ public String getCommonXpath() { @@ -175,16 +172,16 @@ public class XSSFTable extends POIXMLDocumentPart implements Table { String[] tokens = xpath.split("/"); if (commonTokens.length==0) { commonTokens = tokens; - + } else { final int maxLength = Math.min(commonTokens.length, tokens.length); - + for (int i =0; i<maxLength; i++) { if (!commonTokens[i].equals(tokens[i])) { List<String> subCommonTokens = Arrays.asList(commonTokens).subList(0, i); - + String[] container = {}; - + commonTokens = subCommonTokens.toArray(container); break; } @@ -196,7 +193,7 @@ public class XSSFTable extends POIXMLDocumentPart implements Table { commonTokens[0] = ""; commonXPath = StringUtil.join(commonTokens, "/"); } - + return commonXPath; } @@ -236,10 +233,10 @@ public class XSSFTable extends POIXMLDocumentPart implements Table { } return xmlColumnPrs; } - + /** * Add a new column to the right end of the table. - * + * * @param columnName * the unique name of the column, must not be {@code null} * @return the created table column @@ -248,10 +245,10 @@ public class XSSFTable extends POIXMLDocumentPart implements Table { public XSSFTableColumn createColumn(String columnName) { return createColumn(columnName, getColumnCount()); } - + /** * Adds a new column to the table. - * + * * @param columnName * the unique name of the column, or {@code null} for a generated name * @param columnIndex @@ -263,20 +260,20 @@ public class XSSFTable extends POIXMLDocumentPart implements Table { * @since 4.0.0 */ public XSSFTableColumn createColumn(String columnName, int columnIndex) { - + int columnCount = getColumnCount(); if(columnIndex < 0 || columnIndex > columnCount) { throw new IllegalArgumentException("Column index out of bounds"); } - + // Ensure we have Table Columns CTTableColumns columns = ctTable.getTableColumns(); if (columns == null) { columns = ctTable.addNewTableColumns(); } - - // check if name is unique and calculate unique column id - long nextColumnId = 0; + + // check if name is unique and calculate unique column id + long nextColumnId = 0; for (XSSFTableColumn tableColumn : getColumns()) { if (columnName != null && columnName.equalsIgnoreCase(tableColumn.getName())) { throw new IllegalArgumentException("Column '" + columnName @@ -286,18 +283,18 @@ public class XSSFTable extends POIXMLDocumentPart implements Table { } // Bug #62740, the logic was just re-using the existing max ID, not incrementing beyond it. nextColumnId++; - + // Add the new Column CTTableColumn column = columns.insertNewTableColumn(columnIndex); columns.setCount(columns.sizeOfTableColumnArray()); - + column.setId(nextColumnId); if(columnName != null) { - column.setName(columnName); + column.setName(columnName); } else { column.setName("Column " + nextColumnId); } - + if (ctTable.getRef() != null) { // calculate new area int newColumnCount = columnCount + 1; @@ -310,12 +307,12 @@ public class XSSFTable extends POIXMLDocumentPart implements Table { setCellRef(newTableArea); } - + updateHeaders(); - + return getColumns().get(columnIndex); } - + /** * Remove a column from the table. * @@ -331,7 +328,7 @@ public class XSSFTable extends POIXMLDocumentPart implements Table { updateHeaders(); } } - + /** * Remove a column from the table. * @@ -346,18 +343,18 @@ public class XSSFTable extends POIXMLDocumentPart implements Table { if (columnIndex < 0 || columnIndex > getColumnCount() - 1) { throw new IllegalArgumentException("Column index out of bounds"); } - + if(getColumnCount() == 1) { throw new IllegalArgumentException("Table must have at least one column"); } - + CTTableColumns tableColumns = ctTable.getTableColumns(); tableColumns.removeTableColumn(columnIndex); tableColumns.setCount(tableColumns.getTableColumnList().size()); updateReferences(); updateHeaders(); } - + /** * @return the name of the Table, if set */ @@ -367,7 +364,7 @@ public class XSSFTable extends POIXMLDocumentPart implements Table { } return name; } - + /** * Changes the name of the Table * @param newName The name of the table. @@ -392,7 +389,7 @@ public class XSSFTable extends POIXMLDocumentPart implements Table { } return styleName; } - + /** * Changes the name of the Table * @param newStyleName The name of the style. @@ -412,7 +409,7 @@ public class XSSFTable extends POIXMLDocumentPart implements Table { ctTable.getTableStyleInfo().setName(newStyleName); styleName = newStyleName; } - + /** * @return the display name of the Table, if set */ @@ -437,7 +434,7 @@ public class XSSFTable extends POIXMLDocumentPart implements Table { * * Does not track updates to underlying changes to CTTable To synchronize * with changes to the underlying CTTable, call {@link #updateReferences()}. - * + * * @return the area of the table * @see "Open Office XML Part 4: chapter 3.5.1.2, attribute ref" * @since 3.17 beta 1 @@ -449,35 +446,35 @@ public class XSSFTable extends POIXMLDocumentPart implements Table { SpreadsheetVersion.EXCEL2007 ); } - + /** * Set the area reference for the cells which this table covers. The area * includes includes header rows and totals rows. Automatically synchronizes * any changes by calling {@link #updateHeaders()}. - * + * * Note: The area's width should be identical to the amount of columns in * the table or the table may be invalid. All header rows, totals rows and * at least one data row must fit inside the area. Updating the area with * this method does not create or remove any columns and does not change any * cell values. - * + * * @see "Open Office XML Part 4: chapter 3.5.1.2, attribute ref" * @since 3.17 beta 1 */ public void setCellReferences(AreaReference refs) { setCellRef(refs); } - + @Internal protected void setCellRef(AreaReference refs) { - + // Strip the sheet name, // CTWorksheet.getTableParts defines in which sheet the table is String ref = refs.formatAsString(); if (ref.indexOf('!') != -1) { ref = ref.substring(ref.indexOf('!')+1); } - + // Update ctTable.setRef(ref); if (ctTable.isSetAutoFilter()) { @@ -494,19 +491,19 @@ public class XSSFTable extends POIXMLDocumentPart implements Table { } ctTable.getAutoFilter().setRef(filterRef); } - + // Have everything recomputed updateReferences(); updateHeaders(); } - + /** * Set the area reference for the cells which this table covers. The area * includes includes header rows and totals rows. - * + * * Updating the area with this method will create new column as necessary to * the right side of the table but will not modify any cell values. - * + * * @param tableArea * the new area of the table * @throws IllegalArgumentException @@ -518,7 +515,7 @@ public class XSSFTable extends POIXMLDocumentPart implements Table { if (tableArea == null) { throw new IllegalArgumentException("AreaReference must not be null"); } - + String areaSheetName = tableArea.getFirstCell().getSheetName(); if (areaSheetName != null && !areaSheetName.equals(getXSSFSheet().getSheetName())) { // TODO to move a table from one sheet to another @@ -526,7 +523,7 @@ public class XSSFTable extends POIXMLDocumentPart implements Table { throw new IllegalArgumentException( "The AreaReference must not reference a different sheet"); } - + int rowCount = (tableArea.getLastCell().getRow() - tableArea.getFirstCell().getRow()) + 1; int minimumRowCount = 1 + getHeaderRowCount() + getTotalsRowCount(); if (rowCount < minimumRowCount) { @@ -563,7 +560,7 @@ public class XSSFTable extends POIXMLDocumentPart implements Table { updateHeaders(); } - + /** * Get the area that this table covers. * @@ -580,10 +577,10 @@ public class XSSFTable extends POIXMLDocumentPart implements Table { return null; } } - + /** * @return The reference for the cell in the top-left part of the table - * (see Open Office XML Part 4: chapter 3.5.1.2, attribute ref) + * (see Open Office XML Part 4: chapter 3.5.1.2, attribute ref) * * Does not track updates to underlying changes to CTTable * To synchronize with changes to the underlying CTTable, @@ -595,7 +592,7 @@ public class XSSFTable extends POIXMLDocumentPart implements Table { } return startCellReference; } - + /** * @return The reference for the cell in the bottom-right part of the table * (see Open Office XML Part 4: chapter 3.5.1.2, attribute ref) @@ -625,7 +622,7 @@ public class XSSFTable extends POIXMLDocumentPart implements Table { } } - + /** * Clears the cached values set by {@link #getStartCellReference()} * and {@link #getEndCellReference()}. @@ -641,40 +638,40 @@ public class XSSFTable extends POIXMLDocumentPart implements Table { endCellReference = null; } - + /** * Get the total number of rows in this table, including all * {@linkplain #getHeaderRowCount() header rows} and all * {@linkplain #getTotalsRowCount() totals rows}. (Note: in this version * autofiltering is ignored) - * + * * Returns <code>0</code> if the start or end cell references are not set. - * + * * Does not track updates to underlying changes to CTTable To synchronize * with changes to the underlying CTTable, call {@link #updateReferences()}. - * + * * @return the total number of rows */ public int getRowCount() { CellReference from = getStartCellReference(); CellReference to = getEndCellReference(); - + int rowCount = 0; if (from!=null && to!=null) { rowCount = to.getRow() - from.getRow() + 1; } return rowCount; } - + /** * Get the number of data rows in this table. This does not include any * header rows or totals rows. - * + * * Returns <code>0</code> if the start or end cell references are not set. - * + * * Does not track updates to underlying changes to CTTable To synchronize * with changes to the underlying CTTable, call {@link #updateReferences()}. - * + * * @return the number of data rows * @since 4.0.0 */ @@ -693,11 +690,11 @@ public class XSSFTable extends POIXMLDocumentPart implements Table { /** * Set the number of rows in the data area of the table. This does not * affect any header rows or totals rows. - * + * * If the new row count is less than the current row count, superfluous rows * will be cleared. If the new row count is greater than the current row * count, cells below the table will be overwritten by the table. - * + * * To resize the table without overwriting cells, use * {@link #setArea(AreaReference)} instead. * @@ -781,14 +778,14 @@ public class XSSFTable extends POIXMLDocumentPart implements Table { * Synchronize table headers with cell values in the parent sheet. * Headers <em>must</em> be in sync, otherwise Excel will display a * "Found unreadable content" message on startup. - * + * * If calling both {@link #updateReferences()} and * this method, {@link #updateReferences()} * should be called first. - * + * * Note that a Table <em>must</em> have a header. To reproduce * the equivalent of inserting a table in Excel without Headers, - * manually add cells with values of "Column1", "Column2" etc first. + * manually add cells with values of "Column1", "Column2" etc first. */ public void updateHeaders() { XSSFSheet sheet = (XSSFSheet)getParent(); @@ -841,7 +838,7 @@ public class XSSFTable extends POIXMLDocumentPart implements Table { // FIXME: replace with org.apache.commons.collections.map.CaseInsensitiveMap final int count = getColumnCount(); columnMap = new HashMap<>(count * 3 / 2); - + int i = 0; for (XSSFTableColumn column : getColumns()) { String columnName = column.getName(); @@ -872,7 +869,7 @@ public class XSSFTable extends POIXMLDocumentPart implements Table { public boolean isHasTotalsRow() { return ctTable.getTotalsRowShown(); } - + /** * @return 0 for no totals rows, 1 for totals row shown. * Values > 1 are not currently used by Excel up through 2016, and the OOXML spec @@ -891,7 +888,7 @@ public class XSSFTable extends POIXMLDocumentPart implements Table { public int getHeaderRowCount() { return (int) ctTable.getHeaderRowCount(); } - + /** * @since 3.15 beta 2 */ @@ -919,7 +916,7 @@ public class XSSFTable extends POIXMLDocumentPart implements Table { public int getEndRowIndex() { return getEndCellReference().getRow(); } - + /** * @since 3.17 beta 1 */ @@ -945,7 +942,7 @@ public class XSSFTable extends POIXMLDocumentPart implements Table { } return false; } - + /** * Remove relations */ diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTableColumn.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTableColumn.java index 7d1f4661cd..3535233d47 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTableColumn.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTableColumn.java @@ -25,8 +25,7 @@ import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTXmlColumnPr; /** * A table column of an {@link XSSFTable}. Use {@link XSSFTable#createColumn} to * create new table columns. - * - * @author Leonard Kappe + * * @since 4.0.0 */ public class XSSFTableColumn { @@ -62,7 +61,7 @@ public class XSSFTableColumn { /** * Get the identifier of this column, which is is unique per table. - * + * * @return the column id * @since 4.0.0 */ @@ -72,9 +71,9 @@ public class XSSFTableColumn { /** * Set the identifier of this column, which must be unique per table. - * + * * It is up to the caller to enforce the uniqueness of the id. - * + * * @param columnId the column id * @since 4.0.0 */ @@ -84,7 +83,7 @@ public class XSSFTableColumn { /** * Get the name of the column, which is is unique per table. - * + * * @return the column name * @since 4.0.0 */ @@ -94,7 +93,7 @@ public class XSSFTableColumn { /** * Get the name of the column, which is is unique per table. - * + * * @param columnName the column name * @since 4.0.0 */ diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTextBox.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTextBox.java index 74c26b9306..a37a11bfa7 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTextBox.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTextBox.java @@ -21,8 +21,6 @@ import org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTShape; /** * Represents a text box in a SpreadsheetML drawing. - * - * @author Yegor Kozlov */ public final class XSSFTextBox extends XSSFSimpleShape { diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java index f64ed3c4cd..cf910a7cd8 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java @@ -257,7 +257,7 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook, Date1904Su } /** - * Constructs a XSSFWorkbook object given a OpenXML4J <code>Package</code> object, + * Constructs a XSSFWorkbook object given a OpenXML4J {@code Package} object, * see <a href="https://poi.apache.org/oxml4j/">https://poi.apache.org/oxml4j/</a>. * * <p>Once you have finished working with the Workbook, you should close the package @@ -267,7 +267,7 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook, Date1904Su * <p>Creating a XSSFWorkbook from a file-backed OPC Package has a lower memory * footprint than an InputStream backed one. * - * @param pkg the OpenXML4J <code>OPC Package</code> object. + * @param pkg the OpenXML4J {@code OPC Package} object. */ public XSSFWorkbook(OPCPackage pkg) throws IOException { super(pkg); @@ -288,13 +288,13 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook, Date1904Su * * <p>Using an {@link InputStream} requires more memory than using a File, so * if a {@link File} is available then you should instead do something like - * <pre><code> + * <pre>{@code * OPCPackage pkg = OPCPackage.open(path); * XSSFWorkbook wb = new XSSFWorkbook(pkg); * // work with the wb object * ...... * pkg.close(); // gracefully closes the underlying zip file - * </code></pre> + * }</pre> */ public XSSFWorkbook(InputStream is) throws IOException { this(PackageHelper.open(is)); @@ -823,11 +823,11 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook, Date1904Su * 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> * * Except the 31-character constraint, Excel applies some other rules: @@ -928,7 +928,7 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook, Date1904Su /** * Finds a font that matches the one with the supplied attributes * - * @return the font with the matched attributes or <code>null</code> + * @return the font with the matched attributes or {@code null} */ @Override public XSSFFont findFont(boolean bold, short color, short fontHeight, String name, boolean italic, boolean strikeout, short typeOffset, byte underline) { @@ -988,7 +988,8 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook, Date1904Su * {@link #getNames(String name)} returns all named ranges with the given name. * * @param name named range name - * @return XSSFName with the given name. <code>null</code> is returned no named range could be found. + * @return XSSFName with the given name. + * {@code null} is returned no named range could be found. */ @Override public XSSFName getName(String name) { @@ -1045,7 +1046,7 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook, Date1904Su * Gets the named range index by name. No longer public and only used in tests. * * @param name named range name - * @return named range index. <code>-1</code> is returned if no named ranges could be found. + * @return named range index. {@code -1} is returned if no named ranges could be found. * * @deprecated 3.16. New projects should avoid accessing named ranges by index. * Use {@link #getName(String)} instead. @@ -1121,7 +1122,7 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook, Date1904Su * Get sheet with the given name (case insensitive match) * * @param name of the sheet - * @return XSSFSheet with the name provided or <code>null</code> if it does not exist + * @return XSSFSheet with the name provided or {@code null} if it does not exist */ @Override public XSSFSheet getSheet(String name) { @@ -1151,7 +1152,7 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook, Date1904Su * Returns the index of the sheet by his name (case insensitive match) * * @param name the sheet name - * @return index of the sheet (0 based) or <tt>-1</tt> if not found + * @return index of the sheet (0 based) or {@code -1} if not found */ @Override public int getSheetIndex(String name) { @@ -1169,7 +1170,7 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook, Date1904Su * 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) { @@ -1924,7 +1925,7 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook, Date1904Su * The calculation chain object specifies the order in which the cells in a workbook were last calculated * </p> * - * @return the <code>CalculationChain</code> object or <code>null</code> if not defined + * @return the {@code CalculationChain} object or {@code null} if not defined */ @Internal public CalculationChain getCalculationChain() { @@ -1942,7 +1943,7 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook, Date1904Su * External Links in a formula would be '[1]Foo' which corresponds to * entry 0 in this list.</p> - * @return the <code>ExternalLinksTable</code> list, which may be empty + * @return the {@code ExternalLinksTable} list, which may be empty */ @Internal public List<ExternalLinksTable> getExternalLinksTable() { @@ -2314,7 +2315,7 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook, Date1904Su * Returns the data table with the given name (case insensitive). * * @param name the data table name (case-insensitive) - * @return The Data table in the workbook named <tt>name</tt>, or <tt>null</tt> if no table is named <tt>name</tt>. + * @return The Data table in the workbook named {@code name}, or {@code null} if no table is named {@code name}. * @since 3.15 beta 2 */ public XSSFTable getTable(String name) { diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/helpers/XSSFFormulaUtils.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/helpers/XSSFFormulaUtils.java index 926e2a2d87..3799f6c6d7 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/helpers/XSSFFormulaUtils.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/helpers/XSSFFormulaUtils.java @@ -45,8 +45,6 @@ import org.w3c.dom.NodeList; /** * Utility to update formulas and named ranges when a sheet name was changed - * - * @author Yegor Kozlov */ public final class XSSFFormulaUtils { private final XSSFWorkbook _wb; diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/helpers/XSSFSingleXmlCell.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/helpers/XSSFSingleXmlCell.java index 79cc921a34..5fea3505db 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/helpers/XSSFSingleXmlCell.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/helpers/XSSFSingleXmlCell.java @@ -29,11 +29,6 @@ import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTXmlPr; * * This class is a wrapper around the CTSingleXmlCell (Open Office XML Part 4: * chapter 3.5.2.1) - * - - * - * @author Roberto Manicardi - * */ public class XSSFSingleXmlCell { diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/helpers/XSSFXmlColumnPr.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/helpers/XSSFXmlColumnPr.java index 08e9ca05c1..2fdd7fa06d 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/helpers/XSSFXmlColumnPr.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/helpers/XSSFXmlColumnPr.java @@ -26,9 +26,6 @@ import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTXmlColumnPr; * * This class is a wrapper around the CTXmlColumnPr (Open Office XML Part 4: * chapter 3.5.1.7) - * - * - * @author Roberto Manicardi */ public class XSSFXmlColumnPr { diff --git a/poi-ooxml/src/main/java/org/apache/poi/xwpf/model/XWPFCommentsDecorator.java b/poi-ooxml/src/main/java/org/apache/poi/xwpf/model/XWPFCommentsDecorator.java index 6a29cd3898..3c70801345 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xwpf/model/XWPFCommentsDecorator.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xwpf/model/XWPFCommentsDecorator.java @@ -23,8 +23,6 @@ import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTMarkupRange; /** * Decorator class for XWPFParagraph allowing to add comments * found in paragraph to its text - * - * @author Yury Batrakov (batrakov at gmail.com) */ public class XWPFCommentsDecorator extends XWPFParagraphDecorator { private StringBuilder commentText; diff --git a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/BodyElementType.java b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/BodyElementType.java index d93ba9d0b6..3584450f59 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/BodyElementType.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/BodyElementType.java @@ -17,16 +17,6 @@ package org.apache.poi.xwpf.usermodel; -/** - * <p> - * 9 Jan 2010 - * </p> - * <p> - * // TODO insert Javadoc here! - * </p> - * - * @author epp - */ public enum BodyElementType { CONTENTCONTROL, PARAGRAPH, diff --git a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/Borders.java b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/Borders.java index d77e7f088f..f2763f4fab 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/Borders.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/Borders.java @@ -34,8 +34,6 @@ import java.util.Map; * element * </li> * </ul> - * - * @author Gisella Bronzetti */ public enum Borders { diff --git a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/BreakClear.java b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/BreakClear.java index 895c143b0c..33ece8f2e7 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/BreakClear.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/BreakClear.java @@ -23,8 +23,6 @@ import java.util.Map; * Specifies the set of possible restart locations which may be used as to * determine the next available line when a break's type attribute has a value * of textWrapping. - * - * @author Gisella Bronzetti */ public enum BreakClear { diff --git a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/BreakType.java b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/BreakType.java index aea132db97..f86a89e25f 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/BreakType.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/BreakType.java @@ -24,8 +24,6 @@ import java.util.Map; * document. * The break type determines the next location where text shall be * placed after this manual break is applied to the text contents - * - * @author Gisella Bronzetti */ public enum BreakType { diff --git a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/IBodyElement.java b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/IBodyElement.java index 2585459215..16e7c71a82 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/IBodyElement.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/IBodyElement.java @@ -21,8 +21,6 @@ import org.apache.poi.ooxml.POIXMLDocumentPart; /** * 9 Jan 2010 - * - * @author Philipp Epp */ public interface IBodyElement { IBody getBody(); diff --git a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/LineSpacingRule.java b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/LineSpacingRule.java index 836069d0d5..b8b6fbde71 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/LineSpacingRule.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/LineSpacingRule.java @@ -22,8 +22,6 @@ import java.util.Map; /** * Specifies the logic which shall be used to calculate the line spacing of the * parent object when it is displayed in the document. - * - * @author Gisella Bronzetti */ public enum LineSpacingRule { diff --git a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/ParagraphAlignment.java b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/ParagraphAlignment.java index e3599032f8..be9e8e6efc 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/ParagraphAlignment.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/ParagraphAlignment.java @@ -25,8 +25,6 @@ import org.openxmlformats.schemas.wordprocessingml.x2006.main.STJc; /** * Specifies all types of alignment which are available to be applied to objects in a * WordprocessingML document - * - * @author Yegor Kozlov */ public enum ParagraphAlignment { //YK: TODO document each alignment option diff --git a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/TextAlignment.java b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/TextAlignment.java index 6ed8dc00e4..3fb8231589 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/TextAlignment.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/TextAlignment.java @@ -22,8 +22,6 @@ import java.util.Map; /** * Specifies all types of vertical alignment which are available to be applied to of all text * on each line displayed within a paragraph. - * - * @author Gisella Bronzetti */ public enum TextAlignment { /** diff --git a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/UnderlinePatterns.java b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/UnderlinePatterns.java index f863d79fbf..0e27f429f3 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/UnderlinePatterns.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/UnderlinePatterns.java @@ -22,8 +22,6 @@ import java.util.Map; /** * Specifies the types of patterns which may be used to create the underline * applied beneath the text in a run. - * - * @author Gisella Bronzetti */ public enum UnderlinePatterns { diff --git a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/VerticalAlign.java b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/VerticalAlign.java index 209e006dca..64f34cbb20 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/VerticalAlign.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/VerticalAlign.java @@ -24,8 +24,6 @@ import java.util.Map; * relation to the default appearance of the run's text. This allows the text to * be repositioned as subscript or superscript without altering the font size of * the run properties. - * - * @author Gisella Bronzetti */ public enum VerticalAlign { diff --git a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFAbstractNum.java b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFAbstractNum.java index ac95c29ab2..0ccbc0571a 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFAbstractNum.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFAbstractNum.java @@ -19,9 +19,6 @@ package org.apache.poi.xwpf.usermodel; import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTAbstractNum; -/** - * @author Philipp Epp - */ public class XWPFAbstractNum { protected XWPFNumbering numbering; private CTAbstractNum ctAbstractNum; diff --git a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFHyperlink.java b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFHyperlink.java index c00f75a890..2948463b6b 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFHyperlink.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFHyperlink.java @@ -18,8 +18,6 @@ package org.apache.poi.xwpf.usermodel; /** * Sketch of XWPF hyperlink class - * - * @author Yury Batrakov (batrakov at gmail.com) */ public class XWPFHyperlink { String id, url; diff --git a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFNumbering.java b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFNumbering.java index 581c0128a4..292c831b03 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFNumbering.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFNumbering.java @@ -38,9 +38,6 @@ import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTNum; import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTNumbering; import org.openxmlformats.schemas.wordprocessingml.x2006.main.NumberingDocument; -/** - * @author Philipp Epp - */ public class XWPFNumbering extends POIXMLDocumentPart { protected List<XWPFAbstractNum> abstractNums = new ArrayList<>(); protected List<XWPFNum> nums = new ArrayList<>(); diff --git a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFPicture.java b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFPicture.java index f46d2cd158..5449c3bfd7 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFPicture.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFPicture.java @@ -23,9 +23,6 @@ import org.openxmlformats.schemas.drawingml.x2006.main.CTBlipFillProperties; import org.openxmlformats.schemas.drawingml.x2006.picture.CTPicture; -/** - * @author Philipp Epp - */ public class XWPFPicture { private CTPicture ctPic; @@ -78,7 +75,7 @@ public class XWPFPicture { } return null; } - + /** * Returns the width of the picture (in points). * @@ -87,9 +84,9 @@ public class XWPFPicture { public double getWidth() { return Units.toPoints(ctPic.getSpPr().getXfrm().getExt().getCx()); } - + /** - * Returns the depth of the picture (in points). + * Returns the depth of the picture (in points). * * @since POI 4.1.1 */ diff --git a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFPictureData.java b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFPictureData.java index 548c614661..2674b2f541 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFPictureData.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFPictureData.java @@ -31,8 +31,6 @@ import org.apache.poi.util.IOUtils; /** * Raw picture data, normally attached to a WordprocessingML Drawing. * As a rule, pictures are stored in the /word/media/ part of a WordprocessingML package. - * - * @author Philipp Epp */ public class XWPFPictureData extends POIXMLDocumentPart { @@ -69,13 +67,13 @@ public class XWPFPictureData extends POIXMLDocumentPart { * Construct XWPFPictureData from a package part * * @param part the package part holding the drawing data, - * + * * @since POI 3.14-Beta1 */ public XWPFPictureData(PackagePart part) { super(part); } - + @Override protected void onDocumentRead() throws IOException { super.onDocumentRead(); diff --git a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFRelation.java b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFRelation.java index d67a8303b9..a3989aa7e2 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFRelation.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFRelation.java @@ -25,9 +25,6 @@ import org.apache.poi.ooxml.POIXMLRelation; import org.apache.poi.openxml4j.opc.PackageRelationshipTypes; import org.apache.poi.xssf.usermodel.XSSFWorkbook; -/** - * @author Yegor Kozlov - */ public final class XWPFRelation extends POIXMLRelation { /** diff --git a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFStyle.java b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFStyle.java index 05f59189a5..c141d8c2c8 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFStyle.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFStyle.java @@ -20,9 +20,6 @@ package org.apache.poi.xwpf.usermodel; import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTStyle; import org.openxmlformats.schemas.wordprocessingml.x2006.main.STStyleType; -/** - * @author Philipp Epp - */ public class XWPFStyle { protected XWPFStyles styles; diff --git a/poi-ooxml/src/test/java/org/apache/poi/openxml4j/opc/TestFileHelper.java b/poi-ooxml/src/test/java/org/apache/poi/openxml4j/opc/TestFileHelper.java index 7a5d012fed..c1998ca132 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/openxml4j/opc/TestFileHelper.java +++ b/poi-ooxml/src/test/java/org/apache/poi/openxml4j/opc/TestFileHelper.java @@ -27,8 +27,6 @@ import org.junit.jupiter.api.Test; /** * Test TestFileHelper class. - * - * @author Julien Chable */ public final class TestFileHelper { diff --git a/poi-ooxml/src/test/java/org/apache/poi/openxml4j/opc/ZipFileAssert.java b/poi-ooxml/src/test/java/org/apache/poi/openxml4j/opc/ZipFileAssert.java index fcc6e3cff8..598630546b 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/openxml4j/opc/ZipFileAssert.java +++ b/poi-ooxml/src/test/java/org/apache/poi/openxml4j/opc/ZipFileAssert.java @@ -22,7 +22,6 @@ import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.junit.jupiter.api.Assertions.fail; import java.io.BufferedInputStream; import java.io.ByteArrayOutputStream; @@ -76,7 +75,7 @@ public final class ZipFileAssert { withDifferenceEvaluator(new IgnoreXMLDeclEvaluator()). withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byNameAndAllAttributes, ElementSelectors.byNameAndText)). build(); - assertFalse(diff.hasDifferences(), fileName+": "+diff.toString()); + assertFalse(diff.hasDifferences(), fileName+": "+ diff); } else { // not xml, may be an image or other binary format Assertions.assertEquals(contain1.size(), contain2.size(), fileName + " does not have the same size in both zip:"); @@ -118,10 +117,8 @@ public final class ZipFileAssert { } /** - * Asserts that two files are equal. Throws an <tt>AssertionFailedError</tt> + * Asserts that two files are equal. Throws an {@code AssertionFailedError} * if they are not. - * <p> - * */ public static void assertEquals(File expected, File actual) { assertNotNull(expected); diff --git a/poi-ooxml/src/test/java/org/apache/poi/openxml4j/opc/compliance/TestOPCCompliancePartName.java b/poi-ooxml/src/test/java/org/apache/poi/openxml4j/opc/compliance/TestOPCCompliancePartName.java index edfe0fea3e..c353234cd1 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/openxml4j/opc/compliance/TestOPCCompliancePartName.java +++ b/poi-ooxml/src/test/java/org/apache/poi/openxml4j/opc/compliance/TestOPCCompliancePartName.java @@ -80,8 +80,6 @@ import org.junit.jupiter.api.Test; * * Part name equivalence is determined by comparing part names as * case-insensitive ASCII strings. [M1.12] - * - * @author Julien Chable */ public final class TestOPCCompliancePartName { diff --git a/poi-ooxml/src/test/java/org/apache/poi/poifs/crypt/dsig/TestSignatureInfo.java b/poi-ooxml/src/test/java/org/apache/poi/poifs/crypt/dsig/TestSignatureInfo.java index 938d8a6622..83b79e1cb2 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/poifs/crypt/dsig/TestSignatureInfo.java +++ b/poi-ooxml/src/test/java/org/apache/poi/poifs/crypt/dsig/TestSignatureInfo.java @@ -412,6 +412,7 @@ class TestSignatureInfo { CommitableWorkbook(OPCPackage pkg) throws IOException { super(pkg); } + @Override public void commit() throws IOException { super.commit(); } diff --git a/poi-ooxml/src/test/java/org/apache/poi/ss/tests/formula/TestFormulaParser.java b/poi-ooxml/src/test/java/org/apache/poi/ss/tests/formula/TestFormulaParser.java index 5d1c7d8e31..18e189b03c 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/ss/tests/formula/TestFormulaParser.java +++ b/poi-ooxml/src/test/java/org/apache/poi/ss/tests/formula/TestFormulaParser.java @@ -43,8 +43,6 @@ import org.junit.jupiter.api.Test; /** * Test {@link FormulaParser}'s handling of row numbers at the edge of the * HSSF/XSSF ranges. - * - * @author David North */ class TestFormulaParser { diff --git a/poi-ooxml/src/test/java/org/apache/poi/ss/tests/formula/eval/TestXSSFCircularReferences.java b/poi-ooxml/src/test/java/org/apache/poi/ss/tests/formula/eval/TestXSSFCircularReferences.java index 114f70a13e..127c602680 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/ss/tests/formula/eval/TestXSSFCircularReferences.java +++ b/poi-ooxml/src/test/java/org/apache/poi/ss/tests/formula/eval/TestXSSFCircularReferences.java @@ -22,8 +22,6 @@ import org.apache.poi.xssf.XSSFITestDataProvider; /** * Tests XSSFFormulaEvaluator for its handling of cell formula circular references. - * - * @author Josh Micich */ public final class TestXSSFCircularReferences extends BaseTestCircularReferences { public TestXSSFCircularReferences() { diff --git a/poi-ooxml/src/test/java/org/apache/poi/ss/tests/usermodel/TestXSSFBorderStyle.java b/poi-ooxml/src/test/java/org/apache/poi/ss/tests/usermodel/TestXSSFBorderStyle.java index d191c7ab7c..25aba7aaad 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/ss/tests/usermodel/TestXSSFBorderStyle.java +++ b/poi-ooxml/src/test/java/org/apache/poi/ss/tests/usermodel/TestXSSFBorderStyle.java @@ -20,9 +20,6 @@ package org.apache.poi.ss.tests.usermodel; import org.apache.poi.ss.usermodel.BaseTestBorderStyle; import org.apache.poi.xssf.XSSFITestDataProvider; -/** - * @author Yegor Kozlov - */ public final class TestXSSFBorderStyle extends BaseTestBorderStyle { public TestXSSFBorderStyle() { diff --git a/poi-ooxml/src/test/java/org/apache/poi/xslf/XSLFTestDataSamples.java b/poi-ooxml/src/test/java/org/apache/poi/xslf/XSLFTestDataSamples.java index 72ed16f94b..d902c12714 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/xslf/XSLFTestDataSamples.java +++ b/poi-ooxml/src/test/java/org/apache/poi/xslf/XSLFTestDataSamples.java @@ -25,9 +25,6 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; -/** - * @author Yegor Kozlov - */ public class XSLFTestDataSamples { public static XMLSlideShow openSampleDocument(String sampleName) { @@ -52,7 +49,7 @@ public class XSLFTestDataSamples { } catch (IOException e) { throw new RuntimeException(e); } - + InputStream bais; bais = new ByteArrayInputStream(baos.toByteArray()); try { @@ -67,6 +64,6 @@ public class XSLFTestDataSamples { throw new RuntimeException(e); } } - + } } diff --git a/poi-ooxml/src/test/java/org/apache/poi/xslf/usermodel/TestXSLFSheet.java b/poi-ooxml/src/test/java/org/apache/poi/xslf/usermodel/TestXSLFSheet.java index cd467554e3..da81218db2 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/xslf/usermodel/TestXSLFSheet.java +++ b/poi-ooxml/src/test/java/org/apache/poi/xslf/usermodel/TestXSLFSheet.java @@ -26,8 +26,6 @@ import org.junit.jupiter.api.Test; /** * test common properties for sheets (slides, masters, layouts, etc.) - * - * @author Yegor Kozlov */ class TestXSLFSheet { diff --git a/poi-ooxml/src/test/java/org/apache/poi/xslf/usermodel/TestXSLFSlide.java b/poi-ooxml/src/test/java/org/apache/poi/xslf/usermodel/TestXSLFSlide.java index 3b83355369..6ba6751052 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/xslf/usermodel/TestXSLFSlide.java +++ b/poi-ooxml/src/test/java/org/apache/poi/xslf/usermodel/TestXSLFSlide.java @@ -31,9 +31,6 @@ import java.util.List; import org.apache.poi.xslf.XSLFTestDataSamples; import org.junit.jupiter.api.Test; -/** - * @author Yegor Kozlov - */ class TestXSLFSlide { @Test diff --git a/poi-ooxml/src/test/java/org/apache/poi/xslf/usermodel/TestXSLFSlideShow.java b/poi-ooxml/src/test/java/org/apache/poi/xslf/usermodel/TestXSLFSlideShow.java index 7e47a24b0a..adcbf3f34b 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/xslf/usermodel/TestXSLFSlideShow.java +++ b/poi-ooxml/src/test/java/org/apache/poi/xslf/usermodel/TestXSLFSlideShow.java @@ -28,9 +28,6 @@ import org.apache.poi.ooxml.POIXMLDocumentPart; import org.apache.poi.xslf.XSLFTestDataSamples; import org.junit.jupiter.api.Test; -/** - * @author Yegor Kozlov - */ class TestXSLFSlideShow { @Test void testCreateSlide() throws IOException { diff --git a/poi-ooxml/src/test/java/org/apache/poi/xslf/usermodel/TestXSLFTextBox.java b/poi-ooxml/src/test/java/org/apache/poi/xslf/usermodel/TestXSLFTextBox.java index 04fa9551d1..fc62cc945b 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/xslf/usermodel/TestXSLFTextBox.java +++ b/poi-ooxml/src/test/java/org/apache/poi/xslf/usermodel/TestXSLFTextBox.java @@ -25,9 +25,6 @@ import org.apache.poi.sl.usermodel.Placeholder; import org.junit.jupiter.api.Test; import org.openxmlformats.schemas.drawingml.x2006.main.CTTextCharacterProperties; -/** - * @author Yegor Kozlov - */ class TestXSLFTextBox { @Test diff --git a/poi-ooxml/src/test/java/org/apache/poi/xslf/usermodel/TestXSLFTextRun.java b/poi-ooxml/src/test/java/org/apache/poi/xslf/usermodel/TestXSLFTextRun.java index 783e8abe4d..7e92cea273 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/xslf/usermodel/TestXSLFTextRun.java +++ b/poi-ooxml/src/test/java/org/apache/poi/xslf/usermodel/TestXSLFTextRun.java @@ -36,9 +36,6 @@ import org.openxmlformats.schemas.drawingml.x2006.main.CTTextLineBreak; import org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraph; import org.openxmlformats.schemas.presentationml.x2006.main.CTShape; -/** - * @author Yegor Kozlov - */ class TestXSLFTextRun { @Test diff --git a/poi-ooxml/src/test/java/org/apache/poi/xslf/usermodel/TestXSLFTheme.java b/poi-ooxml/src/test/java/org/apache/poi/xslf/usermodel/TestXSLFTheme.java index 54f66f6b8b..a6bb976cb3 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/xslf/usermodel/TestXSLFTheme.java +++ b/poi-ooxml/src/test/java/org/apache/poi/xslf/usermodel/TestXSLFTheme.java @@ -34,8 +34,6 @@ import org.junit.jupiter.api.Test; /** * test reading properties from a multi-theme and multi-master document - * - * @author Yegor Kozlov */ class TestXSLFTheme { @Test diff --git a/poi-ooxml/src/test/java/org/apache/poi/xssf/SXSSFITestDataProvider.java b/poi-ooxml/src/test/java/org/apache/poi/xssf/SXSSFITestDataProvider.java index 90de9c5977..744b02beb0 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/xssf/SXSSFITestDataProvider.java +++ b/poi-ooxml/src/test/java/org/apache/poi/xssf/SXSSFITestDataProvider.java @@ -37,14 +37,11 @@ import org.apache.poi.xssf.streaming.SXSSFWorkbook; import org.apache.poi.xssf.usermodel.XSSFFormulaEvaluator; import org.apache.poi.xssf.usermodel.XSSFWorkbook; -/** - * @author Yegor Kozlov - */ public final class SXSSFITestDataProvider implements ITestDataProvider { public static final SXSSFITestDataProvider instance = new SXSSFITestDataProvider(); // an instance of all SXSSFWorkbooks opened by this TestDataProvider, - // so that the temporary files created can be disposed up by cleanup() + // so that the temporary files created can be disposed up by cleanup() private final Collection<SXSSFWorkbook> instances = new ArrayList<>(); private SXSSFITestDataProvider() { @@ -89,7 +86,7 @@ public final class SXSSFITestDataProvider implements ITestDataProvider { instances.add(wb); return wb; } - + //************ SXSSF-specific methods ***************// @Override public SXSSFWorkbook createWorkbook(int rowAccessWindowSize) { @@ -97,13 +94,13 @@ public final class SXSSFITestDataProvider implements ITestDataProvider { instances.add(wb); return wb; } - + @Override public void trackAllColumnsForAutosizing(Sheet sheet) { ((SXSSFSheet)sheet).trackAllColumnsForAutoSizing(); } //************ End SXSSF-specific methods ***************// - + @Override public FormulaEvaluator createFormulaEvaluator(Workbook wb) { return new XSSFFormulaEvaluator(((SXSSFWorkbook) wb).getXSSFWorkbook()); diff --git a/poi-ooxml/src/test/java/org/apache/poi/xssf/XSSFITestDataProvider.java b/poi-ooxml/src/test/java/org/apache/poi/xssf/XSSFITestDataProvider.java index e0ba6617ca..6876b9b61f 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/xssf/XSSFITestDataProvider.java +++ b/poi-ooxml/src/test/java/org/apache/poi/xssf/XSSFITestDataProvider.java @@ -26,9 +26,6 @@ import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.xssf.usermodel.XSSFFormulaEvaluator; import org.apache.poi.xssf.usermodel.XSSFWorkbook; -/** - * @author Yegor Kozlov - */ public final class XSSFITestDataProvider implements ITestDataProvider { public static final XSSFITestDataProvider instance = new XSSFITestDataProvider(); @@ -53,17 +50,17 @@ public final class XSSFITestDataProvider implements ITestDataProvider { public XSSFWorkbook createWorkbook() { return new XSSFWorkbook(); } - + //************ SXSSF-specific methods ***************// @Override public XSSFWorkbook createWorkbook(int rowAccessWindowSize) { return createWorkbook(); } - + @Override public void trackAllColumnsForAutosizing(Sheet sheet) {} //************ End SXSSF-specific methods ***************// - + @Override public FormulaEvaluator createFormulaEvaluator(Workbook wb) { return new XSSFFormulaEvaluator((XSSFWorkbook) wb); diff --git a/poi-ooxml/src/test/java/org/apache/poi/xssf/XSSFTestDataSamples.java b/poi-ooxml/src/test/java/org/apache/poi/xssf/XSSFTestDataSamples.java index b981b9994e..6beb153bd2 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/xssf/XSSFTestDataSamples.java +++ b/poi-ooxml/src/test/java/org/apache/poi/xssf/XSSFTestDataSamples.java @@ -33,8 +33,6 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook; /** * Centralises logic for finding/opening sample files in the test-data/spreadsheet folder. - * - * @author Josh Micich */ public class XSSFTestDataSamples { /** diff --git a/poi-ooxml/src/test/java/org/apache/poi/xssf/extractor/TestXSSFExportToXML.java b/poi-ooxml/src/test/java/org/apache/poi/xssf/extractor/TestXSSFExportToXML.java index 5a6afb7e20..e85998cb12 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/xssf/extractor/TestXSSFExportToXML.java +++ b/poi-ooxml/src/test/java/org/apache/poi/xssf/extractor/TestXSSFExportToXML.java @@ -50,9 +50,6 @@ import org.junit.jupiter.api.Test; import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; -/** - * @author Roberto Manicardi - */ public final class TestXSSFExportToXML { @Test diff --git a/poi-ooxml/src/test/java/org/apache/poi/xssf/model/TestMapInfo.java b/poi-ooxml/src/test/java/org/apache/poi/xssf/model/TestMapInfo.java index 290e5fcd0c..b0960fc5d7 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/xssf/model/TestMapInfo.java +++ b/poi-ooxml/src/test/java/org/apache/poi/xssf/model/TestMapInfo.java @@ -30,9 +30,6 @@ import org.junit.jupiter.api.Test; import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTMapInfo; import org.w3c.dom.Node; -/** - * @author Roberto Manicardi - */ public final class TestMapInfo { @Test void testMapInfoExists() throws IOException { diff --git a/poi-ooxml/src/test/java/org/apache/poi/xssf/streaming/TestSXSSFHyperlink.java b/poi-ooxml/src/test/java/org/apache/poi/xssf/streaming/TestSXSSFHyperlink.java index a29d0166e3..fb65eca044 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/xssf/streaming/TestSXSSFHyperlink.java +++ b/poi-ooxml/src/test/java/org/apache/poi/xssf/streaming/TestSXSSFHyperlink.java @@ -28,8 +28,6 @@ import org.apache.poi.xssf.usermodel.XSSFHyperlink; /** * Test setting hyperlinks in SXSSF - * - * @author Yegor Kozlov */ class TestSXSSFHyperlink extends BaseTestHyperlink { diff --git a/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestSXSSFSheetAutosizeColumn.java b/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestSXSSFSheetAutosizeColumn.java index 38ff1fc352..cc162c3820 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestSXSSFSheetAutosizeColumn.java +++ b/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestSXSSFSheetAutosizeColumn.java @@ -23,9 +23,6 @@ import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.xssf.SXSSFITestDataProvider; import org.apache.poi.xssf.streaming.SXSSFSheet; -/** - * @author Yegor Kozlov - */ public final class TestSXSSFSheetAutosizeColumn extends BaseTestSheetAutosizeColumn { public TestSXSSFSheetAutosizeColumn(){ diff --git a/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestUnfixedBugs.java b/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestUnfixedBugs.java index 4c9baa3a04..679c3c60bf 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestUnfixedBugs.java +++ b/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestUnfixedBugs.java @@ -57,8 +57,6 @@ import org.junit.jupiter.api.Test; import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTRow; /** - * @author centic - * * This testcase contains tests for bugs that are yet to be fixed. Therefore, * the standard ant test target does not run these tests. Run this testcase with * the single-test target. The names of the tests usually correspond to the diff --git a/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFPictureData.java b/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFPictureData.java index 5f8514c87b..9842e9ea58 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFPictureData.java +++ b/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFPictureData.java @@ -29,9 +29,6 @@ import org.apache.poi.util.LocaleUtil; import org.apache.poi.xssf.XSSFTestDataSamples; import org.junit.jupiter.api.Test; -/** - * @author Yegor Kozlov - */ public final class TestXSSFPictureData { @Test void testRead() throws IOException { diff --git a/poi-ooxml/src/test/java/org/apache/poi/xwpf/TestAllExtendedProperties.java b/poi-ooxml/src/test/java/org/apache/poi/xwpf/TestAllExtendedProperties.java index 09355e810d..ce6fd93ba4 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/xwpf/TestAllExtendedProperties.java +++ b/poi-ooxml/src/test/java/org/apache/poi/xwpf/TestAllExtendedProperties.java @@ -43,8 +43,6 @@ import org.openxmlformats.schemas.officeDocument.x2006.extendedProperties.CTVect * The author of this has added {@link CoreProperties#getKeywords()} and * {@link CoreProperties#setKeywords(String)} and this test is supposed to test * them. - * - * @author Antoni Mylka */ public final class TestAllExtendedProperties { @Test diff --git a/poi-ooxml/src/test/java/org/apache/poi/xwpf/XWPFTestDataSamples.java b/poi-ooxml/src/test/java/org/apache/poi/xwpf/XWPFTestDataSamples.java index d7cb2c23ad..b24d0bf46c 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/xwpf/XWPFTestDataSamples.java +++ b/poi-ooxml/src/test/java/org/apache/poi/xwpf/XWPFTestDataSamples.java @@ -25,9 +25,6 @@ import org.apache.poi.POIDataSamples; import org.apache.poi.util.IOUtils; import org.apache.poi.xwpf.usermodel.XWPFDocument; -/** - * @author Yegor Kozlov - */ public class XWPFTestDataSamples { public static XWPFDocument openSampleDocument(String sampleName) throws IOException { diff --git a/poi-ooxml/src/test/java/org/apache/poi/xwpf/usermodel/TestXWPFHeadings.java b/poi-ooxml/src/test/java/org/apache/poi/xwpf/usermodel/TestXWPFHeadings.java index 5e34741aed..adee241f69 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/xwpf/usermodel/TestXWPFHeadings.java +++ b/poi-ooxml/src/test/java/org/apache/poi/xwpf/usermodel/TestXWPFHeadings.java @@ -26,9 +26,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; -/** - * @author Paolo Mottadelli - */ public final class TestXWPFHeadings { private static final String HEADING1 = "Heading1"; diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hdgf/exceptions/HDGFException.java b/poi-scratchpad/src/main/java/org/apache/poi/hdgf/exceptions/HDGFException.java index c893bd2dfb..c7147328fa 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hdgf/exceptions/HDGFException.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hdgf/exceptions/HDGFException.java @@ -19,8 +19,6 @@ package org.apache.poi.hdgf.exceptions; /** * The superclass of all HDGF exceptions - * - * @author Yegor Kozlov */ public final class HDGFException extends RuntimeException { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/dev/SlideShowRecordDumper.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/dev/SlideShowRecordDumper.java index cff59a70c5..88b6407cab 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/dev/SlideShowRecordDumper.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/dev/SlideShowRecordDumper.java @@ -40,12 +40,10 @@ import org.apache.poi.util.HexDump; * This class provides a way to view the contents of a powerpoint file. * It will use the recored layer to grok the contents of the file, and * will print out what it finds. - * - * @author Nick Burch */ public final class SlideShowRecordDumper { static final String tabs = "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"; - + private boolean optVerbose; private boolean optEscher; private HSLFSlideShowImpl doc; @@ -203,16 +201,16 @@ public final class SlideShowRecordDumper { ps.println(ind+ child); prevChild = child; } - + } - + private void printEscherContainerRecord( EscherContainerRecord ecr, int indent ) { String ind = tabs.substring(0, indent); ps.println(ind + ecr.getClass().getName() + " (" + ecr.getRecordName() + "):"); ps.println(ind + " isContainer: " + ecr.isContainerRecord()); ps.println(ind + " options: 0x" + HexDump.toHex( ecr.getOptions() )); ps.println(ind + " recordId: 0x" + HexDump.toHex( ecr.getRecordId() )); - + ps.println(ind + " numchildren: " + ecr.getChildCount()); ps.println(ind + " children: "); int count = 0; diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/exceptions/CorruptPowerPointFileException.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/exceptions/CorruptPowerPointFileException.java index 3c61039483..e585f64f0a 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/exceptions/CorruptPowerPointFileException.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/exceptions/CorruptPowerPointFileException.java @@ -20,16 +20,13 @@ package org.apache.poi.hslf.exceptions; /** * This exception is thrown when we try to open a PowerPoint file, and * something is fundamentally broken about it. - * - * @author Nick Burch */ - public final class CorruptPowerPointFileException extends IllegalStateException { public CorruptPowerPointFileException(String s) { super(s); } - + public CorruptPowerPointFileException(String s, Throwable t) { super(s,t); } diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/exceptions/HSLFException.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/exceptions/HSLFException.java index f534d9ce0d..061d5a8457 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/exceptions/HSLFException.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/exceptions/HSLFException.java @@ -19,8 +19,6 @@ package org.apache.poi.hslf.exceptions; /** * A generic exception that can be thrown by HSLF classes - * - * @author Yegor Kozlov */ public final class HSLFException extends RuntimeException { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/model/MovieShape.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/model/MovieShape.java index ee00ae73ab..c5e001ff7e 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/model/MovieShape.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/model/MovieShape.java @@ -39,8 +39,6 @@ import org.apache.poi.sl.usermodel.ShapeContainer; /** * Represents a movie in a PowerPoint document. - * - * @author Yegor Kozlov */ public final class MovieShape extends HSLFPictureShape { public static final int DEFAULT_MOVIE_THUMBNAIL = -1; diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/model/Polygon.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/model/Polygon.java index 061e89555c..3c4e8b04cf 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/model/Polygon.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/model/Polygon.java @@ -35,8 +35,6 @@ import org.apache.poi.util.Units; /** * A simple closed polygon shape - * - * @author Yegor Kozlov */ public final class Polygon extends HSLFAutoShape { /** diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/model/textproperties/ParagraphFlagsTextProp.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/model/textproperties/ParagraphFlagsTextProp.java index 0ffc38e5b3..4a8b9f01d6 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/model/textproperties/ParagraphFlagsTextProp.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/model/textproperties/ParagraphFlagsTextProp.java @@ -19,8 +19,6 @@ package org.apache.poi.hslf.model.textproperties; /** * Definition for the common paragraph text property bitset. - * - * @author Yegor Kozlov */ public final class ParagraphFlagsTextProp extends BitMaskTextProp { public static final int BULLET_IDX = 0; diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/model/textproperties/TextPFException9.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/model/textproperties/TextPFException9.java index 927cbe553d..8197b30890 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/model/textproperties/TextPFException9.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/model/textproperties/TextPFException9.java @@ -35,9 +35,6 @@ import org.apache.poi.util.LittleEndian; * this means the default values will be used: statNumber=1 and sheme=ANM_ArabicPeriod * @see <a href="http://social.msdn.microsoft.com/Forums/mr-IN/os_binaryfile/thread/650888db-fabd-4b95-88dc-f0455f6e2d28"> * http://social.msdn.microsoft.com/Forums/mr-IN/os_binaryfile/thread/650888db-fabd-4b95-88dc-f0455f6e2d28</a> - * - * @author Alex Nikiforov [mailto:anikif@gmail.com] - * */ public class TextPFException9 implements GenericRecord { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/AnimationInfo.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/AnimationInfo.java index 9bf2bf789f..09f237280d 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/AnimationInfo.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/AnimationInfo.java @@ -27,8 +27,6 @@ import static org.apache.logging.log4j.util.Unbox.box; /** * A container record that specifies information about animation information for a shape. - * - * @author Yegor Kozlov */ public final class AnimationInfo extends RecordContainer { private byte[] _header; diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/AnimationInfoAtom.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/AnimationInfoAtom.java index f9ec145eac..95e076e83b 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/AnimationInfoAtom.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/AnimationInfoAtom.java @@ -31,8 +31,6 @@ import org.apache.poi.util.LittleEndian; /** * An atom record that specifies the animation information for a shape. - * - * @author Yegor Kozlov */ public final class AnimationInfoAtom extends RecordAtom { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/BinaryTagDataBlob.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/BinaryTagDataBlob.java index 79d8d9da7d..2910c18fb2 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/BinaryTagDataBlob.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/BinaryTagDataBlob.java @@ -31,8 +31,6 @@ import org.apache.poi.util.LittleEndian; * disk this is, but not much else. * Anything done using this should quite quickly be transitioned to its * own proper record class! - * - * @author Nick Burch */ public final class BinaryTagDataBlob extends PositionDependentRecordContainer diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/CString.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/CString.java index 329915f93e..f2991f02c1 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/CString.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/CString.java @@ -32,8 +32,6 @@ import org.apache.poi.util.StringUtil; * A CString (type 4026). Holds a unicode string, and the first two bytes * of the record header normally encode the count. Typically attached to * some complex sequence of records, eg Commetns. - * - * @author Nick Burch */ public final class CString extends RecordAtom { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ColorSchemeAtom.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ColorSchemeAtom.java index 8625245844..bd2ac34d98 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ColorSchemeAtom.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ColorSchemeAtom.java @@ -34,8 +34,6 @@ import org.apache.poi.util.LittleEndian; * colours of bits of text, that makes up a given colour scheme. * Slides (presumably) link to a given colour scheme atom, and that * defines the colours to be used - * - * @author Nick Burch */ public final class ColorSchemeAtom extends RecordAtom { private byte[] _header; diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/Comment2000.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/Comment2000.java index 69c8d2181f..f0f33ab863 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/Comment2000.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/Comment2000.java @@ -28,7 +28,6 @@ import static org.apache.logging.log4j.util.Unbox.box; /** * This class represents a comment on a slide, in the format used by * PPT 2000/XP/etc. (PPT 97 uses plain Escher Text Boxes for comments) - * @author Nick Burch */ public final class Comment2000 extends RecordContainer { private byte[] _header; diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/Comment2000Atom.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/Comment2000Atom.java index 00c3cdef01..765b7d41b1 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/Comment2000Atom.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/Comment2000Atom.java @@ -31,8 +31,6 @@ import org.apache.poi.util.LittleEndian; /** * An atomic record containing information about a comment. - * - * @author Daniel Noll */ public final class Comment2000Atom extends RecordAtom diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/Document.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/Document.java index 73489a9d2f..de69dd05a5 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/Document.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/Document.java @@ -27,8 +27,6 @@ import static org.apache.logging.log4j.util.Unbox.box; /** * Master container for Document. There is one of these for every * slideshow, and it holds lots of definitions, and some summaries. - * - * @author Nick Burch */ public final class Document extends PositionDependentRecordContainer diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/DocumentEncryptionAtom.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/DocumentEncryptionAtom.java index bb498f2088..c0b1d09c6d 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/DocumentEncryptionAtom.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/DocumentEncryptionAtom.java @@ -39,8 +39,6 @@ import org.apache.poi.util.LittleEndianInputStream; /** * A Document Encryption Atom (type 12052). Holds information * on the Encryption of a Document - * - * @author Nick Burch */ public final class DocumentEncryptionAtom extends PositionDependentRecordAtom { private static final long _type = RecordTypes.DocumentEncryptionAtom.typeID; diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/DummyPositionSensitiveRecordWithChildren.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/DummyPositionSensitiveRecordWithChildren.java index db7a0cb943..526bc363d8 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/DummyPositionSensitiveRecordWithChildren.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/DummyPositionSensitiveRecordWithChildren.java @@ -31,8 +31,6 @@ import org.apache.poi.util.LittleEndian; * disk this is, but not much else. * Anything done using this should quite quickly be transitioned to its * own proper record class! - * - * @author Nick Burch */ public final class DummyPositionSensitiveRecordWithChildren extends PositionDependentRecordContainer diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/DummyRecordWithChildren.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/DummyRecordWithChildren.java index cc99aa2f98..93e5aa3cca 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/DummyRecordWithChildren.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/DummyRecordWithChildren.java @@ -27,8 +27,6 @@ import org.apache.poi.util.LittleEndian; * If we come across a record we know has children of (potential) * interest, but where the record itself is boring, we create one * of these. It allows us to get at the children, but not much else - * - * @author Nick Burch */ public final class DummyRecordWithChildren extends RecordContainer diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/Environment.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/Environment.java index a8bebeaeaa..25d5820ec4 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/Environment.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/Environment.java @@ -23,8 +23,6 @@ import java.util.Arrays; /** * Environment, which contains lots of settings for the document. - * - * @author Nick Burch */ public final class Environment extends PositionDependentRecordContainer diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/EscherTextboxWrapper.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/EscherTextboxWrapper.java index 7cfe763f98..7a47e9fd4e 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/EscherTextboxWrapper.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/EscherTextboxWrapper.java @@ -32,8 +32,6 @@ import org.apache.poi.util.GenericRecordUtil; * Note: when asked to write out, will simply put any child records correctly * into the Escher layer. A call to the escher layer to write out (by the * parent PPDrawing) will do the actual write out - * - * @author Nick Burch */ public final class EscherTextboxWrapper extends RecordContainer { private EscherTextboxRecord _escherRecord; diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ExAviMovie.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ExAviMovie.java index 62a5c4bbe3..7d9086ef65 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ExAviMovie.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ExAviMovie.java @@ -20,8 +20,6 @@ package org.apache.poi.hslf.record; /** * A container record that specifies information about a movie stored externally. - * - * @author Yegor Kozlov */ public final class ExAviMovie extends ExMCIMovie { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ExControl.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ExControl.java index 58be5715ee..9fdebc86b8 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ExControl.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ExControl.java @@ -28,10 +28,6 @@ package org.apache.poi.hslf.record; * A ProgID is a string that uniquely identifies a given object. * 5. CString (4026), Instance ClipboardName (3) that appears in the paste special dialog. * 6. MetaFile( 4033), optional - * </p> - * - * - * @author Yegor kozlov */ public final class ExControl extends ExEmbed { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ExControlAtom.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ExControlAtom.java index 58d27ef340..d0ea0811b4 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ExControlAtom.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ExControlAtom.java @@ -28,8 +28,6 @@ import org.apache.poi.util.LittleEndian; /** * An atom record that specifies an ActiveX control. - * - * @author Yegor Kozlov */ public final class ExControlAtom extends RecordAtom { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ExEmbedAtom.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ExEmbedAtom.java index f3c3a48f43..1841a6deda 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ExEmbedAtom.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ExEmbedAtom.java @@ -40,8 +40,6 @@ import org.apache.poi.util.LittleEndian; * 5 bool1 noSizeToServerB Set if don't need to send the dimension to the embedded object * 6 Bool1 isTable Set if the object is a Word table * --> - * - * @author Daniel Noll */ public class ExEmbedAtom extends RecordAtom { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ExHyperlink.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ExHyperlink.java index 945a8df41b..0d20be1424 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ExHyperlink.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ExHyperlink.java @@ -26,7 +26,6 @@ import static org.apache.logging.log4j.util.Unbox.box; /** * This class represents the data of a link in the document. - * @author Nick Burch */ public class ExHyperlink extends RecordContainer { private static final long _type = RecordTypes.ExHyperlink.typeID; diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ExHyperlinkAtom.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ExHyperlinkAtom.java index ba63ac5da6..104973c8ca 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ExHyperlinkAtom.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ExHyperlinkAtom.java @@ -30,8 +30,6 @@ import org.apache.poi.util.LittleEndian; /** * Tne atom that holds metadata on a specific Link in the document. * (The actual link is held in a sibling CString record) - * - * @author Nick Burch */ public final class ExHyperlinkAtom extends RecordAtom { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ExMCIMovie.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ExMCIMovie.java index 81654dfded..dc784921ad 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ExMCIMovie.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ExMCIMovie.java @@ -27,8 +27,6 @@ import static org.apache.logging.log4j.util.Unbox.box; /** * A container record that specifies information about a movie stored externally. - * - * @author Yegor Kozlov */ public class ExMCIMovie extends RecordContainer { // TODO - instantiable superclass private byte[] _header; diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ExMediaAtom.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ExMediaAtom.java index 486b976f66..c65d1a5603 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ExMediaAtom.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ExMediaAtom.java @@ -32,8 +32,6 @@ import org.apache.poi.util.LittleEndian; /** * An atom record that specifies information about external audio or video data. - * - * @author Yegor Kozlov */ public final class ExMediaAtom extends RecordAtom { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ExObjList.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ExObjList.java index bee803a21b..86437d8df0 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ExObjList.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ExObjList.java @@ -24,9 +24,7 @@ import java.util.Arrays; import org.apache.poi.util.LittleEndian; /** - * This class holds the links to exernal objects referenced - * from the document. - * @author Nick Burch + * This class holds the links to exernal objects referenced from the document. */ public class ExObjList extends RecordContainer { private byte[] _header; diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ExObjListAtom.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ExObjListAtom.java index 5fab662c42..3b5b7125d2 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ExObjListAtom.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ExObjListAtom.java @@ -30,8 +30,6 @@ import org.apache.poi.util.LittleEndian; /** * Tne atom that holds the seed info used by a ExObjList - * - * @author Nick Burch */ public class ExObjListAtom extends RecordAtom diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ExVideoContainer.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ExVideoContainer.java index c6935e84dd..9c3398a359 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ExVideoContainer.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ExVideoContainer.java @@ -27,8 +27,6 @@ import static org.apache.logging.log4j.util.Unbox.box; /** * A container record that specifies information about external video data. - * - * @author Yegor Kozlov */ public final class ExVideoContainer extends RecordContainer { private byte[] _header; diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/FontEntityAtom.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/FontEntityAtom.java index 0d576f6a6a..4ba09c1892 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/FontEntityAtom.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/FontEntityAtom.java @@ -38,8 +38,6 @@ import org.apache.poi.util.StringUtil; * It keeps all the information needed to define the attributes of a font, * such as height, width, etc. For more information, consult the * Windows API Programmer's reference. - * - * @author Yegor Kozlov */ public final class FontEntityAtom extends RecordAtom { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/HeadersFootersAtom.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/HeadersFootersAtom.java index 42f8d017ca..9d51daa0fc 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/HeadersFootersAtom.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/HeadersFootersAtom.java @@ -33,8 +33,6 @@ import org.apache.poi.util.LittleEndian; /** * An atom record that specifies options for displaying headers and footers * on a presentation slide or notes slide. - * - * @author Yegor Kozlov */ public final class HeadersFootersAtom extends RecordAtom { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/HeadersFootersContainer.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/HeadersFootersContainer.java index 2c1bd86229..6c1d9c3b56 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/HeadersFootersContainer.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/HeadersFootersContainer.java @@ -28,15 +28,14 @@ import static org.apache.logging.log4j.util.Unbox.box; /** * A container record that specifies information about the footers on a presentation slide. * <p> - * It contains:<br> + * It contains: + * <ul> * <li> 1. {@link HeadersFootersAtom} * <li> 2. {@link CString }, Instance UserDate (0), optional: Stores the user's date. * This is the date that the user wants in the footers, instead of today's date. * <li> 3. {@link CString }, Instance Header (1), optional: Stores the Header's contents. * <li> 4. {@link CString }, Instance Footer (2), optional: Stores the Footer's contents. - * </p> - * - * @author Yegor Kozlov + * </ul> */ public final class HeadersFootersContainer extends RecordContainer { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/InteractiveInfo.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/InteractiveInfo.java index 38b0c6ecc9..63826003a0 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/InteractiveInfo.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/InteractiveInfo.java @@ -26,7 +26,6 @@ import org.apache.poi.util.LittleEndian; * This class represents the metadata of a link in a slide/notes/etc. * It normally just holds a InteractiveInfoAtom, with the metadata * in it. - * @author Nick Burch */ public class InteractiveInfo extends RecordContainer { private byte[] _header; diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/InteractiveInfoAtom.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/InteractiveInfoAtom.java index 3543010612..5b60c632fc 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/InteractiveInfoAtom.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/InteractiveInfoAtom.java @@ -33,9 +33,6 @@ import org.apache.poi.util.LittleEndian; /** * Tne atom that holds metadata on Links in the document. * (The actual link is held Document.ExObjList.ExHyperlink) - * - * @author Nick Burch - * @author Yegor Kozlov */ public class InteractiveInfoAtom extends RecordAtom { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/MainMaster.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/MainMaster.java index e771fcf57d..62c475de46 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/MainMaster.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/MainMaster.java @@ -24,8 +24,6 @@ import java.util.Arrays; /** * Master slide - * - * @author Yegor Kozlov */ public final class MainMaster extends SheetContainer { private byte[] _header; diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/Notes.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/Notes.java index 4854426283..b53842f70f 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/Notes.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/Notes.java @@ -24,8 +24,6 @@ import java.util.Arrays; /** * Master container for Notes. There is one of these for every page of * notes, and they have certain specific children - * - * @author Nick Burch */ public final class Notes extends SheetContainer diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/NotesAtom.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/NotesAtom.java index 655898adb8..74fb25f27e 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/NotesAtom.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/NotesAtom.java @@ -30,8 +30,6 @@ import org.apache.poi.util.LittleEndian; /** * A Notes Atom (type 1009). Holds information on the parent Notes, such * as what slide it is tied to - * - * @author Nick Burch */ public final class NotesAtom extends RecordAtom diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/OutlineTextRefAtom.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/OutlineTextRefAtom.java index e521c74383..e56a9aec16 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/OutlineTextRefAtom.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/OutlineTextRefAtom.java @@ -35,9 +35,6 @@ import org.apache.poi.util.LittleEndian; * in a SlideListWithText containter. Sometimes slide texts are not contained * within the slide container to be able to delay loading a slide and still display * the title and body text in outline view. - * </p> - * - * @author Yegor Kozlov */ public final class OutlineTextRefAtom extends RecordAtom { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ParentAwareRecord.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ParentAwareRecord.java index b2d84373cb..d09c8f7702 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ParentAwareRecord.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/ParentAwareRecord.java @@ -20,8 +20,6 @@ package org.apache.poi.hslf.record; /** * Interface to define how a record can indicate it cares about what its * parent is, and how it wants to be told which record is its parent. - * - * @author Nick Burch (nick at torchbox dot com) */ public interface ParentAwareRecord { public org.apache.poi.hslf.record.RecordContainer getParentRecord(); diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/PersistRecord.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/PersistRecord.java index 339331865c..23cb585f81 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/PersistRecord.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/PersistRecord.java @@ -19,8 +19,6 @@ package org.apache.poi.hslf.record; /** * A record that can be referenced in PersistPtr storage. - * - * @author Yegor Kozlov */ public interface PersistRecord { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/PositionDependentRecord.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/PositionDependentRecord.java index 844c14d45d..e71a9a7b5a 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/PositionDependentRecord.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/PositionDependentRecord.java @@ -28,8 +28,6 @@ import java.util.Map; * need to be pinged with their current location. When written out, they * need to be given their new location, and offered the list of records * which have changed their location. - * - * @author Nick Burch */ public interface PositionDependentRecord diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/Record.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/Record.java index be3bde7aab..e66f481c1f 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/Record.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/Record.java @@ -38,8 +38,6 @@ import static org.apache.logging.log4j.util.Unbox.box; * This abstract class represents a record in the PowerPoint document. * Record classes should extend with RecordContainer or RecordAtom, which * extend this in turn. - * - * @author Nick Burch */ public abstract class Record implements GenericRecord diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/RecordAtom.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/RecordAtom.java index 4de227a2c2..9d2cbb1457 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/RecordAtom.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/RecordAtom.java @@ -19,8 +19,6 @@ package org.apache.poi.hslf.record; /** * Abstract class which all atom records will extend. - * - * @author Nick Burch */ public abstract class RecordAtom extends Record diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/RoundTripHFPlaceholder12.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/RoundTripHFPlaceholder12.java index 283c65ba43..d29cfb99df 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/RoundTripHFPlaceholder12.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/RoundTripHFPlaceholder12.java @@ -28,9 +28,6 @@ import org.apache.poi.util.LittleEndian; /** * An atom record that specifies that a shape is a header or footer placeholder shape - * - * @since PowerPoint 2007 - * @author Yegor Kozlov */ public final class RoundTripHFPlaceholder12 extends RecordAtom { /** diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/Slide.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/Slide.java index cf8d2466c0..f8e718a9e5 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/Slide.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/Slide.java @@ -26,8 +26,6 @@ import org.apache.poi.util.LittleEndian; /** * Master container for Slides. There is one of these for every slide, * and they have certain specific children - * - * @author Nick Burch */ public final class Slide extends SheetContainer diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/SlideListWithText.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/SlideListWithText.java index d0298a5be2..b57207e41d 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/SlideListWithText.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/SlideListWithText.java @@ -42,8 +42,6 @@ import org.apache.poi.util.LittleEndian; * * For now, we scan through looking for interesting bits, then creating * the helpful Sheet from model for them - * - * @author Nick Burch */ // For now, pretend to be an atom diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/Sound.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/Sound.java index 2df455bd9e..1fca0bf9d4 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/Sound.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/Sound.java @@ -25,15 +25,13 @@ import static org.apache.logging.log4j.util.Unbox.box; /** * A container holding information about a sound. It contains: - * <p> + * <ul> * <li>1. CString (4026), Instance 0: Name of sound (e.g. "crash") * <li>2. CString (4026), Instance 1: Type of sound (e.g. ".wav") * <li>3. CString (4026), Instance 2: Reference id of sound in sound collection * <li>4. CString (4026), Instance 3, optional: Built-in id of sound, for sounds we ship. This is the id that?s in the reg file. * <li>5. SoundData (2023), optional - * </p> - * - * @author Yegor Kozlov + * </ul> */ public final class Sound extends RecordContainer { /** diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/SoundCollection.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/SoundCollection.java index 3fda587c6e..d55cfe25e2 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/SoundCollection.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/SoundCollection.java @@ -23,10 +23,10 @@ import java.util.Arrays; /** * Is a container for all sound related atoms and containers. It contains: - *<li>1. SoundCollAtom (2021) - *<li>2. Sound (2022), for each sound, if any - * - * @author Yegor Kozlov + * <ul> + * <li>1. SoundCollAtom (2021)</li> + * <li>2. Sound (2022), for each sound, if any</li> + * </ul> */ public final class SoundCollection extends RecordContainer { /** diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/SoundData.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/SoundData.java index 0989052c56..f51e059a21 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/SoundData.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/SoundData.java @@ -29,8 +29,6 @@ import org.apache.poi.util.LittleEndian; /** * Storage for embedded sounds. - * - * @author Yegor Kozlov */ public final class SoundData extends RecordAtom { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/TextSpecInfoAtom.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/TextSpecInfoAtom.java index b26e9cb04b..fdc16db465 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/TextSpecInfoAtom.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/TextSpecInfoAtom.java @@ -35,8 +35,6 @@ import org.apache.poi.util.LittleEndianByteArrayInputStream; /** * The special info runs contained in this text. * Special info runs consist of character properties which don?t follow styles. - * - * @author Yegor Kozlov */ public final class TextSpecInfoAtom extends RecordAtom { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/TxInteractiveInfoAtom.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/TxInteractiveInfoAtom.java index f5896aa817..87175331be 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/TxInteractiveInfoAtom.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/TxInteractiveInfoAtom.java @@ -29,8 +29,6 @@ import org.apache.poi.util.LittleEndian; /** * Tne atom that holds starting and ending character positions of a hyperlink - * - * @author Yegor Kozlov */ public final class TxInteractiveInfoAtom extends RecordAtom { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/UnknownRecordPlaceholder.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/UnknownRecordPlaceholder.java index 886a0dd20f..6b1b5483e4 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/UnknownRecordPlaceholder.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/UnknownRecordPlaceholder.java @@ -30,8 +30,6 @@ import org.apache.poi.util.LittleEndian; * If we come across a record we don't know about, we create one of * these. It allows us to keep track of what it contains, so we can * write it back out to disk unchanged - * - * @author Nick Burch */ @SuppressWarnings("unused") diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFBackground.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFBackground.java index 8f477f9562..eac3d846fb 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFBackground.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFBackground.java @@ -23,8 +23,6 @@ import org.apache.poi.sl.usermodel.ShapeContainer; /** * Background shape - * - * @author Yegor Kozlov */ public final class HSLFBackground extends HSLFShape implements Background<HSLFShape,HSLFTextParagraph> { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFLine.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFLine.java index 1e42326f26..38a3a5fe6f 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFLine.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFLine.java @@ -27,8 +27,6 @@ import org.apache.poi.sl.usermodel.ShapeType; /** * Represents a line in a PowerPoint drawing - * - * @author Yegor Kozlov */ public final class HSLFLine extends HSLFTextShape implements Line<HSLFShape,HSLFTextParagraph> { public HSLFLine(EscherContainerRecord escherRecord, ShapeContainer<HSLFShape,HSLFTextParagraph> parent){ @@ -47,7 +45,7 @@ public final class HSLFLine extends HSLFTextShape implements Line<HSLFShape,HSLF @Override protected EscherContainerRecord createSpContainer(boolean isChild){ EscherContainerRecord ecr = super.createSpContainer(isChild); - + setShapeType(ShapeType.LINE); EscherSpRecord spRecord = ecr.getChildById(EscherSpRecord.RECORD_ID); @@ -67,20 +65,20 @@ public final class HSLFLine extends HSLFTextShape implements Line<HSLFShape,HSLF return ecr; } - + // /** // * Sets the orientation of the line, if inverse is false, then line goes -// * from top-left to bottom-right, otherwise use inverse equals true +// * from top-left to bottom-right, otherwise use inverse equals true // * // * @param inverse the orientation of the line // */ // public void setInverse(boolean inverse) { // setShapeType(inverse ? ShapeType.LINE_INV : ShapeType.LINE); // } -// +// // /** // * Gets the orientation of the line, if inverse is false, then line goes -// * from top-left to bottom-right, otherwise inverse equals true +// * from top-left to bottom-right, otherwise inverse equals true // * // * @return inverse the orientation of the line // */ diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFNotes.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFNotes.java index 9377bfa439..baca28cd5d 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFNotes.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFNotes.java @@ -31,8 +31,6 @@ import org.apache.poi.sl.usermodel.Placeholder; * This class represents a slide's notes in a PowerPoint Document. It * allows access to the text within, and the layout. For now, it only * does the text side of things though - * - * @author Nick Burch */ public final class HSLFNotes extends HSLFSheet implements Notes<HSLFShape,HSLFTextParagraph> { @@ -72,6 +70,7 @@ public final class HSLFNotes extends HSLFSheet implements Notes<HSLFShape,HSLFTe /** * Return <code>null</code> - Notes Masters are not yet supported */ + @Override public HSLFMasterSheet getMasterSheet() { return null; } diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFPlaceholder.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFPlaceholder.java index 4b13300590..9366dface1 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFPlaceholder.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFPlaceholder.java @@ -23,8 +23,6 @@ import org.apache.poi.sl.usermodel.ShapeContainer; /** * Represents a Placeholder in PowerPoint. - * - * @author Yegor Kozlov */ public final class HSLFPlaceholder extends HSLFTextBox { @@ -48,7 +46,7 @@ public final class HSLFPlaceholder extends HSLFTextBox { @Override protected EscherContainerRecord createSpContainer(boolean isChild){ EscherContainerRecord ecr = super.createSpContainer(isChild); - + setPlaceholder(Placeholder.BODY); return ecr; diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSheet.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSheet.java index 9a010661c5..6ceafed5b4 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSheet.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSheet.java @@ -47,14 +47,11 @@ import org.apache.poi.util.Internal; /** * This class defines the common format of "Sheets" in a powerpoint * document. Such sheets could be Slides, Notes, Master etc - * - * @author Nick Burch - * @author Yegor Kozlov */ public abstract class HSLFSheet implements HSLFShapeContainer, Sheet<HSLFShape,HSLFTextParagraph> { /** - * The <code>SlideShow</code> we belong to + * The {@code SlideShow} we belong to */ private HSLFSlideShow _slideShow; @@ -69,9 +66,9 @@ public abstract class HSLFSheet implements HSLFShapeContainer, Sheet<HSLFShape,H * for notes it is org.apache.poi.hslf.record.Notes, * for slide masters it is org.apache.poi.hslf.record.SlideMaster, etc. */ - private SheetContainer _container; + private final SheetContainer _container; - private int _sheetNo; + private final int _sheetNo; public HSLFSheet(SheetContainer container, int sheetNo) { _container = container; @@ -130,7 +127,7 @@ public abstract class HSLFSheet implements HSLFShapeContainer, Sheet<HSLFShape,H if (_slideShow != null) { throw new HSLFException("Can't change existing slideshow reference"); } - + _slideShow = ss; List<List<HSLFTextParagraph>> trs = getTextParagraphs(); if (trs == null) { @@ -177,14 +174,14 @@ public abstract class HSLFSheet implements HSLFShapeContainer, Sheet<HSLFShape,H EscherContainerRecord sp = (EscherContainerRecord)r; HSLFShape sh = HSLFShapeFactory.createShape(sp, null); sh.setSheet(this); - + if (sh instanceof HSLFSimpleShape) { HSLFHyperlink link = HSLFHyperlink.find(sh); if (link != null) { ((HSLFSimpleShape)sh).setHyperlink(link); } } - + shapeList.add(sh); } @@ -224,7 +221,7 @@ public abstract class HSLFSheet implements HSLFShapeContainer, Sheet<HSLFShape,H * Removes the specified shape from this sheet. * * @param shape shape to be removed from this sheet, if present. - * @return <tt>true</tt> if the shape was deleted. + * @return {@code true} if the shape was deleted. */ @Override public boolean removeShape(HSLFShape shape) { @@ -287,8 +284,6 @@ public abstract class HSLFSheet implements HSLFShapeContainer, Sheet<HSLFShape,H /** * Subclasses should call this method and update the array of text runs * when a text shape is added - * - * @param shape */ protected void onAddTextShape(HSLFTextShape shape) { } @@ -297,7 +292,7 @@ public abstract class HSLFSheet implements HSLFShapeContainer, Sheet<HSLFShape,H * Return placeholder by text type * * @param type type of text, See {@link org.apache.poi.hslf.record.TextHeaderAtom} - * @return <code>TextShape</code> or <code>null</code> + * @return {@code TextShape} or {@code null} */ public HSLFTextShape getPlaceholderByTextType(int type){ for (HSLFShape shape : getShapes()) { @@ -330,7 +325,7 @@ public abstract class HSLFSheet implements HSLFShapeContainer, Sheet<HSLFShape,H } /** - * Return programmable tag associated with this sheet, e.g. <code>___PPT12</code>. + * Return programmable tag associated with this sheet, e.g. {@code ___PPT12}. * * @return programmable tag associated with this sheet. */ @@ -452,7 +447,7 @@ public abstract class HSLFSheet implements HSLFShapeContainer, Sheet<HSLFShape,H addShape(s); return s; } - + /** * Header / Footer settings for this slide. * diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSlide.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSlide.java index 7d1b6711ee..1d51de9f91 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSlide.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSlide.java @@ -33,7 +33,6 @@ import org.apache.poi.hslf.record.ColorSchemeAtom; import org.apache.poi.hslf.record.Comment2000; import org.apache.poi.hslf.record.EscherTextboxWrapper; import org.apache.poi.hslf.record.HeadersFootersContainer; -import org.apache.poi.hslf.record.Record; import org.apache.poi.hslf.record.RecordContainer; import org.apache.poi.hslf.record.RecordTypes; import org.apache.poi.hslf.record.SSSlideInfoAtom; @@ -54,9 +53,6 @@ import org.apache.poi.sl.usermodel.TextShape.TextPlaceholder; * This class represents a slide in a PowerPoint Document. It allows * access to the text within, and the layout. For now, it only does * the text side of things though - * - * @author Nick Burch - * @author Yegor Kozlov */ public final class HSLFSlide extends HSLFSheet implements Slide<HSLFShape,HSLFTextParagraph> { @@ -154,9 +150,10 @@ public final class HSLFSlide extends HSLFSheet implements Slide<HSLFShape,HSLFTe * Called by SlideShow ater a new slide is created. * <p> * For Slide we need to do the following: - * <li> set id of the drawing group. - * <li> set shapeId for the container descriptor and background - * </p> + * <ul> + * <li> set id of the drawing group.</li> + * <li> set shapeId for the container descriptor and background</li> + * </ul> */ @Override public void onCreate(){ @@ -191,9 +188,9 @@ public final class HSLFSlide extends HSLFSheet implements Slide<HSLFShape,HSLFTe } /** - * Create a <code>TextBox</code> object that represents the slide's title. + * Create a {@code TextBox} object that represents the slide's title. * - * @return <code>TextBox</code> object that represents the slide's title. + * @return {@code TextBox} object that represents the slide's title. */ public HSLFTextBox addTitle() { HSLFPlaceholder pl = new HSLFPlaceholder(); @@ -211,8 +208,8 @@ public final class HSLFSlide extends HSLFSheet implements Slide<HSLFShape,HSLFTe /** * <p> - * The title is a run of text of type <code>TextHeaderAtom.CENTER_TITLE_TYPE</code> or - * <code>TextHeaderAtom.TITLE_TYPE</code> + * The title is a run of text of type {@code TextHeaderAtom.CENTER_TITLE_TYPE} or + * {@code TextHeaderAtom.TITLE_TYPE} * </p> * * @see TextHeaderAtom @@ -259,7 +256,7 @@ public final class HSLFSlide extends HSLFSheet implements Slide<HSLFShape,HSLFTe } /** - * @return set of records inside <code>SlideListWithtext</code> container + * @return set of records inside {@code SlideListWithtext} container * which hold text data for this slide (typically for placeholders). */ protected SlideAtomsSet getSlideAtomsSet() { return _atomSet; } @@ -298,8 +295,8 @@ public final class HSLFSlide extends HSLFSheet implements Slide<HSLFShape,HSLFTe /** * Sets whether this slide follows master background * - * @param flag <code>true</code> if the slide follows master, - * <code>false</code> otherwise + * @param flag {@code true} if the slide follows master, + * {@code false} otherwise */ @Override public void setFollowMasterBackground(boolean flag){ @@ -310,8 +307,8 @@ public final class HSLFSlide extends HSLFSheet implements Slide<HSLFShape,HSLFTe /** * Whether this slide follows master sheet background * - * @return <code>true</code> if the slide follows master background, - * <code>false</code> otherwise + * @return {@code true} if the slide follows master background, + * {@code false} otherwise */ @Override public boolean getFollowMasterBackground(){ @@ -322,8 +319,8 @@ public final class HSLFSlide extends HSLFSheet implements Slide<HSLFShape,HSLFTe /** * Sets whether this slide draws master sheet objects * - * @param flag <code>true</code> if the slide draws master sheet objects, - * <code>false</code> otherwise + * @param flag {@code true} if the slide draws master sheet objects, + * {@code false} otherwise */ @Override public void setFollowMasterObjects(boolean flag){ @@ -334,8 +331,8 @@ public final class HSLFSlide extends HSLFSheet implements Slide<HSLFShape,HSLFTe /** * Whether this slide follows master color scheme * - * @return <code>true</code> if the slide follows master color scheme, - * <code>false</code> otherwise + * @return {@code true} if the slide follows master color scheme, + * {@code false} otherwise */ public boolean getFollowMasterScheme(){ SlideAtom sa = getSlideRecord().getSlideAtom(); @@ -345,8 +342,8 @@ public final class HSLFSlide extends HSLFSheet implements Slide<HSLFShape,HSLFTe /** * Sets whether this slide draws master color scheme * - * @param flag <code>true</code> if the slide draws master color scheme, - * <code>false</code> otherwise + * @param flag {@code true} if the slide draws master color scheme, + * {@code false} otherwise */ public void setFollowMasterScheme(boolean flag){ SlideAtom sa = getSlideRecord().getSlideAtom(); @@ -356,8 +353,8 @@ public final class HSLFSlide extends HSLFSheet implements Slide<HSLFShape,HSLFTe /** * Whether this slide draws master sheet objects * - * @return <code>true</code> if the slide draws master sheet objects, - * <code>false</code> otherwise + * @return {@code true} if the slide draws master sheet objects, + * {@code false} otherwise */ @Override public boolean getFollowMasterObjects(){ @@ -403,6 +400,7 @@ public final class HSLFSlide extends HSLFSheet implements Slide<HSLFShape,HSLFTe * PPT 2003 files. Doesn't work for PPT 97 * ones, as they do their comments oddly. */ + @Override public List<HSLFComment> getComments() { final List<HSLFComment> comments = new ArrayList<>(); // If there are any, they're in @@ -427,6 +425,7 @@ public final class HSLFSlide extends HSLFSheet implements Slide<HSLFShape,HSLFTe * * @return Header / Footer settings for this slide */ + @Override public HeadersFooters getHeadersFooters(){ return new HeadersFooters(this, HeadersFootersContainer.SlideHeadersFootersContainer); } @@ -473,7 +472,7 @@ public final class HSLFSlide extends HSLFSheet implements Slide<HSLFShape,HSLFTe Drawable draw = drawFact.getDrawable(this); draw.draw(graphics); } - + @Override public boolean getFollowMasterColourScheme() { return false; @@ -482,7 +481,7 @@ public final class HSLFSlide extends HSLFSheet implements Slide<HSLFShape,HSLFTe @Override public void setFollowMasterColourScheme(boolean follow) { } - + @Override public boolean getFollowMasterGraphics() { return getFollowMasterObjects(); diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSlideMaster.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSlideMaster.java index 2f258e6eb6..dbd5079118 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSlideMaster.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSlideMaster.java @@ -33,8 +33,6 @@ import org.apache.poi.util.Internal; * SlideMaster determines the graphics, layout, and formatting for all the slides in a given presentation. * It stores information about default font styles, placeholder sizes and positions, * background design, and color schemes. - * - * @author Yegor Kozlov */ public final class HSLFSlideMaster extends HSLFMasterSheet { private final List<List<HSLFTextParagraph>> _paragraphs = new ArrayList<>(); @@ -80,11 +78,11 @@ public final class HSLFSlideMaster extends HSLFMasterSheet { * If {@code name = "*"} return the current collection, otherwise if the name is not found * in the current selection of txtype/level/name, first try lower levels then try parent types, * if it wasn't found there return {@code null}. - * + * * @param txtype the {@link TextHeaderAtom} type * @param level the indent level of the paragraph, if the level is not defined for the found * collection, the highest existing level will be used - * @param name the property name, + * @param name the property name, * @param isCharacter if {@code true} use character styles, otherwise use paragraph styles */ @Override diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSoundData.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSoundData.java index dda143735a..d6403b204e 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSoundData.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSoundData.java @@ -23,8 +23,6 @@ import java.util.ArrayList; /** * A class that represents sound data embedded in a slide show. - * - * @author Yegor Kozlov */ public final class HSLFSoundData { /** diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFTable.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFTable.java index 6218e1e5ed..98eba71017 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFTable.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFTable.java @@ -40,8 +40,6 @@ import org.apache.poi.util.Units; /** * Represents a table in a PowerPoint presentation - * - * @author Yegor Kozlov */ public final class HSLFTable extends HSLFGroupShape implements HSLFShapeContainer, TableShape<HSLFShape,HSLFTextParagraph> { @@ -186,10 +184,10 @@ implements HSLFShapeContainer, TableShape<HSLFShape,HSLFTextParagraph> { if (htc.isEmpty()) { throw new IllegalStateException("HSLFTable without HSLFTableCells"); } - + SortedSet<Double> colSet = new TreeSet<>(); SortedSet<Double> rowSet = new TreeSet<>(); - + // #1 pass - determine cols and rows for (HSLFTableCell sh : htc) { Rectangle2D anchor = sh.getAnchor(); @@ -197,10 +195,10 @@ implements HSLFShapeContainer, TableShape<HSLFShape,HSLFTextParagraph> { rowSet.add(anchor.getY()); } cells = new HSLFTableCell[rowSet.size()][colSet.size()]; - + List<Double> colLst = new ArrayList<>(colSet); List<Double> rowLst = new ArrayList<>(rowSet); - + // #2 pass - assign shape to table cells for (HSLFTableCell sh : htc) { Rectangle2D anchor = sh.getAnchor(); @@ -208,14 +206,14 @@ implements HSLFShapeContainer, TableShape<HSLFShape,HSLFTextParagraph> { int col = colLst.indexOf(anchor.getX()); assert(row != -1 && col != -1); cells[row][col] = sh; - + // determine gridSpan / rowSpan int gridSpan = calcSpan(colLst, anchor.getWidth(), col); int rowSpan = calcSpan(rowLst, anchor.getHeight(), row); - + sh.setGridSpan(gridSpan); sh.setRowSpan(rowSpan); - } + } } private int calcSpan(List<Double> spaces, double totalSpace, int idx) { @@ -227,7 +225,7 @@ implements HSLFShapeContainer, TableShape<HSLFShape,HSLFTextParagraph> { } return span; } - + static class LineRect { final HSLFLine l; final double lx1, lx2, ly1, ly2; @@ -356,10 +354,10 @@ implements HSLFShapeContainer, TableShape<HSLFShape,HSLFTextParagraph> { if (row < 0 || row >= cells.length) { throw new IllegalArgumentException("Row index '"+row+"' is not within range [0-"+(cells.length-1)+"]"); } - + return cells[row][0].getAnchor().getHeight(); } - + @Override public void setRowHeight(int row, final double height) { if (row < 0 || row >= cells.length) { @@ -373,7 +371,7 @@ implements HSLFShapeContainer, TableShape<HSLFShape,HSLFTextParagraph> { double currentHeight = Units.masterToPoints(LittleEndian.getInt(masterBytes, 0)); LittleEndian.putInt(masterBytes, 0, Units.pointsToMaster(height)); p.setElement(row, masterBytes); - + // move the cells double dy = height - currentHeight; for (int i = row; i < cells.length; i++) { @@ -400,7 +398,7 @@ implements HSLFShapeContainer, TableShape<HSLFShape,HSLFTextParagraph> { if (col < 0 || col >= cells[0].length) { throw new IllegalArgumentException("Column index '"+col+"' is not within range [0-"+(cells[0].length-1)+"]"); } - + // TODO: check for merged cols return cells[0][col].getAnchor().getWidth(); } diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFTextBox.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFTextBox.java index 485389dcdd..228cc719e8 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFTextBox.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFTextBox.java @@ -29,9 +29,6 @@ import org.apache.poi.sl.usermodel.VerticalAlignment; * <p> * Contains the text in a text frame as well as the properties and methods * that control alignment and anchoring of the text. - * </p> - * - * @author Yegor Kozlov */ public class HSLFTextBox extends HSLFTextShape implements TextBox<HSLFShape,HSLFTextParagraph> { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hssf/converter/AbstractExcelConverter.java b/poi-scratchpad/src/main/java/org/apache/poi/hssf/converter/AbstractExcelConverter.java index 6f5ab29bb4..6447663d00 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hssf/converter/AbstractExcelConverter.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hssf/converter/AbstractExcelConverter.java @@ -33,7 +33,6 @@ import org.w3c.dom.Document; /** * Common class for {@link ExcelToFoConverter} and {@link ExcelToHtmlConverter} * - * @author Sergey Vladimirov (vlsergey {at} gmail {dot} com) * @see AbstractWordConverter */ @Beta @@ -67,7 +66,7 @@ public abstract class AbstractExcelConverter /** * Generates name for output as column header in case - * <tt>{@link #isOutputColumnHeaders()} == true</tt> + * {@link #isOutputColumnHeaders()}{@code == true} * * @param columnIndex * 0-based column index @@ -86,7 +85,7 @@ public abstract class AbstractExcelConverter /** * Generates name for output as row number in case - * <tt>{@link #isOutputRowNumbers()} == true</tt> + * {@link #isOutputRowNumbers()}{@code == true} */ protected String getRowName( HSSFRow row ) { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hssf/converter/AbstractExcelUtils.java b/poi-scratchpad/src/main/java/org/apache/poi/hssf/converter/AbstractExcelUtils.java index 744ffc9041..a4f9b13e23 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hssf/converter/AbstractExcelUtils.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hssf/converter/AbstractExcelUtils.java @@ -160,7 +160,7 @@ class AbstractExcelUtils { * @param mergedRanges map of sheet merged ranges built with * {@link #buildMergedRangesMap(Sheet)} * @return {@link CellRangeAddress} from map if cell with specified row and - * column numbers contained in found range, <tt>null</tt> otherwise + * column numbers contained in found range, {@code null} otherwise */ public static CellRangeAddress getMergedRange( CellRangeAddress[][] mergedRanges, int rowNumber, int columnNumber) { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hssf/converter/ExcelToFoConverter.java b/poi-scratchpad/src/main/java/org/apache/poi/hssf/converter/ExcelToFoConverter.java index d6938867e1..5724e024b0 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hssf/converter/ExcelToFoConverter.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hssf/converter/ExcelToFoConverter.java @@ -170,11 +170,11 @@ public class ExcelToFoConverter extends AbstractExcelConverter { } /** - * Returns <tt>false</tt> if cell style by itself (without text, i.e. - * borders, fill, etc.) worth a mention, <tt>true</tt> otherwise + * Returns {@code false} if cell style by itself (without text, i.e. + * borders, fill, etc.) worth a mention, {@code true} otherwise * - * @return <tt>false</tt> if cell style by itself (without text, i.e. - * borders, fill, etc.) worth a mention, <tt>true</tt> otherwise + * @return {@code false} if cell style by itself (without text, i.e. + * borders, fill, etc.) worth a mention, {@code true} otherwise */ protected boolean isEmptyStyle(CellStyle cellStyle) { return cellStyle == null || ( @@ -423,7 +423,7 @@ public class ExcelToFoConverter extends AbstractExcelConverter { /** * Creates COLGROUP element with width specified for all columns. (Except - * first if <tt>{@link #isOutputRowNumbers()}==true</tt>) + * first if {@link #isOutputRowNumbers()}{@code ==true}) * * @return table width in inches */ @@ -670,7 +670,7 @@ public class ExcelToFoConverter extends AbstractExcelConverter { /** * Process single sheet (as specified by 0-based sheet index) * - * @return <tt>true</tt> if result were added to FO document, <tt>false</tt> + * @return {@code true} if result were added to FO document, {@code false} * otherwise */ protected boolean processSheet(HSSFWorkbook workbook, int sheetIndex) { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hssf/converter/ExcelToHtmlConverter.java b/poi-scratchpad/src/main/java/org/apache/poi/hssf/converter/ExcelToHtmlConverter.java index aab72a0e69..7c0fd29801 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hssf/converter/ExcelToHtmlConverter.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hssf/converter/ExcelToHtmlConverter.java @@ -69,7 +69,7 @@ public class ExcelToHtmlConverter extends AbstractExcelConverter { private static final Logger LOG = LogManager.getLogger(ExcelToHtmlConverter.class); /** - * Java main() interface to interact with {@link ExcelToHtmlConverter} + * Java main() interface to interact with ExcelToHtmlConverter * * <p> * Usage: ExcelToHtmlConverter infile outfile @@ -266,13 +266,14 @@ public class ExcelToHtmlConverter extends AbstractExcelConverter { return cssClassPrefixTable; } + @Override public Document getDocument() { return htmlDocumentFacade.getDocument(); } protected String getStyleClassName(HSSFWorkbook workbook, HSSFCellStyle cellStyle) { - final Short cellStyleKey = Short.valueOf(cellStyle.getIndex()); + final Short cellStyleKey = cellStyle.getIndex(); String knownClass = excelStyleToClass.get(cellStyleKey); if (knownClass != null) { @@ -446,7 +447,7 @@ public class ExcelToHtmlConverter extends AbstractExcelConverter { /** * Creates COLGROUP element with width specified for all columns. (Except - * first if <tt>{@link #isOutputRowNumbers()}==true</tt>) + * first if {@link #isOutputRowNumbers()}{@code ==true}) */ protected void processColumnWidths(HSSFSheet sheet, int maxSheetColumns, Element table) { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/converter/NumberFormatter.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/converter/NumberFormatter.java index 4a69de63c5..5c47a5ca23 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/converter/NumberFormatter.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/converter/NumberFormatter.java @@ -25,8 +25,6 @@ import org.apache.poi.util.Beta; /** * Utility class to translate numbers in letters, usually for lists. - * - * @author Sergey Vladimirov (vlsergey {at} gmail {dot} com) */ @Beta public final class NumberFormatter { @@ -61,7 +59,7 @@ public final class NumberFormatter { return String.valueOf( num ); } } - + private static String toLetters(int number) { if ( number <= 0 ) { throw new IllegalArgumentException( "Unsupported number: " + number ); diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/converter/PicturesManager.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/converter/PicturesManager.java index e8bb2e2c5a..fc2e52df83 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/converter/PicturesManager.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/converter/PicturesManager.java @@ -21,8 +21,6 @@ import org.apache.poi.util.Beta; /** * User-implemented pictures manager to store images on-disk - * - * @author Sergey Vladimirov (vlsergey {at} gmail {dot} com) */ @Beta public interface PicturesManager @@ -35,7 +33,7 @@ public interface PicturesManager * {@link PictureType#TIFF}, but rarely {@link PictureType#EMF} or * {@link PictureType#WMF}. FO (Apache FOP) supports at least PNG and SVG * types. - * + * * @param content * picture content * @param pictureType @@ -50,7 +48,7 @@ public interface PicturesManager * display height in inches (scaled). May be useful for rendering * vector images (such as EMF or WMF) * @return path to file that can be used as reference in HTML (img's src) of - * XLS FO (fo:external-graphic's src) or <tt>null</tt> if image were + * XLS FO (fo:external-graphic's src) or {@code null} if image were * not saved and should not be referenced from result HTML / FO. */ String savePicture( byte[] content, PictureType pictureType, diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/converter/WordToFoConverter.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/converter/WordToFoConverter.java index d91708424c..3aca26981f 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/converter/WordToFoConverter.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/converter/WordToFoConverter.java @@ -58,9 +58,6 @@ import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.w3c.dom.Text; -/** - * @author Sergey Vladimirov (vlsergey {at} gmail {dot} com) - */ @Beta public class WordToFoConverter extends AbstractWordConverter { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/converter/WordToHtmlConverter.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/converter/WordToHtmlConverter.java index a60d504405..e829a997ec 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/converter/WordToHtmlConverter.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/converter/WordToHtmlConverter.java @@ -67,8 +67,8 @@ import org.w3c.dom.Text; public class WordToHtmlConverter extends AbstractWordConverter { /** - * Holds properties values, applied to current <tt>p</tt> element. Those - * properties shall not be doubled in children <tt>span</tt> elements. + * Holds properties values, applied to current {@code p} element. Those + * properties shall not be doubled in children {@code span} elements. */ private static class BlockProperies { @@ -91,7 +91,7 @@ public class WordToHtmlConverter extends AbstractWordConverter private Element notes; /** - * Creates new instance of {@link WordToHtmlConverter}. Can be used for + * Creates new instance of WordToHtmlConverter. Can be used for * output several {@link HWPFDocument}s into single HTML document. * * @param document XML DOM Document used as HTML document @@ -132,7 +132,7 @@ public class WordToHtmlConverter extends AbstractWordConverter } /** - * Java main() interface to interact with {@link WordToHtmlConverter}<p> + * Java main() interface to interact with WordToHtmlConverter<p> * * Usage: WordToHtmlConverter infile outfile<p> * diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/dev/FieldIterator.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/dev/FieldIterator.java index 1c15980b90..39bd5f31fe 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/dev/FieldIterator.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/dev/FieldIterator.java @@ -20,11 +20,7 @@ package org.apache.poi.hwpf.dev; import org.apache.poi.util.Internal; /** - * <p> * For iterating through our fields. Used during model classes autogeneration. - * </p> - * - * @author Glen Stampoultzis (glens at apache.org) */ @Internal public class FieldIterator diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/dev/HWPFLister.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/dev/HWPFLister.java index 6d487487bc..8fb9055bc5 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/dev/HWPFLister.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/dev/HWPFLister.java @@ -69,9 +69,6 @@ import org.apache.poi.util.LittleEndian; /** * Used by developers to list out key information on a HWPF file. End users will * probably never need to use this program. - * - * @author Nick Burch (nick at torchbox dot com) - * @author Sergey Vladimirov (vlsergey at gmail dot com) */ @Beta public final class HWPFLister { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/dev/RecordUtil.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/dev/RecordUtil.java index 6ecb5c33df..cd11e5d879 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/dev/RecordUtil.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/dev/RecordUtil.java @@ -23,9 +23,6 @@ import org.apache.poi.util.StringUtil; /** * Helper functions for the record transformations. Used during model classes * autogeneration. - * - * @author Glen Stampoultzis (glens at apache.org) - * @author Andrew C. Oliver (acoliver at apache dot org) */ @Internal public class RecordUtil diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/extractor/Word6Extractor.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/extractor/Word6Extractor.java index 526d21be35..2cd17399e3 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/extractor/Word6Extractor.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/extractor/Word6Extractor.java @@ -33,8 +33,6 @@ import org.apache.poi.poifs.filesystem.POIFSFileSystem; * This should only be used on the older files, for most uses you * should call {@link WordExtractor} which deals properly * with HWPF. - * - * @author Nick Burch */ public final class Word6Extractor implements POIOLE2TextExtractor { private HWPFOldDocument doc; diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/extractor/WordExtractor.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/extractor/WordExtractor.java index 4e4d190536..82f806caaa 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/extractor/WordExtractor.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/extractor/WordExtractor.java @@ -35,8 +35,6 @@ import org.apache.poi.poifs.filesystem.POIFSFileSystem; * * You should use either getParagraphText() or getText() unless you have a * strong reason otherwise. - * - * @author Nick Burch */ public final class WordExtractor implements POIOLE2TextExtractor { private final HWPFDocument doc; diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/CHPBinTable.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/CHPBinTable.java index 178186bd35..24cfb6d183 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/CHPBinTable.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/CHPBinTable.java @@ -46,8 +46,6 @@ import static org.apache.logging.log4j.util.Unbox.box; /** * This class holds all of the character formatting properties. - * - * @author Ryan Ackley */ @Internal public class CHPBinTable diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/CHPFormattedDiskPage.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/CHPFormattedDiskPage.java index 349f39b634..91dfcf6c1f 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/CHPFormattedDiskPage.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/CHPFormattedDiskPage.java @@ -40,8 +40,6 @@ import org.apache.poi.util.RecordFormatException; * CHP and PAP fkps also store the compressed styles(grpprl) that correspond to * the offsets on the front of the fkp. The offset of the grpprls is determined * differently for CHP fkps and PAP fkps. - * - * @author Ryan Ackley */ @Internal public final class CHPFormattedDiskPage extends FormattedDiskPage diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/DocumentProperties.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/DocumentProperties.java index f292643fb1..b2bfbe8fc3 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/DocumentProperties.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/DocumentProperties.java @@ -24,11 +24,6 @@ import org.apache.poi.hwpf.model.types.DOPAbstractType; import org.apache.poi.util.IOUtils; import org.apache.poi.util.Internal; -/** - * Comment me - * - * @author Ryan Ackley - */ @Internal public final class DocumentProperties extends DOPAbstractType { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/FFData.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/FFData.java index a33e5af350..50f51ed663 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/FFData.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/FFData.java @@ -28,17 +28,6 @@ import org.apache.poi.util.LittleEndianConsts; /** * The FFData structure specifies form field data for a text box, check box, or * drop-down list box. - * <p> - * Class and fields descriptions are quoted from [MS-DOC] -- v20121003 Word - * (.doc) Binary File Format; Copyright (c) 2012 Microsoft Corporation; Release: - * October 8, 2012 - * <p> - * This class is internal. It content or properties may change without notice - * due to changes in our knowledge of internal Microsoft Word binary structures. - * - * @author Sergey Vladimirov; according to [MS-DOC] -- v20121003 Word (.doc) - * Binary File Format; Copyright (c) 2012 Microsoft Corporation; - * Release: October 8, 2012 */ @Internal public class FFData diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/FFDataBase.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/FFDataBase.java index b12fe40691..444ab29b50 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/FFDataBase.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/FFDataBase.java @@ -29,10 +29,6 @@ import org.apache.poi.util.Internal; * <p> * This class is internal. It content or properties may change without notice * due to changes in our knowledge of internal Microsoft Word binary structures. - * - * @author Sergey Vladimirov; according to [MS-DOC] -- v20121003 Word (.doc) - * Binary File Format; Copyright (c) 2012 Microsoft Corporation; - * Release: October 8, 2012 */ @Internal public class FFDataBase extends FFDataBaseAbstractType diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/FSPA.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/FSPA.java index 3688914061..b035da4acb 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/FSPA.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/FSPA.java @@ -22,8 +22,6 @@ import org.apache.poi.util.Internal; /** * File Shape Address structure - * - * @author Squeeself */ @Internal public final class FSPA extends FSPAAbstractType diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/Ffn.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/Ffn.java index 532318d739..32d9631277 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/Ffn.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/Ffn.java @@ -30,8 +30,6 @@ import org.apache.poi.util.LittleEndianConsts; * FFN - Font Family Name. FFN is a data structure that stores the names of the Main * Font and that of Alternate font as an array of characters. It has also a header * that stores info about the whole structure and the fonts - * - * @author Praveen Mathew */ @Internal public final class Ffn diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/FibBase.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/FibBase.java index 8f505b9588..a9e0a6e3ba 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/FibBase.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/FibBase.java @@ -27,10 +27,6 @@ import org.apache.poi.util.Internal; * <p> * Class and fields descriptions are quoted from Microsoft Office Word 97-2007 * Binary File Format and [MS-DOC] - v20110608 Word (.doc) Binary File Format. - * - * @author Andrew C. Oliver; Sergey Vladimirov; according to Microsoft Office - * Word 97-2007 Binary File Format Specification [*.doc] and [MS-DOC] - - * v20110608 Word (.doc) Binary File Format */ @Internal public class FibBase extends FibBaseAbstractType { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/FibRgLw95.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/FibRgLw95.java index f2834eff39..218b3121da 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/FibRgLw95.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/FibRgLw95.java @@ -22,16 +22,9 @@ import org.apache.poi.util.Internal; /** * The FibRgLw97 structure is the third section of the FIB. This contains an * array of 4-byte values. - * <p> - * Class and fields descriptions are quoted from Microsoft Office Word 97-2007 - * Binary File Format and [MS-DOC] - v20110608 Word (.doc) Binary File Format - * - * @author Sergey Vladimirov; according to Microsoft Office Word 97-2007 Binary - * File Format Specification [*.doc] and [MS-DOC] - v20110608 Word - * (.doc) Binary File Format */ @Internal -class FibRgLw95 extends FibRgLw95AbstractType implements FibRgLw +class FibRgLw95 extends FibRgLw95AbstractType implements FibRgLw { public FibRgLw95() diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/FibRgLw97.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/FibRgLw97.java index 933afd0ca0..1713e829e3 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/FibRgLw97.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/FibRgLw97.java @@ -25,10 +25,6 @@ import org.apache.poi.util.Internal; * <p> * Class and fields descriptions are quoted from Microsoft Office Word 97-2007 * Binary File Format and [MS-DOC] - v20110608 Word (.doc) Binary File Format - * - * @author Sergey Vladimirov; according to Microsoft Office Word 97-2007 Binary - * File Format Specification [*.doc] and [MS-DOC] - v20110608 Word - * (.doc) Binary File Format */ @Internal public class FibRgLw97 extends FibRgLw97AbstractType implements FibRgLw diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/FibRgW97.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/FibRgW97.java index c3b0f6bd9c..5fa906f952 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/FibRgW97.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/FibRgW97.java @@ -23,13 +23,6 @@ import org.apache.poi.util.Internal; /** * The FibRgW97 structure is a variable-length portion of the Fib. - * <p> - * Class and fields descriptions are quoted from Microsoft Office Word 97-2007 - * Binary File Format and [MS-DOC] - v20110608 Word (.doc) Binary File Format. - * - * @author Sergey Vladimirov; according to Microsoft Office Word 97-2007 Binary - * File Format Specification [*.doc] and [MS-DOC] - v20110608 Word - * (.doc) Binary File Format */ @Internal public class FibRgW97 extends FibRgW97AbstractType diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/FieldDescriptor.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/FieldDescriptor.java index 58e55a46cd..b81dd8c999 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/FieldDescriptor.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/FieldDescriptor.java @@ -22,8 +22,6 @@ import org.apache.poi.util.Internal; /** * Class for the FLD structure. - * - * @author Cedric Bosdonnat <cbosdonnat@novell.com> */ @Internal public final class FieldDescriptor extends FLDAbstractType diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/FieldsTables.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/FieldsTables.java index 595078e47f..d672c294af 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/FieldsTables.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/FieldsTables.java @@ -29,9 +29,6 @@ import org.apache.poi.util.Internal; /** * This class provides access to all the fields Plex. - * - * @author Cedric Bosdonnat <cbosdonnat@novell.com> - * */ @Internal public class FieldsTables diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/FontTable.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/FontTable.java index 8fba06f82b..1a67d1c87d 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/FontTable.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/FontTable.java @@ -32,8 +32,6 @@ import org.apache.poi.util.LittleEndianConsts; * Word files. The sttbfffn is an sttbf where each string is an FFN structure instead * of pascal-style strings. An sttbf is a string Table stored in file. Thus sttbffn * is like an Sttbf with an array of FFN structures that stores the font name strings - * - * @author Praveen Mathew */ @Internal public final class FontTable diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/FormattedDiskPage.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/FormattedDiskPage.java index 4c82d2db25..a5e4760f3a 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/FormattedDiskPage.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/FormattedDiskPage.java @@ -37,8 +37,6 @@ import org.apache.poi.util.LittleEndian; * CHP and PAP fkps also store the compressed styles(grpprl) that correspond to * the offsets on the front of the fkp. The offset of the grpprls is determined * differently for CHP fkps and PAP fkps. - * - * @author Ryan Ackley */ @Internal public abstract class FormattedDiskPage { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/Grfhic.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/Grfhic.java index f627289a48..a08d503735 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/Grfhic.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/Grfhic.java @@ -24,15 +24,6 @@ import org.apache.poi.util.Internal; * HTML incompatibilities of a list structure. The values specify possible * incompatibilities between an LVL or LVLF and HTML lists. The values do not * define list properties. - * <p> - * Class and fields descriptions are quoted from [MS-DOC] -- v20110315 Word - * (.doc) Binary File Format specification - * <p> - * This class is internal. It content or properties may change without notice - * due to changes in our knowledge of internal Microsoft Word binary structures. - * - * @author Sergey Vladimirov; according to [MS-DOC] -- v20110315 Word (.doc) - * Binary File Format specification */ @Internal public class Grfhic extends GrfhicAbstractType diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/LFO.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/LFO.java index edc069964a..5325ccc845 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/LFO.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/LFO.java @@ -23,10 +23,7 @@ import org.apache.poi.hwpf.model.types.LFOAbstractType; /** * "The LFO structure specifies the LSTF element that corresponds to a list that * contains a paragraph. An LFO can also specify formatting information that - * overrides the LSTF element to which it corresponds." -- [MS-DOC] -- v20110315 - * Word (.doc) Binary File Format - * - * @author Sergey Vladimirov (vlsergey {at} gmail {dot} com) + * overrides the LSTF element to which it corresponds." */ @Internal public class LFO extends LFOAbstractType diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/LFOData.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/LFOData.java index 2f22afdd51..0e8cca03a4 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/LFOData.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/LFOData.java @@ -29,8 +29,6 @@ import org.apache.poi.util.LittleEndianConsts; /** * The LFOData structure contains the Main Document CP of the corresponding LFO, * as well as an array of LVL override data. - * - * @author Sergey Vladimirov (vlsergey {at} gmail {dot} com) */ @Internal public class LFOData diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/LFOLVLBase.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/LFOLVLBase.java index 3a50a7c2f3..d117cac8d6 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/LFOLVLBase.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/LFOLVLBase.java @@ -24,10 +24,6 @@ import org.apache.poi.hwpf.model.types.LFOLVLBaseAbstractType; * <p> * Class and fields descriptions are quoted from Microsoft Office Word 97-2007 * Binary File Format and [MS-DOC] - v20110608 Word (.doc) Binary File Format - * - * @author Sergey Vladimirov; according to Microsoft Office Word 97-2007 Binary - * File Format Specification [*.doc] and [MS-DOC] - v20110608 Word - * (.doc) Binary File Format */ class LFOLVLBase extends LFOLVLBaseAbstractType { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/LSTF.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/LSTF.java index 9e00ffed40..f801904b2e 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/LSTF.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/LSTF.java @@ -19,15 +19,7 @@ package org.apache.poi.hwpf.model; import org.apache.poi.hwpf.model.types.LSTFAbstractType; /** - * The LSTF structure contains formatting properties that apply to an entire - * list. - * <p> - * Class and fields descriptions are quoted from Microsoft Office Word 97-2007 - * Binary File Format and [MS-DOC] - v20110608 Word (.doc) Binary File Format - * - * @author Sergey Vladimirov; according to Microsoft Office Word 97-2007 Binary - * File Format Specification [*.doc] and [MS-DOC] - v20110608 Word - * (.doc) Binary File Format + * The LSTF structure contains formatting properties that apply to an entire list. */ class LSTF extends LSTFAbstractType { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/LVLF.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/LVLF.java index 38192d263d..9c0678a6db 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/LVLF.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/LVLF.java @@ -22,10 +22,6 @@ import org.apache.poi.util.Internal; /** * The LVLF structure contains formatting properties for an individual level in * a list - * - * @author Sergey Vladimirov; according to Microsoft Office Word 97-2007 Binary - * File Format Specification [*.doc] and [MS-DOC] - v20110608 Word - * (.doc) Binary File Format */ @Internal class LVLF extends LVLFAbstractType diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/NoteType.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/NoteType.java index 8168e96ae3..256332a300 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/NoteType.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/NoteType.java @@ -15,15 +15,13 @@ limitations under the License. ==================================================================== */ -/** - * Word document notes types (and their FIB field indices) - * - * @author Sergey Vladimirov (vlsergey {at} gmail {doc} com) - */ package org.apache.poi.hwpf.model; import org.apache.poi.util.Internal; +/** + * Word document notes types (and their FIB field indices) + */ @Internal public enum NoteType { /** Ending note */ diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/NotesTables.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/NotesTables.java index 92fa5287f0..c6ae28a415 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/NotesTables.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/NotesTables.java @@ -24,8 +24,6 @@ import org.apache.poi.util.Internal; /** * Holds information about document notes (footnotes or ending notes) - * - * @author Sergey Vladimirov (vlsergey {at} gmail {doc} com) */ @Internal public class NotesTables diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/OfficeArtContent.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/OfficeArtContent.java index 35436bf75a..df53ee6bc4 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/OfficeArtContent.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/OfficeArtContent.java @@ -34,8 +34,6 @@ import static org.apache.logging.log4j.util.Unbox.box; * Information about drawings in the document. * <p> * The {@code delay stream} referenced in {@code [MS-ODRAW]} is the {@code WordDocument} stream. - * - * @author Squeeself */ @Internal public final class OfficeArtContent { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/PAPFormattedDiskPage.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/PAPFormattedDiskPage.java index e9c56cc558..785f692405 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/PAPFormattedDiskPage.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/PAPFormattedDiskPage.java @@ -41,8 +41,6 @@ import org.apache.poi.util.LittleEndian; * CHP and PAP fkps also store the compressed styles(grpprl) that correspond to * the offsets on the front of the fkp. The offset of the grpprls is determined * differently for CHP fkps and PAP fkps. - * - * @author Ryan Ackley */ @Internal public final class PAPFormattedDiskPage extends FormattedDiskPage { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/PICF.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/PICF.java index 44ab74078b..4610fd5716 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/PICF.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/PICF.java @@ -24,11 +24,6 @@ import org.apache.poi.util.Internal; /** * The PICF structure specifies the type of a picture, as well as the size of * the picture and information about its border. - * <p> - * Class and fields descriptions are quoted from Microsoft Office Word 97-2007 - * Binary File Format and [MS-DOC] - v20110608 Word (.doc) Binary File Format - * - * @author Sergey Vladimirov (vlsergey {at} gmail {dot} com) */ @Internal public class PICF extends PICFAbstractType diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/PicturesTable.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/PicturesTable.java index d3ef0b51a9..f1325081e3 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/PicturesTable.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/PicturesTable.java @@ -52,8 +52,6 @@ import org.apache.poi.util.LittleEndian; * CharacterRun.isSpecial() returns true. The file location of the picture in the Word binary file is accessed * via CharacterRun.getPicOffset(). The CharacterRun.getPicOffset() is a byte offset into the data stream. * Beginning at the position recorded in picOffset, a header data structure, will be stored. - * - * @author Dmitry Romanov */ @Internal public final class PicturesTable { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/PlexOfField.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/PlexOfField.java index 15793b7a4e..737659ea34 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/PlexOfField.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/PlexOfField.java @@ -25,8 +25,6 @@ import org.apache.poi.util.Internal; /** * Structure describing the Plex for fields (contained plclfd* in the spec). - * - * @author Cedric Bosdonnat <cbosdonnat@novell.com> */ @Internal public class PlexOfField diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/PlfLfo.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/PlfLfo.java index b2adc51ef1..79b8587bae 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/PlfLfo.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/PlfLfo.java @@ -36,8 +36,6 @@ import static org.apache.logging.log4j.util.Unbox.box; * <p> * Documentation quoted from Page 424 of 621. [MS-DOC] -- v20110315 Word (.doc) * Binary File Format - * - * @author Sergey Vladimirov (vlsergey {at} gmail {dot} com) */ public class PlfLfo { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/RevisionMarkAuthorTable.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/RevisionMarkAuthorTable.java index 2c4bd5521c..3cad305e05 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/RevisionMarkAuthorTable.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/RevisionMarkAuthorTable.java @@ -28,8 +28,6 @@ import org.apache.poi.util.Internal; /** * String table containing the names of authors of revision marks, e-mails and * comments in this document. - * - * @author Ryan Lauck */ @Internal public final class RevisionMarkAuthorTable { @@ -40,7 +38,7 @@ public final class RevisionMarkAuthorTable { /** * Constructor to read the table from the table stream. - * + * * @param tableStream the table stream. * @param offset the offset into the byte array. * @param size the size of the table in the byte array. @@ -53,16 +51,16 @@ public final class RevisionMarkAuthorTable { /** * Gets the entries. The returned list cannot be modified. - * + * * @return the list of entries. */ public List<String> getEntries() { return Collections.unmodifiableList(Arrays.asList(entries)); } - + /** * Get an author by its index. Returns null if it does not exist. - * + * * @return the revision mark author */ public String getAuthor(int index) { @@ -72,10 +70,10 @@ public final class RevisionMarkAuthorTable { } return auth; } - + /** * Gets the number of entries. - * + * * @return the number of entries. */ public int getSize() { @@ -84,7 +82,7 @@ public final class RevisionMarkAuthorTable { /** * Writes this table to the table stream. - * + * * @param tableStream the table stream to write to. * @throws IOException if an error occurs while writing. */ diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/SavedByEntry.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/SavedByEntry.java index b6a5796a3d..53cc03b96d 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/SavedByEntry.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/SavedByEntry.java @@ -24,8 +24,6 @@ import org.apache.poi.util.Internal; /** * A single entry in the {@link SavedByTable}. - * - * @author Daniel Noll */ @Internal public final class SavedByEntry diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/SavedByTable.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/SavedByTable.java index e8eff88eb1..42d5f76c7f 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/SavedByTable.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/SavedByTable.java @@ -27,8 +27,6 @@ import org.apache.poi.util.Internal; /** * String table containing the history of the last few revisions ("saves") of * the document. Read-only for the time being. - * - * @author Daniel Noll */ @Internal public final class SavedByTable @@ -40,7 +38,7 @@ public final class SavedByTable /** * Constructor to read the table from the table stream. - * + * * @param tableStream * the table stream. * @param offset @@ -61,7 +59,7 @@ public final class SavedByTable /** * Gets the entries. The returned list cannot be modified. - * + * * @return the list of entries. */ public List<SavedByEntry> getEntries() @@ -71,7 +69,7 @@ public final class SavedByTable /** * Writes this table to the table stream. - * + * * @param tableStream * the table stream to write to. * @throws IOException diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/Sttb.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/Sttb.java index 85343ee242..20507e7cd1 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/Sttb.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/Sttb.java @@ -19,6 +19,7 @@ package org.apache.poi.hwpf.model; import java.util.Arrays; import org.apache.logging.log4j.LogManager; +import org.apache.poi.util.Internal; import org.apache.poi.util.LittleEndian; import org.apache.poi.util.LittleEndianConsts; import org.apache.poi.util.StringUtil; @@ -27,18 +28,8 @@ import org.apache.poi.util.StringUtil; * The STTB is a string table that is made up of a header that is followed by an * array of elements. The cData value specifies the number of elements that are * contained in the array. - * <p> - * Class and fields descriptions are quoted from [MS-DOC] -- v20121003 Word - * (.doc) Binary File Format; Copyright (c) 2012 Microsoft Corporation; Release: - * October 8, 2012 - * <p> - * This class is internal. It content or properties may change without notice - * due to changes in our knowledge of internal Microsoft Word binary structures. - * - * @author Sergey Vladimirov; according to [MS-DOC] -- v20121003 Word (.doc) - * Binary File Format; Copyright (c) 2012 Microsoft Corporation; - * Release: October 8, 2012 */ +@Internal public class Sttb { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/SttbUtils.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/SttbUtils.java index 850d40d509..09247b49fb 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/SttbUtils.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/SttbUtils.java @@ -23,8 +23,6 @@ import org.apache.poi.util.Internal; /** * Utils class for storing and reading "STring TaBle stored in File" - * - * @author Sergey Vladimirov (vlsergey {at} gmail {dot} com) */ @Internal class SttbUtils diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/StyleDescription.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/StyleDescription.java index 05b2c04677..01f927a165 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/StyleDescription.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/StyleDescription.java @@ -33,11 +33,6 @@ import org.apache.poi.util.StringUtil; import static org.apache.logging.log4j.util.Unbox.box; -/** - * Comment me - * - * @author Ryan Ackley - */ @Internal public final class StyleDescription { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/StyleSheet.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/StyleSheet.java index ac37396657..18d703c835 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/StyleSheet.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/StyleSheet.java @@ -36,8 +36,6 @@ import org.apache.poi.util.LittleEndianConsts; * <p> * Fields documentation is quotes from Microsoft Office Word 97-2007 Binary File * Format (.doc) Specification, page 36 of 210 - * - * @author Ryan Ackley */ @Internal public final class StyleSheet { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/SubdocumentType.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/SubdocumentType.java index 89d16d2e02..299f8bd8d2 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/SubdocumentType.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/SubdocumentType.java @@ -20,8 +20,6 @@ import org.apache.poi.util.Internal; /** * Document text parts that can have text pieces (CPs) - * - * @author Sergey Vladimirov (vlsergey {at} gmail {dot} com) */ @Internal public enum SubdocumentType { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/TextPieceTable.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/TextPieceTable.java index cd885b9556..22434de9a2 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/TextPieceTable.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/TextPieceTable.java @@ -38,8 +38,6 @@ import static org.apache.logging.log4j.util.Unbox.box; * The piece table for matching up character positions to bits of text. This * mostly works in bytes, but the TextPieces themselves work in characters. This * does the icky convertion. - * - * @author Ryan Ackley */ @Internal public class TextPieceTable implements CharIndexTranslator { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/Xst.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/Xst.java index 769786afb8..e68d1bcccf 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/Xst.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/Xst.java @@ -24,13 +24,7 @@ import org.apache.poi.util.LittleEndian; import org.apache.poi.util.LittleEndianConsts; /** - * The Xst structure is a string. The string is prepended by its length and is - * not null-terminated. - * <p> - * Documentation quoted from Page 424 of 621. [MS-DOC] -- v20110315 Word (.doc) - * Binary File Format - * - * @author Sergey Vladimirov (vlsergey {at} gmail {dot} com) + * The Xst structure is a string. The string is prepended by its length and is not null-terminated. */ public class Xst { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/DOPAbstractType.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/DOPAbstractType.java index 6ba7a30183..2a92d94fa7 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/DOPAbstractType.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/DOPAbstractType.java @@ -26,10 +26,6 @@ import org.apache.poi.util.LittleEndian; /** * Document Properties. - * NOTE: This source is automatically generated please do not modify this file. Either subclass or - * remove the record in src/records/definitions. - * - * @author S. Ryan Ackley */ @Internal public abstract class DOPAbstractType { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/FFDataBaseAbstractType.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/FFDataBaseAbstractType.java index 33557615f6..2e8efdd50c 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/FFDataBaseAbstractType.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/FFDataBaseAbstractType.java @@ -25,23 +25,7 @@ import org.apache.poi.util.Internal; import org.apache.poi.util.LittleEndian; /** - * The FFData structure specifies form field data for a text - box, check box, or drop-down list box. <p>Class and fields - descriptions are quoted from [MS-DOC] -- v20121003 Word (.doc) Binary - File Format; Copyright (c) 2012 Microsoft Corporation; Release: - October 8, 2012 - - * <p> - * NOTE: This source is automatically generated please do not modify this file. Either subclass or - * remove the record in src/types/definitions. - * <p> - * This class is internal. It content or properties may change without notice - * due to changes in our knowledge of internal Microsoft Word binary structures. - - * @author Sergey Vladimirov; according to [MS-DOC] -- v20121003 Word - (.doc) Binary File Format; Copyright (c) 2012 Microsoft Corporation; - Release: October 8, 2012 - + * The FFData structure specifies form field data for a text box, check box, or drop-down list box. */ @Internal public abstract class FFDataBaseAbstractType diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/FLDAbstractType.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/FLDAbstractType.java index 3da59198d9..7be124641a 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/FLDAbstractType.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/FLDAbstractType.java @@ -22,15 +22,6 @@ import org.apache.poi.util.Internal; /** * Field Descriptor (FLD). - * <p> - * Class and fields descriptions are quoted from Microsoft Office Word 97-2007 - * Binary File Format - * - * NOTE: This source is automatically generated please do not modify this file. - * Either subclass or remove the record in src/records/definitions. - * - * @author Sergey Vladimirov; according to Microsoft Office Word 97-2007 Binary - * File Format Specification [*.doc] */ @Internal public abstract class FLDAbstractType @@ -137,7 +128,7 @@ public abstract class FLDAbstractType /** * Type of field boundary the FLD describes: 19 -- field begin mark, 20 -- * field separation mark; 21 -- field end mark - * + * * @return the ch field value. */ public byte getCh() @@ -157,7 +148,7 @@ public abstract class FLDAbstractType /** * Reserved - * + * * @return the reserved field value. */ public byte getReserved() @@ -177,7 +168,7 @@ public abstract class FLDAbstractType /** * Ignored for saved file - * + * * @return the fDiffer field value. */ public boolean isFDiffer() @@ -198,7 +189,7 @@ public abstract class FLDAbstractType /** * ==1 when result still believes this field is an EMBED or LINK field - * + * * @return the fZombieEmbed field value. */ public boolean isFZombieEmbed() @@ -219,7 +210,7 @@ public abstract class FLDAbstractType /** * ==1 when user has edited or formatted the result. == 0 otherwise - * + * * @return the fResultDirty field value. */ public boolean isFResultDirty() @@ -240,7 +231,7 @@ public abstract class FLDAbstractType /** * ==1 when user has inserted text into or deleted text from the result - * + * * @return the fResultEdited field value. */ public boolean isFResultEdited() @@ -260,7 +251,7 @@ public abstract class FLDAbstractType /** * ==1 when field is locked from recalculation - * + * * @return the fLocked field value. */ public boolean isFLocked() @@ -281,7 +272,7 @@ public abstract class FLDAbstractType /** * ==1 whenever the result of the field is never to be shown - * + * * @return the fPrivateResult field value. */ public boolean isFPrivateResult() @@ -302,7 +293,7 @@ public abstract class FLDAbstractType /** * ==1 when field is nested within another field - * + * * @return the fNested field value. */ public boolean isFNested() @@ -322,7 +313,7 @@ public abstract class FLDAbstractType /** * ==1 when field has a field separator - * + * * @return the fHasSep field value. */ public boolean isFHasSep() diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/FSPAAbstractType.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/FSPAAbstractType.java index 8d7df40e36..197c16cd19 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/FSPAAbstractType.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/FSPAAbstractType.java @@ -23,19 +23,6 @@ import org.apache.poi.util.LittleEndian; /** * File Shape Address (FSPA). - * <p> - * Class and fields descriptions are quoted from Microsoft Office Word 97-2007 - * Binary File Format - * - * <p> - * NOTE: This source is automatically generated please do not modify this file. - * Either subclass or remove the record in src/types/definitions. - * <p> - * This class is internal. It content or properties may change without notice - * due to changes in our knowledge of internal Microsoft Word binary structures. - * - * @author Sergey Vladimirov; according to Microsoft Office Word 97-2007 Binary - * File Format Specification [*.doc] */ @Internal public abstract class FSPAAbstractType @@ -370,7 +357,7 @@ public abstract class FSPAAbstractType /** * Sets the fBelowText field value. - * + * */ @Internal public void setFBelowText( boolean value ) @@ -379,7 +366,7 @@ public abstract class FSPAAbstractType } /** - * + * * @return the fBelowText field value. */ @Internal @@ -390,7 +377,7 @@ public abstract class FSPAAbstractType /** * Sets the fAnchorLock field value. - * + * */ @Internal public void setFAnchorLock( boolean value ) @@ -399,7 +386,7 @@ public abstract class FSPAAbstractType } /** - * + * * @return the fAnchorLock field value. */ @Internal diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/FibBaseAbstractType.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/FibBaseAbstractType.java index de588af3d9..65cf36d882 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/FibBaseAbstractType.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/FibBaseAbstractType.java @@ -23,20 +23,7 @@ import org.apache.poi.util.LittleEndian; /** * Base part of the File information Block (FibBase). Holds the core part of the FIB, - from the first 32 bytes. <p>Class and fields descriptions are quoted from Microsoft - Office Word 97-2007 Binary File Format and [MS-DOC] - v20110608 Word (.doc) Binary File - Format - - * <p> - * NOTE: This source is automatically generated please do not modify this file. Either subclass or - * remove the record in src/types/definitions. - * <p> - * This class is internal. It content or properties may change without notice - * due to changes in our knowledge of internal Microsoft Word binary structures. - - * @author Andrew C. Oliver; Sergey Vladimirov; according to Microsoft Office Word 97-2007 Binary - File Format Specification [*.doc] and [MS-DOC] - v20110608 Word (.doc) Binary File Format - + * from the first 32 bytes. */ @Internal public abstract class FibBaseAbstractType diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/FibRgLw95AbstractType.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/FibRgLw95AbstractType.java index 45b97641d5..2d5be567f9 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/FibRgLw95AbstractType.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/FibRgLw95AbstractType.java @@ -25,16 +25,6 @@ import org.apache.poi.util.LittleEndian; /** * The FibRgLw95 structure is the third section of the FIB for Word95. - - * <p> - * NOTE: This source is automatically generated please do not modify this file. Either subclass or - * remove the record in src/types/definitions. - * <p> - * This class is internal. It content or properties may change without notice - * due to changes in our knowledge of internal Microsoft Word binary structures. - - * @author Sergey Vladimirov - */ @Internal public abstract class FibRgLw95AbstractType diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/FibRgLw97AbstractType.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/FibRgLw97AbstractType.java index 48bfcebfd6..024569129b 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/FibRgLw97AbstractType.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/FibRgLw97AbstractType.java @@ -23,19 +23,7 @@ import org.apache.poi.util.LittleEndian; /** * The FibRgLw97 structure is the third section of the FIB. This contains an array of - 4-byte values. <p>Class and fields descriptions are quoted from Microsoft Office Word - 97-2007 Binary File Format and [MS-DOC] - v20110608 Word (.doc) Binary File Format - - * <p> - * NOTE: This source is automatically generated please do not modify this file. Either subclass or - * remove the record in src/types/definitions. - * <p> - * This class is internal. It content or properties may change without notice - * due to changes in our knowledge of internal Microsoft Word binary structures. - - * @author Sergey Vladimirov; according to Microsoft Office Word 97-2007 Binary File Format - Specification [*.doc] and [MS-DOC] - v20110608 Word (.doc) Binary File Format - + * 4-byte values. */ @Internal public abstract class FibRgLw97AbstractType diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/FibRgW97AbstractType.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/FibRgW97AbstractType.java index 21d2e4ae13..d7aa92551e 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/FibRgW97AbstractType.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/FibRgW97AbstractType.java @@ -21,20 +21,7 @@ import org.apache.poi.util.Internal; import org.apache.poi.util.LittleEndian; /** - * The FibRgW97 structure is a variable-length portion of the Fib. <p>Class and - fields descriptions are quoted from Microsoft Office Word 97-2007 Binary File Format and - [MS-DOC] - v20110608 Word (.doc) Binary File Format - - * <p> - * NOTE: This source is automatically generated please do not modify this file. Either subclass or - * remove the record in src/types/definitions. - * <p> - * This class is internal. It content or properties may change without notice - * due to changes in our knowledge of internal Microsoft Word binary structures. - - * @author Sergey Vladimirov; according to Microsoft Office Word 97-2007 Binary File Format - Specification [*.doc] and [MS-DOC] - v20110608 Word (.doc) Binary File Format - + * The FibRgW97 structure is a variable-length portion of the Fib. */ @Internal public abstract class FibRgW97AbstractType diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/GrfhicAbstractType.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/GrfhicAbstractType.java index ac54a45f20..e968f971fc 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/GrfhicAbstractType.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/GrfhicAbstractType.java @@ -25,21 +25,8 @@ import org.apache.poi.util.Internal; /** * The grfhic structure is a set of HTML incompatibility flags that specify the HTML - incompatibilities of a list structure. The values specify possible incompatibilities between - an LVL or LVLF and HTML lists. The values do not define list properties. <p>Class and - fields descriptions are quoted from [MS-DOC] -- v20110315 Word (.doc) Binary File Format - specification - - * <p> - * NOTE: This source is automatically generated please do not modify this file. Either subclass or - * remove the record in src/types/definitions. - * <p> - * This class is internal. It content or properties may change without notice - * due to changes in our knowledge of internal Microsoft Word binary structures. - - * @author Sergey Vladimirov; according to [MS-DOC] -- v20110315 Word (.doc) Binary File Format - specification - + * incompatibilities of a list structure. The values specify possible incompatibilities between + * an LVL or LVLF and HTML lists. The values do not define list properties. */ @Internal public abstract class GrfhicAbstractType diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/LFOAbstractType.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/LFOAbstractType.java index 7f37e95a27..fe5b723330 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/LFOAbstractType.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/LFOAbstractType.java @@ -23,19 +23,7 @@ import org.apache.poi.util.Internal; import org.apache.poi.util.LittleEndian; /** - * List Format Override (LFO). <p>Class and fields descriptions are quoted from - [MS-DOC] --v20110315; Word (.doc) Binary File Format - - * <p> - * NOTE: This source is automatically generated please do not modify this file. Either subclass or - * remove the record in src/types/definitions. - * <p> - * This class is internal. It content or properties may change without notice - * due to changes in our knowledge of internal Microsoft Word binary structures. - - * @author Sergey Vladimirov; according to [MS-DOC] --v20110315; Word (.doc) Binary File Format; - Copyright (c) Microsoft Corporation - + * List Format Override (LFO). */ @Internal public abstract class LFOAbstractType diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/LFOLVLBaseAbstractType.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/LFOLVLBaseAbstractType.java index 81bc72a117..d67798efdb 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/LFOLVLBaseAbstractType.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/LFOLVLBaseAbstractType.java @@ -23,21 +23,7 @@ import org.apache.poi.util.Internal; import org.apache.poi.util.LittleEndian; /** - * The LFOLVL structure contains information that is used to override the formatting - information of a corresponding LVL. <p>Class and fields descriptions are quoted from - Microsoft Office Word 97-2007 Binary File Format and [MS-DOC] - v20110608 Word (.doc) Binary - File Format - - * <p> - * NOTE: This source is automatically generated please do not modify this file. Either subclass or - * remove the record in src/types/definitions. - * <p> - * This class is internal. It content or properties may change without notice - * due to changes in our knowledge of internal Microsoft Word binary structures. - - * @author Sergey Vladimirov; according to Microsoft Office Word 97-2007 Binary File Format - Specification [*.doc] and [MS-DOC] - v20110608 Word (.doc) Binary File Format - + * The LFOLVL structure contains information that is used to override the formatting information of a corresponding LVL. */ @Internal public abstract class LFOLVLBaseAbstractType diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/LSTFAbstractType.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/LSTFAbstractType.java index 2565e1e306..310ea09c6b 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/LSTFAbstractType.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/LSTFAbstractType.java @@ -25,19 +25,6 @@ import org.apache.poi.util.LittleEndian; /** * The LSTF structure contains formatting properties that apply to an entire list. - <p>Class and fields descriptions are quoted from Microsoft Office Word 97-2007 Binary - File Format and [MS-DOC] - v20110608 Word (.doc) Binary File Format - - * <p> - * NOTE: This source is automatically generated please do not modify this file. Either subclass or - * remove the record in src/types/definitions. - * <p> - * This class is internal. It content or properties may change without notice - * due to changes in our knowledge of internal Microsoft Word binary structures. - - * @author Sergey Vladimirov; according to Microsoft Office Word 97-2007 Binary File Format - Specification [*.doc] and [MS-DOC] - v20110608 Word (.doc) Binary File Format - */ @Internal public abstract class LSTFAbstractType diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/LVLFAbstractType.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/LVLFAbstractType.java index 79ade79b26..3e73e35c39 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/LVLFAbstractType.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/LVLFAbstractType.java @@ -25,20 +25,7 @@ import org.apache.poi.util.Internal; import org.apache.poi.util.LittleEndian; /** - * The LVLF structure contains formatting properties for an individual level in a - list. <p>Class and fields descriptions are quoted from Microsoft Office Word 97-2007 - Binary File Format and [MS-DOC] - v20110608 Word (.doc) Binary File Format - - * <p> - * NOTE: This source is automatically generated please do not modify this file. Either subclass or - * remove the record in src/types/definitions. - * <p> - * This class is internal. It content or properties may change without notice - * due to changes in our knowledge of internal Microsoft Word binary structures. - - * @author Sergey Vladimirov; according to Microsoft Office Word 97-2007 Binary File Format - Specification [*.doc] and [MS-DOC] - v20110608 Word (.doc) Binary File Format - + * The LVLF structure contains formatting properties for an individual level in a list. */ @Internal public abstract class LVLFAbstractType diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/PICFAbstractType.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/PICFAbstractType.java index 22d4b22dbe..4b3b47ca47 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/PICFAbstractType.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/PICFAbstractType.java @@ -26,21 +26,7 @@ import org.apache.poi.util.LittleEndian; /** * The PICF structure specifies the type of a picture, as well as the size of the - picture and information about its border. <p>Class and fields descriptions are quoted - from Microsoft Office Word 97-2007 - Binary File Format and [MS-DOC] - v20110608 Word (.doc) - Binary File Format - - * <p> - * NOTE: This source is automatically generated please do not modify this file. Either subclass or - * remove the record in src/types/definitions. - * <p> - * This class is internal. It content or properties may change without notice - * due to changes in our knowledge of internal Microsoft Word binary structures. - - * @author Sergey Vladimirov; according to Microsoft Office Word 97-2007 Binary File Format - Specification [*.doc] and [MS-DOC] - v20110608 Word (.doc) Binary File Format - + * picture and information about its border. */ @Internal public abstract class PICFAbstractType diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/StdfBaseAbstractType.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/StdfBaseAbstractType.java index 8282e38933..e9d2a3b483 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/StdfBaseAbstractType.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/StdfBaseAbstractType.java @@ -22,20 +22,7 @@ import org.apache.poi.util.Internal; import org.apache.poi.util.LittleEndian; /** - * The StdfBase structure specifies general information about a style. <p>Class - and fields descriptions are quoted from Microsoft Office Word 97-2007 Binary File Format and - [MS-DOC] - v20110608 Word (.doc) Binary File Format - - * <p> - * NOTE: This source is automatically generated please do not modify this file. Either subclass or - * remove the record in src/types/definitions. - * <p> - * This class is internal. It content or properties may change without notice - * due to changes in our knowledge of internal Microsoft Word binary structures. - - * @author Sergey Vladimirov; according to Microsoft Office Word 97-2007 Binary File Format - Specification [*.doc] and [MS-DOC] - v20110608 Word (.doc) Binary File Format - + * The StdfBase structure specifies general information about a style. */ @Internal public abstract class StdfBaseAbstractType diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/StdfPost2000AbstractType.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/StdfPost2000AbstractType.java index 26e5fd68fc..e470e3fbfc 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/StdfPost2000AbstractType.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/StdfPost2000AbstractType.java @@ -22,19 +22,6 @@ import org.apache.poi.util.LittleEndian; /** * The StdfPost2000 structure specifies general information about a style. - <p>Class and fields descriptions are quoted from Microsoft Office Word 97-2007 Binary - File Format and [MS-DOC] - v20110608 Word (.doc) Binary File Format - - * <p> - * NOTE: This source is automatically generated please do not modify this file. Either subclass or - * remove the record in src/types/definitions. - * <p> - * This class is internal. It content or properties may change without notice - * due to changes in our knowledge of internal Microsoft Word binary structures. - - * @author Sergey Vladimirov; according to Microsoft Office Word 97-2007 Binary File Format - Specification [*.doc] and [MS-DOC] - v20110608 Word (.doc) Binary File Format - */ @Internal public abstract class StdfPost2000AbstractType diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/StshifAbstractType.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/StshifAbstractType.java index 5b72d2e5c8..448c7f3cdc 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/StshifAbstractType.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/types/StshifAbstractType.java @@ -22,20 +22,7 @@ import org.apache.poi.util.Internal; import org.apache.poi.util.LittleEndian; /** - * The Stshif structure specifies general stylesheet information. <p>Class and - fields descriptions are quoted from Microsoft Office Word 97-2007 Binary File Format and - [MS-DOC] - v20110608 Word (.doc) Binary File Format - - * <p> - * NOTE: This source is automatically generated please do not modify this file. Either subclass or - * remove the record in src/types/definitions. - * <p> - * This class is internal. It content or properties may change without notice - * due to changes in our knowledge of internal Microsoft Word binary structures. - - * @author Sergey Vladimirov; according to Microsoft Office Word 97-2007 Binary File Format - Specification [*.doc] and [MS-DOC] - v20110608 Word (.doc) Binary File Format - + * The Stshif structure specifies general stylesheet information. */ @Internal public abstract class StshifAbstractType diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/sprm/SprmIterator.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/sprm/SprmIterator.java index dd4ba7962f..9d497acc61 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/sprm/SprmIterator.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/sprm/SprmIterator.java @@ -22,7 +22,6 @@ import org.apache.poi.util.Internal; /** * This class is used to iterate through a list of sprms from a Word 97/2000/XP * document. - * @author Ryan Ackley * @version 1.0 */ @Internal diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/Bookmark.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/Bookmark.java index 1836d8906c..4102bff294 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/Bookmark.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/Bookmark.java @@ -18,8 +18,6 @@ package org.apache.poi.hwpf.usermodel; /** * User friendly interface to access information about document bookmarks - * - * @author Sergey Vladimirov (vlsergey {at} gmail {doc} com) */ public interface Bookmark { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/Bookmarks.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/Bookmarks.java index c4dae5e9db..912d660719 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/Bookmarks.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/Bookmarks.java @@ -21,8 +21,6 @@ import java.util.Map; /** * User-friendly interface to access document bookmarks - * - * @author Sergey Vladimirov (vlsergey {at} gmail {dot} com) */ public interface Bookmarks { @@ -50,7 +48,7 @@ public interface Bookmarks /** * Remove bookmark from document (but not the bookmark text) - * + * * @param index * bookmark document index to be removed */ diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/BookmarksImpl.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/BookmarksImpl.java index 7c9d7ad9d7..3905598ae5 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/BookmarksImpl.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/BookmarksImpl.java @@ -32,8 +32,6 @@ import org.apache.poi.hwpf.model.PropertyNode; /** * Implementation of user-friendly interface for document bookmarks - * - * @author Sergey Vladimirov (vlsergey {at} gmail {doc} com) */ public class BookmarksImpl implements Bookmarks { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/FieldImpl.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/FieldImpl.java index 37131c3e15..73d3dd1d0e 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/FieldImpl.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/FieldImpl.java @@ -20,11 +20,6 @@ import org.apache.poi.hwpf.model.FieldDescriptor; import org.apache.poi.hwpf.model.PlexOfField; import org.apache.poi.util.Internal; -/** - * TODO: document me - * - * @author Sergey Vladimirov (vlsergey {at} gmail {dot} com) - */ @Internal class FieldImpl implements Field { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/Fields.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/Fields.java index 2db551e5e2..8c26361e49 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/Fields.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/Fields.java @@ -22,8 +22,6 @@ import org.apache.poi.hwpf.model.FieldsDocumentPart; /** * User-friendly interface to access document {@link Field}s - * - * @author Sergey Vladimirov (vlsergey {at} gmail {dot} com) */ public interface Fields { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/FieldsImpl.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/FieldsImpl.java index b57d70ebd7..e826562516 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/FieldsImpl.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/FieldsImpl.java @@ -33,8 +33,6 @@ import org.apache.poi.util.Internal; /** * Default implementation of {@link Field} - * - * @author Sergey Vladimirov (vlsergey {at} gmail {dot} com) */ @Internal public class FieldsImpl implements Fields diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/HWPFList.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/HWPFList.java index 2f100bb658..8a2d6d1ba4 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/HWPFList.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/HWPFList.java @@ -35,16 +35,14 @@ import org.apache.poi.hwpf.sprm.ParagraphSprmCompressor; * conjunction with * {@link org.apache.poi.hwpf.HWPFDocument#registerList(HWPFList) registerList} * in {@link org.apache.poi.hwpf.HWPFDocument HWPFDocument}. - * + * * In Word, lists are not ranged entities, meaning you can't actually add one to * the document. Lists only act as properties for list entries. Once you * register a list, you can add list entries to a document that are a part of * the list. - * + * * The only benefit of this that I see, is that you can add a list entry * anywhere in the document and continue numbering from the previous list. - * - * @author Ryan Ackley */ public final class HWPFList { @@ -56,7 +54,7 @@ public final class HWPFList private StyleSheet _styleSheet; /** - * + * * @param numbered * true if the list should be numbered; false if it should be * bulleted. @@ -197,7 +195,7 @@ public final class HWPFList /** * Sets the character properties of the list numbers. - * + * * @param level * the level number that the properties should apply to. * @param chp @@ -215,7 +213,7 @@ public final class HWPFList /** * Sets the paragraph properties for a particular level of the list. - * + * * @param level * The level number. * @param pap diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/Notes.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/Notes.java index 9e6cf567f3..536b83fc00 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/Notes.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/Notes.java @@ -18,8 +18,6 @@ package org.apache.poi.hwpf.usermodel; /** * User-friendly interface to access document notes information - * - * @author Sergey Vladimirov (vlsergey {at} gmail {doc} com) */ public interface Notes { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/NotesImpl.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/NotesImpl.java index 16c8ada155..5af0a1e65f 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/NotesImpl.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/NotesImpl.java @@ -23,8 +23,6 @@ import org.apache.poi.hwpf.model.NotesTables; /** * Default implementation of {@link Notes} interface - * - * @author Sergey Vladimirov (vlsergey {at} gmail {doc} com) */ public class NotesImpl implements Notes { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/OfficeDrawing.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/OfficeDrawing.java index 4bed04e495..9c39de098a 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/OfficeDrawing.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/OfficeDrawing.java @@ -27,13 +27,11 @@ import org.apache.poi.ddf.EscherContainerRecord; * <li>[MS-ODRAW] -- v20110608; Office Drawing Binary File Format; Copyright (c) * 2011 Microsoft Corporation. * </ul> - * - * @author Sergey Vladimirov (vlsergey {at} gmail {dot} com) */ public interface OfficeDrawing { - public enum HorizontalPositioning { + enum HorizontalPositioning { /** * The shape is horizontally offset by an absolute distance from the @@ -72,11 +70,11 @@ public interface OfficeDrawing RIGHT } - public enum HorizontalRelativeElement { + enum HorizontalRelativeElement { CHAR, MARGIN, PAGE, TEXT } - public enum VerticalPositioning { + enum VerticalPositioning { /** * The shape is vertically offset by an absolute distance from the page @@ -112,34 +110,34 @@ public interface OfficeDrawing TOP } - public enum VerticalRelativeElement { + enum VerticalRelativeElement { LINE, MARGIN, PAGE, TEXT } /** * Returns the type of horizontal positioning to use for a shape - * + * * @return the type of horizontal positioning to use for a shape */ - public HorizontalPositioning getHorizontalPositioning(); + HorizontalPositioning getHorizontalPositioning(); /** * Specifies a page element relative to which a shape is horizontally * positioned - * + * * @return a page element relative to which a shape is horizontally * positioned */ - public HorizontalRelativeElement getHorizontalRelative(); + HorizontalRelativeElement getHorizontalRelative(); /** * Returns escher record that represent shape container (record type is - * <tt>0xF004</tt>). Returned record has a child with record type - * <tt>0xF00A</tt> and value of shape id equals to {@link #getShapeId()}. - * - * @return Returns office art shape container or <tt>null</tt> if not found + * {@code 0xF004}). Returned record has a child with record type + * {@code 0xF00A} and value of shape id equals to {@link #getShapeId()}. + * + * @return Returns office art shape container or {@code null} if not found */ - public EscherContainerRecord getOfficeArtSpContainer(); + EscherContainerRecord getOfficeArtSpContainer(); /** * Returns picture data if this shape has (single?) associated picture data @@ -174,17 +172,17 @@ public interface OfficeDrawing /** * Specifies the type of vertical positioning to use for a shape - * + * * @return return the type of vertical positioning to use for a shape */ - public VerticalPositioning getVerticalPositioning(); + VerticalPositioning getVerticalPositioning(); /** * Specifies a page element relative to which a shape is vertically * positioned - * + * * @return a page element relative to which a shape is vertically positioned */ - public VerticalRelativeElement getVerticalRelativeElement(); + VerticalRelativeElement getVerticalRelativeElement(); } diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/OfficeDrawings.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/OfficeDrawings.java index 58661aa8dd..f4ef4b950e 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/OfficeDrawings.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/OfficeDrawings.java @@ -20,8 +20,6 @@ import java.util.Collection; /** * User-friendly interface to access document part's office drawings - * - * @author Sergey Vladimirov (vlsergey {at} gmail {dot} com) */ public interface OfficeDrawings { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/OfficeDrawingsImpl.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/OfficeDrawingsImpl.java index ec5477725a..5fefa3478f 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/OfficeDrawingsImpl.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/OfficeDrawingsImpl.java @@ -118,6 +118,7 @@ public class OfficeDrawingsImpl implements OfficeDrawings { return new OfficeDrawing() { + @Override public HorizontalPositioning getHorizontalPositioning() { int value = getTertiaryPropertyValue(EscherPropertyTypes.GROUPSHAPE__POSH ); @@ -141,6 +142,7 @@ public class OfficeDrawingsImpl implements OfficeDrawings return HorizontalPositioning.ABSOLUTE; } + @Override public HorizontalRelativeElement getHorizontalRelative() { int value = getTertiaryPropertyValue( EscherPropertyTypes.GROUPSHAPE__POSRELH ); @@ -160,11 +162,13 @@ public class OfficeDrawingsImpl implements OfficeDrawings return HorizontalRelativeElement.TEXT; } + @Override public EscherContainerRecord getOfficeArtSpContainer() { return getEscherShapeRecordContainer( getShapeId() ); } + @Override public byte[] getPictureData() { EscherContainerRecord shapeDescription = getEscherShapeRecordContainer( getShapeId() ); @@ -189,26 +193,31 @@ public class OfficeDrawingsImpl implements OfficeDrawings return escherBlipRecord.getPicturedata(); } + @Override public int getRectangleBottom() { return fspa.getYaBottom(); } + @Override public int getRectangleLeft() { return fspa.getXaLeft(); } + @Override public int getRectangleRight() { return fspa.getXaRight(); } + @Override public int getRectangleTop() { return fspa.getYaTop(); } + @Override public int getShapeId() { return fspa.getSpid(); @@ -230,6 +239,7 @@ public class OfficeDrawingsImpl implements OfficeDrawings return ( escherProperty == null ) ? -1 : escherProperty.getPropertyValue(); } + @Override public VerticalPositioning getVerticalPositioning() { int value = getTertiaryPropertyValue( EscherPropertyTypes.GROUPSHAPE__POSV ); @@ -253,6 +263,7 @@ public class OfficeDrawingsImpl implements OfficeDrawings return VerticalPositioning.ABSOLUTE; } + @Override public VerticalRelativeElement getVerticalRelativeElement() { int value = getTertiaryPropertyValue( EscherPropertyTypes.GROUPSHAPE__POSV ); @@ -280,6 +291,7 @@ public class OfficeDrawingsImpl implements OfficeDrawings }; } + @Override public OfficeDrawing getOfficeDrawingAt( int characterPosition ) { final FSPA fspa = _fspaTable.getFspaFromCp( characterPosition ); @@ -289,6 +301,7 @@ public class OfficeDrawingsImpl implements OfficeDrawings return getOfficeDrawing( fspa ); } + @Override public Collection<OfficeDrawing> getOfficeDrawings() { List<OfficeDrawing> result = new ArrayList<>(); diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/Paragraph.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/Paragraph.java index 0447624336..d328baccea 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/Paragraph.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/Paragraph.java @@ -195,8 +195,8 @@ public class Paragraph extends Range implements Duplicatable { } /** - * @return <tt>true</tt>, if table trailer paragraph (last in table row), - * <tt>false</tt> otherwise + * @return {@code true}, if table trailer paragraph (last in table row), + * {@code false} otherwise */ public boolean isTableRowEnd() { @@ -209,8 +209,8 @@ public class Paragraph extends Range implements Duplicatable { } /** - * @return <tt>true</tt>, if the end of paragraph mark is really an end of - * cell mark for a nested table cell, <tt>false</tt> otherwise + * @return {@code true}, if the end of paragraph mark is really an end of + * cell mark for a nested table cell, {@code false} otherwise */ public boolean isEmbeddedCellMark() { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/PictureType.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/PictureType.java index e630925dcd..e1d5753f7d 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/PictureType.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/PictureType.java @@ -18,8 +18,6 @@ package org.apache.poi.hwpf.usermodel; /** * Picture types supported by MS Word format - * - * @author Sergey Vladimirov (vlsergey {at} gmail {dot} com) */ public enum PictureType { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/Range.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/Range.java index 0b6cbcb644..ec37019226 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/Range.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/usermodel/Range.java @@ -626,7 +626,7 @@ public class Range { * @param newText * The text to be replaced with * @param addAfter - * if <tt>true</tt> the text will be added at the end of current + * if {@code true} the text will be added at the end of current * range, otherwise to the beginning */ public void replaceText( String newText, boolean addAfter ) @@ -657,7 +657,7 @@ public class Range { * The replacement text (e.g., "Apache Software Foundation") * @param pOffset * The offset or index where the text to be replaced begins - * (relative to/within this <code>Range</code>) + * (relative to/within this {@code Range}) */ @Internal public void replaceText(String pPlaceHolder, String pValue, int pOffset) { @@ -1056,7 +1056,7 @@ public class Range { /** * Adjust the value of the various FIB character count fields, eg - * <code>FIB.CCPText</code> after an insert or a delete... + * {@code FIB.CCPText} after an insert or a delete... * * Works on all CCP fields from this range onwards * diff --git a/poi-scratchpad/src/test/java/org/apache/poi/hslf/HSLFTestDataSamples.java b/poi-scratchpad/src/test/java/org/apache/poi/hslf/HSLFTestDataSamples.java index 0ec92bb6a2..82b3a46091 100644 --- a/poi-scratchpad/src/test/java/org/apache/poi/hslf/HSLFTestDataSamples.java +++ b/poi-scratchpad/src/test/java/org/apache/poi/hslf/HSLFTestDataSamples.java @@ -34,15 +34,15 @@ public class HSLFTestDataSamples { public static InputStream openSampleFileStream(String sampleFileName) { return _inst.openResourceAsStream(sampleFileName); } - + public static File getSampleFile(String sampleFileName) { return _inst.getFile(sampleFileName); } - + public static byte[] getTestDataFileContent(String fileName) { return _inst.readFile(fileName); } - + public static HSLFSlideShow getSlideShow(String fileName) throws IOException { try (InputStream is = openSampleFileStream(fileName)) { return new HSLFSlideShow(is); @@ -50,8 +50,8 @@ public class HSLFTestDataSamples { } /** - * Writes a slideshow to a <tt>ByteArrayOutputStream</tt> and reads it back - * from a <tt>ByteArrayInputStream</tt>.<p> + * Writes a slideshow to a {@code ByteArrayOutputStream} and reads it back + * from a {@code ByteArrayInputStream}.<p> * Useful for verifying that the serialisation round trip */ public static HSLFSlideShowImpl writeOutAndReadBack(HSLFSlideShowImpl original) { @@ -66,8 +66,8 @@ public class HSLFTestDataSamples { } /** - * Writes a slideshow to a <tt>ByteArrayOutputStream</tt> and reads it back - * from a <tt>ByteArrayInputStream</tt>.<p> + * Writes a slideshow to a {@code ByteArrayOutputStream} and reads it back + * from a {@code ByteArrayInputStream}.<p> * Useful for verifying that the serialisation round trip */ public static HSLFSlideShow writeOutAndReadBack(HSLFSlideShow original) { diff --git a/poi-scratchpad/src/test/java/org/apache/poi/hslf/TestReWriteSanity.java b/poi-scratchpad/src/test/java/org/apache/poi/hslf/TestReWriteSanity.java index 200966fd7a..3aca727bee 100644 --- a/poi-scratchpad/src/test/java/org/apache/poi/hslf/TestReWriteSanity.java +++ b/poi-scratchpad/src/test/java/org/apache/poi/hslf/TestReWriteSanity.java @@ -40,8 +40,6 @@ import org.junit.jupiter.api.Test; /** * Tests that HSLFSlideShow writes the powerpoint bit of data back out * in a sane manner - i.e. records end up in the right place - * - * @author Nick Burch (nick at torchbox dot com) */ public final class TestReWriteSanity { // HSLFSlideShow primed on the test data diff --git a/poi-scratchpad/src/test/java/org/apache/poi/hslf/model/TestFreeform.java b/poi-scratchpad/src/test/java/org/apache/poi/hslf/model/TestFreeform.java index 8016278617..f4cadff6cc 100644 --- a/poi-scratchpad/src/test/java/org/apache/poi/hslf/model/TestFreeform.java +++ b/poi-scratchpad/src/test/java/org/apache/poi/hslf/model/TestFreeform.java @@ -33,8 +33,6 @@ import org.junit.jupiter.api.Test; * The Freeform shape is constructed from java.awt.GeneralPath. * Check that the get/set path accessors are consistent. * (TODO: verification of Bezier curves is more difficult due to rounding error. Figure out a test approach for that) - * - * @author Yegor Kozlov */ public final class TestFreeform { diff --git a/poi-scratchpad/src/test/java/org/apache/poi/hslf/model/TestSetBoldItalic.java b/poi-scratchpad/src/test/java/org/apache/poi/hslf/model/TestSetBoldItalic.java index 9ab28fa66c..e47467c2ba 100644 --- a/poi-scratchpad/src/test/java/org/apache/poi/hslf/model/TestSetBoldItalic.java +++ b/poi-scratchpad/src/test/java/org/apache/poi/hslf/model/TestSetBoldItalic.java @@ -27,8 +27,6 @@ import org.junit.jupiter.api.Test; /** * Test setting text properties of newly added TextBoxes - * - * @author Yegor Kozlov */ public final class TestSetBoldItalic { /** diff --git a/poi-scratchpad/src/test/java/org/apache/poi/hslf/model/TestSheet.java b/poi-scratchpad/src/test/java/org/apache/poi/hslf/model/TestSheet.java index 50fada2805..b640b4f48d 100644 --- a/poi-scratchpad/src/test/java/org/apache/poi/hslf/model/TestSheet.java +++ b/poi-scratchpad/src/test/java/org/apache/poi/hslf/model/TestSheet.java @@ -30,10 +30,8 @@ import org.apache.poi.hslf.usermodel.*; import org.junit.jupiter.api.Test; /** - * Test common functionality of the <code>Sheet</code> object. + * Test common functionality of the {@code Sheet} object. * For each ppt in the test directory check that all sheets are properly initialized - * - * @author Yegor Kozlov */ public final class TestSheet { private static final POIDataSamples _slTests = POIDataSamples.getSlideShowInstance(); diff --git a/poi-scratchpad/src/test/java/org/apache/poi/hslf/model/TestSlideChangeNotes.java b/poi-scratchpad/src/test/java/org/apache/poi/hslf/model/TestSlideChangeNotes.java index 7557a8bc17..6d8aaaac6a 100644 --- a/poi-scratchpad/src/test/java/org/apache/poi/hslf/model/TestSlideChangeNotes.java +++ b/poi-scratchpad/src/test/java/org/apache/poi/hslf/model/TestSlideChangeNotes.java @@ -28,8 +28,6 @@ import org.junit.jupiter.api.Test; /** * Tests that changing a slide's idea of what notes sheet is its works right - * - * @author Nick Burch (nick at torchbox dot com) */ public final class TestSlideChangeNotes { // SlideShow primed on the test data diff --git a/poi-scratchpad/src/test/java/org/apache/poi/hslf/model/TestSlides.java b/poi-scratchpad/src/test/java/org/apache/poi/hslf/model/TestSlides.java index c539a09b03..31713bae88 100644 --- a/poi-scratchpad/src/test/java/org/apache/poi/hslf/model/TestSlides.java +++ b/poi-scratchpad/src/test/java/org/apache/poi/hslf/model/TestSlides.java @@ -30,9 +30,7 @@ import org.junit.jupiter.api.Test; /** * Test adding new slides to a ppt. * - * Note - uses the same empty PPT file as the core "new Slideshow" - * stuff does - * @author Yegor Kozlov + * Note - uses the same empty PPT file as the core "new Slideshow" stuff does */ public final class TestSlides { diff --git a/poi-scratchpad/src/test/java/org/apache/poi/hslf/record/TestComment2000.java b/poi-scratchpad/src/test/java/org/apache/poi/hslf/record/TestComment2000.java index 19a12a95a2..f518b9ffee 100644 --- a/poi-scratchpad/src/test/java/org/apache/poi/hslf/record/TestComment2000.java +++ b/poi-scratchpad/src/test/java/org/apache/poi/hslf/record/TestComment2000.java @@ -35,8 +35,6 @@ import org.junit.jupiter.api.Test; /** * Tests that Comment2000 works properly. * TODO: Test Comment200Atom within - * - * @author Nick Burch (nick at torchbox dot com) */ public final class TestComment2000 { // From a real file diff --git a/poi-scratchpad/src/test/java/org/apache/poi/hslf/record/TestComment2000Atom.java b/poi-scratchpad/src/test/java/org/apache/poi/hslf/record/TestComment2000Atom.java index 0568afaef5..59660e4947 100644 --- a/poi-scratchpad/src/test/java/org/apache/poi/hslf/record/TestComment2000Atom.java +++ b/poi-scratchpad/src/test/java/org/apache/poi/hslf/record/TestComment2000Atom.java @@ -31,8 +31,6 @@ import org.junit.jupiter.api.Test; /** * Tests that Comment2000Atom works properly. - * - * @author Nick Burch (nick at torchbox dot com) */ public final class TestComment2000Atom { // From a real file diff --git a/poi-scratchpad/src/test/java/org/apache/poi/hslf/record/TestCurrentUserAtom.java b/poi-scratchpad/src/test/java/org/apache/poi/hslf/record/TestCurrentUserAtom.java index 030b954d3c..138e127024 100644 --- a/poi-scratchpad/src/test/java/org/apache/poi/hslf/record/TestCurrentUserAtom.java +++ b/poi-scratchpad/src/test/java/org/apache/poi/hslf/record/TestCurrentUserAtom.java @@ -33,8 +33,6 @@ import org.junit.jupiter.api.Test; /** * Tests that CurrentUserAtom works properly. - * - * @author Nick Burch (nick at torchbox dot com) */ public final class TestCurrentUserAtom { private static final POIDataSamples _slTests = POIDataSamples.getSlideShowInstance(); diff --git a/poi-scratchpad/src/test/java/org/apache/poi/hslf/record/TestDocumentEncryptionAtom.java b/poi-scratchpad/src/test/java/org/apache/poi/hslf/record/TestDocumentEncryptionAtom.java index ac837fc582..c33507c404 100644 --- a/poi-scratchpad/src/test/java/org/apache/poi/hslf/record/TestDocumentEncryptionAtom.java +++ b/poi-scratchpad/src/test/java/org/apache/poi/hslf/record/TestDocumentEncryptionAtom.java @@ -26,8 +26,6 @@ import org.junit.jupiter.api.Test; /** * Tests that DocumentEncryptionAtom works properly. - * - * @author Nick Burch (nick at torchbox dot com) */ public final class TestDocumentEncryptionAtom { // From a real file diff --git a/poi-scratchpad/src/test/java/org/apache/poi/hslf/record/TestExVideoContainer.java b/poi-scratchpad/src/test/java/org/apache/poi/hslf/record/TestExVideoContainer.java index 2534fddd18..3933965ac2 100644 --- a/poi-scratchpad/src/test/java/org/apache/poi/hslf/record/TestExVideoContainer.java +++ b/poi-scratchpad/src/test/java/org/apache/poi/hslf/record/TestExVideoContainer.java @@ -29,8 +29,6 @@ import org.junit.jupiter.api.Test; /** * Tests that {@link HeadersFootersAtom} works properly - * - * @author Yegor Kozlov */ public final class TestExVideoContainer { diff --git a/poi-scratchpad/src/test/java/org/apache/poi/hslf/record/TestStyleTextPropAtom.java b/poi-scratchpad/src/test/java/org/apache/poi/hslf/record/TestStyleTextPropAtom.java index 887814ab43..3de5c8d131 100644 --- a/poi-scratchpad/src/test/java/org/apache/poi/hslf/record/TestStyleTextPropAtom.java +++ b/poi-scratchpad/src/test/java/org/apache/poi/hslf/record/TestStyleTextPropAtom.java @@ -39,8 +39,6 @@ import org.junit.jupiter.api.Test; /** * Tests that StyleTextPropAtom works properly - * - * @author Nick Burch (nick at torchbox dot com) */ public final class TestStyleTextPropAtom { /** From a real file: a paragraph with 4 different styles */ diff --git a/poi-scratchpad/src/test/java/org/apache/poi/hslf/record/TestTextSpecInfoAtom.java b/poi-scratchpad/src/test/java/org/apache/poi/hslf/record/TestTextSpecInfoAtom.java index 578c6eef89..77ded7d795 100644 --- a/poi-scratchpad/src/test/java/org/apache/poi/hslf/record/TestTextSpecInfoAtom.java +++ b/poi-scratchpad/src/test/java/org/apache/poi/hslf/record/TestTextSpecInfoAtom.java @@ -26,8 +26,6 @@ import org.junit.jupiter.api.Test; /** * Tests TextSpecInfoAtom - * - * @author Yegor Kozlov */ public final class TestTextSpecInfoAtom { diff --git a/poi-scratchpad/src/test/java/org/apache/poi/hslf/usermodel/TestBackground.java b/poi-scratchpad/src/test/java/org/apache/poi/hslf/usermodel/TestBackground.java index 38bc03bb28..cc3abf76e8 100644 --- a/poi-scratchpad/src/test/java/org/apache/poi/hslf/usermodel/TestBackground.java +++ b/poi-scratchpad/src/test/java/org/apache/poi/hslf/usermodel/TestBackground.java @@ -39,9 +39,7 @@ import org.junit.jupiter.api.Test; /** - * Test <code>Fill</code> object. - * - * @author Yegor Kozlov + * Test {@code Fill} object. */ public final class TestBackground { private static POIDataSamples _slTests = POIDataSamples.getSlideShowInstance(); diff --git a/poi-scratchpad/src/test/java/org/apache/poi/hslf/usermodel/TestNumberedList.java b/poi-scratchpad/src/test/java/org/apache/poi/hslf/usermodel/TestNumberedList.java index 6591a13ac7..e39ef463f9 100644 --- a/poi-scratchpad/src/test/java/org/apache/poi/hslf/usermodel/TestNumberedList.java +++ b/poi-scratchpad/src/test/java/org/apache/poi/hslf/usermodel/TestNumberedList.java @@ -39,8 +39,6 @@ import org.junit.jupiter.api.Test; /** * Test that checks numbered list functionality. - * - * @author Alex Nikiforov [mailto:anikif@gmail.com] */ public final class TestNumberedList { private static POIDataSamples _slTests = POIDataSamples.getSlideShowInstance(); diff --git a/poi-scratchpad/src/test/java/org/apache/poi/hslf/usermodel/TestNumberedList3.java b/poi-scratchpad/src/test/java/org/apache/poi/hslf/usermodel/TestNumberedList3.java index 6aa90ff6d9..6475d51b5d 100644 --- a/poi-scratchpad/src/test/java/org/apache/poi/hslf/usermodel/TestNumberedList3.java +++ b/poi-scratchpad/src/test/java/org/apache/poi/hslf/usermodel/TestNumberedList3.java @@ -43,8 +43,6 @@ import org.junit.jupiter.api.Test; * if a paragraph has autonumber () * @see <a href="http://social.msdn.microsoft.com/Forums/mr-IN/os_binaryfile/thread/650888db-fabd-4b95-88dc-f0455f6e2d28"> * PPT: Missing TextAutoNumberScheme structure providing the style of the number bullets</a> - * - * @author Alex Nikiforov [mailto:anikif@gmail.com] */ public final class TestNumberedList3 { private static final POIDataSamples _slTests = POIDataSamples.getSlideShowInstance(); diff --git a/poi-scratchpad/src/test/java/org/apache/poi/hslf/usermodel/TestPictures.java b/poi-scratchpad/src/test/java/org/apache/poi/hslf/usermodel/TestPictures.java index a196ed685b..5e50aa9c1f 100644 --- a/poi-scratchpad/src/test/java/org/apache/poi/hslf/usermodel/TestPictures.java +++ b/poi-scratchpad/src/test/java/org/apache/poi/hslf/usermodel/TestPictures.java @@ -53,8 +53,6 @@ import org.junit.jupiter.api.Test; /** * Test adding/reading pictures - * - * @author Yegor Kozlov */ public final class TestPictures { private static final POIDataSamples slTests = POIDataSamples.getSlideShowInstance(); diff --git a/poi-scratchpad/src/test/java/org/apache/poi/hslf/usermodel/TestRecordSetup.java b/poi-scratchpad/src/test/java/org/apache/poi/hslf/usermodel/TestRecordSetup.java index 0eba4ae56e..962cc7e4d4 100644 --- a/poi-scratchpad/src/test/java/org/apache/poi/hslf/usermodel/TestRecordSetup.java +++ b/poi-scratchpad/src/test/java/org/apache/poi/hslf/usermodel/TestRecordSetup.java @@ -28,8 +28,6 @@ import org.junit.jupiter.api.Test; * Tests that the record setup done by SlideShow * has worked correctly * Note: most recent record stuff has its own test - * - * @author Nick Burch (nick at torchbox dot com) */ public final class TestRecordSetup { // SlideShow primed on the test data diff --git a/poi-scratchpad/src/test/java/org/apache/poi/hslf/util/TestSystemTimeUtils.java b/poi-scratchpad/src/test/java/org/apache/poi/hslf/util/TestSystemTimeUtils.java index 6572ade892..ba67d2170f 100644 --- a/poi-scratchpad/src/test/java/org/apache/poi/hslf/util/TestSystemTimeUtils.java +++ b/poi-scratchpad/src/test/java/org/apache/poi/hslf/util/TestSystemTimeUtils.java @@ -30,8 +30,6 @@ import org.junit.jupiter.api.Test; /** * Tests that SystemTimeUtils works properly. - * - * @author Nick Burch (nick at torchbox dot com) */ public final class TestSystemTimeUtils { // From real files diff --git a/poi-scratchpad/src/test/java/org/apache/poi/hwpf/HWPFTestDataSamples.java b/poi-scratchpad/src/test/java/org/apache/poi/hwpf/HWPFTestDataSamples.java index 142ad026e4..b8f11dc40f 100644 --- a/poi-scratchpad/src/test/java/org/apache/poi/hwpf/HWPFTestDataSamples.java +++ b/poi-scratchpad/src/test/java/org/apache/poi/hwpf/HWPFTestDataSamples.java @@ -93,8 +93,8 @@ public class HWPFTestDataSamples { } } /** - * Writes a spreadsheet to a <tt>ByteArrayOutputStream</tt> and reads it back - * from a <tt>ByteArrayInputStream</tt>.<p> + * Writes a spreadsheet to a {@code ByteArrayOutputStream} and reads it back + * from a {@code ByteArrayInputStream}.<p> * Useful for verifying that the serialisation round trip */ public static HWPFDocument writeOutAndReadBack(HWPFDocument original) { diff --git a/poi-scratchpad/src/test/java/org/apache/poi/hwpf/extractor/TestDifferentRoutes.java b/poi-scratchpad/src/test/java/org/apache/poi/hwpf/extractor/TestDifferentRoutes.java index 1574c3410a..331085ae4a 100644 --- a/poi-scratchpad/src/test/java/org/apache/poi/hwpf/extractor/TestDifferentRoutes.java +++ b/poi-scratchpad/src/test/java/org/apache/poi/hwpf/extractor/TestDifferentRoutes.java @@ -33,8 +33,6 @@ import org.junit.jupiter.api.Test; /** * Test the different routes to extracting text - * - * @author Nick Burch (nick at torchbox dot com) */ public final class TestDifferentRoutes { private static final String[] p_text = new String[] { diff --git a/poi/src/main/java/org/apache/poi/ddf/EscherContainerRecord.java b/poi/src/main/java/org/apache/poi/ddf/EscherContainerRecord.java index bbe7efac65..e525d50333 100644 --- a/poi/src/main/java/org/apache/poi/ddf/EscherContainerRecord.java +++ b/poi/src/main/java/org/apache/poi/ddf/EscherContainerRecord.java @@ -172,7 +172,7 @@ public final class EscherContainerRecord extends EscherRecord implements Iterabl /** - * replaces the internal child list with the contents of the supplied <tt>childRecords</tt> + * replaces the internal child list with the contents of the supplied {@code childRecords} */ @Override public void setChildRecords(List<EscherRecord> childRecords) { diff --git a/poi/src/main/java/org/apache/poi/ddf/EscherPropertyMetaData.java b/poi/src/main/java/org/apache/poi/ddf/EscherPropertyMetaData.java index 99f5f6cb34..bf61e00027 100644 --- a/poi/src/main/java/org/apache/poi/ddf/EscherPropertyMetaData.java +++ b/poi/src/main/java/org/apache/poi/ddf/EscherPropertyMetaData.java @@ -20,8 +20,6 @@ package org.apache.poi.ddf; /** * This class stores the type and description of an escher property. - * - * @author Glen Stampoultzis (glens at apache.org) */ public class EscherPropertyMetaData { diff --git a/poi/src/main/java/org/apache/poi/hpsf/IllegalPropertySetDataException.java b/poi/src/main/java/org/apache/poi/hpsf/IllegalPropertySetDataException.java index 3217af9580..2b673f381b 100644 --- a/poi/src/main/java/org/apache/poi/hpsf/IllegalPropertySetDataException.java +++ b/poi/src/main/java/org/apache/poi/hpsf/IllegalPropertySetDataException.java @@ -23,9 +23,7 @@ package org.apache.poi.hpsf; * have a value of <code>-1 (true)</code> or <code>0 (false)</code>. * Any other value would trigger this exception. It supports a nested * "reason" throwable, i.e. an exception that caused this one to be - * thrown.</p> - * - * @author Drew Varner(Drew.Varner atDomain sc.edu) + * thrown. */ public class IllegalPropertySetDataException extends HPSFRuntimeException { @@ -42,7 +40,7 @@ public class IllegalPropertySetDataException extends HPSFRuntimeException /** * <p>Constructor</p> - * + * * @param msg The exception's message string */ public IllegalPropertySetDataException(final String msg) @@ -54,7 +52,7 @@ public class IllegalPropertySetDataException extends HPSFRuntimeException /** * <p>Constructor</p> - * + * * @param reason This exception's underlying reason */ public IllegalPropertySetDataException(final Throwable reason) @@ -66,7 +64,7 @@ public class IllegalPropertySetDataException extends HPSFRuntimeException /** * <p>Constructor</p> - * + * * @param msg The exception's message string * @param reason This exception's underlying reason */ diff --git a/poi/src/main/java/org/apache/poi/hssf/dev/EFBiffViewer.java b/poi/src/main/java/org/apache/poi/hssf/dev/EFBiffViewer.java index 6e01e09f7b..8fe58a11c4 100644 --- a/poi/src/main/java/org/apache/poi/hssf/dev/EFBiffViewer.java +++ b/poi/src/main/java/org/apache/poi/hssf/dev/EFBiffViewer.java @@ -25,11 +25,6 @@ import org.apache.poi.hssf.eventusermodel.HSSFEventFactory; import org.apache.poi.hssf.eventusermodel.HSSFRequest; import org.apache.poi.poifs.filesystem.POIFSFileSystem; -/** - * - * @author andy - */ - public class EFBiffViewer { String file; diff --git a/poi/src/main/java/org/apache/poi/hssf/dev/FormulaViewer.java b/poi/src/main/java/org/apache/poi/hssf/dev/FormulaViewer.java index bc7cc9cc84..2301330343 100644 --- a/poi/src/main/java/org/apache/poi/hssf/dev/FormulaViewer.java +++ b/poi/src/main/java/org/apache/poi/hssf/dev/FormulaViewer.java @@ -33,10 +33,7 @@ import org.apache.poi.ss.formula.ptg.Ptg; /** * FormulaViewer - finds formulas in a BIFF8 file and attempts to read them/display * data from them. Only works if Formulas are enabled in "RecordFactory" - * @author andy - * @author Avik */ - public class FormulaViewer { private String file; diff --git a/poi/src/main/java/org/apache/poi/hssf/model/InternalSheet.java b/poi/src/main/java/org/apache/poi/hssf/model/InternalSheet.java index e1a96e15ce..2ec71a52fa 100644 --- a/poi/src/main/java/org/apache/poi/hssf/model/InternalSheet.java +++ b/poi/src/main/java/org/apache/poi/hssf/model/InternalSheet.java @@ -358,6 +358,7 @@ public final class InternalSheet { public RecordCloner(List<Record> destList) { _destList = destList; } + @Override public void visitRecord(Record r) { _destList.add(r.copy()); } diff --git a/poi/src/main/java/org/apache/poi/hssf/model/RecordStream.java b/poi/src/main/java/org/apache/poi/hssf/model/RecordStream.java index 02d85fda6a..1c548a02d1 100644 --- a/poi/src/main/java/org/apache/poi/hssf/model/RecordStream.java +++ b/poi/src/main/java/org/apache/poi/hssf/model/RecordStream.java @@ -21,7 +21,7 @@ import java.util.List; import org.apache.poi.hssf.record.Record; /** - * Simplifies iteration over a sequence of <tt>Record</tt> objects. + * Simplifies iteration over a sequence of {@code Record} objects. */ public final class RecordStream { @@ -61,7 +61,7 @@ public final class RecordStream { } /** - * @return the {@link Class} of the next Record. <code>null</code> if this stream is exhausted. + * @return the {@link Class} of the next Record. {@code null} if this stream is exhausted. */ public Class<? extends Record> peekNextClass() { if(!hasNext()) { @@ -71,7 +71,7 @@ public final class RecordStream { } /** - * @return the next Record. <code>null</code> if this stream is exhausted. + * @return the next Record. {@code null} if this stream is exhausted. */ public Record peekNextRecord() { return (hasNext()) ? _list.get(_nextIndex) : null; diff --git a/poi/src/main/java/org/apache/poi/hssf/model/RowBlocksReader.java b/poi/src/main/java/org/apache/poi/hssf/model/RowBlocksReader.java index efad9d5a86..b25b8fac2c 100644 --- a/poi/src/main/java/org/apache/poi/hssf/model/RowBlocksReader.java +++ b/poi/src/main/java/org/apache/poi/hssf/model/RowBlocksReader.java @@ -43,7 +43,7 @@ public final class RowBlocksReader { /** * Also collects any loose MergeCellRecords and puts them in the supplied * mergedCellsTable - * + * * @param rs the record stream */ public RowBlocksReader(RecordStream rs) { @@ -100,7 +100,7 @@ public final class RowBlocksReader { /** * Some unconventional apps place {@link MergeCellsRecord}s within the row block. They * actually should be in the {@link MergedCellsTable} which is much later (see bug 45699). - * @return any loose <tt>MergeCellsRecord</tt>s found + * @return any loose {@code MergeCellsRecord}s found */ public MergeCellsRecord[] getLooseMergedCells() { return _mergedCellsRecords; diff --git a/poi/src/main/java/org/apache/poi/hssf/record/CFRuleBase.java b/poi/src/main/java/org/apache/poi/hssf/record/CFRuleBase.java index 22ee40f54a..34a7340aaa 100644 --- a/poi/src/main/java/org/apache/poi/hssf/record/CFRuleBase.java +++ b/poi/src/main/java/org/apache/poi/hssf/record/CFRuleBase.java @@ -420,7 +420,7 @@ public abstract class CFRuleBase extends StandardRecord { /** * get the stack of the 2nd expression as a list * - * @return array of {@link Ptg}s, possibly <code>null</code> + * @return array of {@link Ptg}s, possibly {@code null} */ public Ptg[] getParsedExpression2() { return Formula.getTokens(formula2); @@ -436,7 +436,7 @@ public abstract class CFRuleBase extends StandardRecord { } /** - * @param formula must not be <code>null</code> + * @param formula must not be {@code null} * @return encoded size of the formula tokens (does not include 2 bytes for ushort length) */ protected static int getFormulaSize(Formula formula) { @@ -451,7 +451,7 @@ public abstract class CFRuleBase extends StandardRecord { * * @param formula The formula to parse, excluding the leading equals sign. * @param sheet The sheet that the formula is on. - * @return <code>null</code> if <tt>formula</tt> was null. + * @return {@code null} if {@code formula} was null. */ public static Ptg[] parseFormula(String formula, HSSFSheet sheet) { if(formula == null) { diff --git a/poi/src/main/java/org/apache/poi/hssf/record/CellValueRecordInterface.java b/poi/src/main/java/org/apache/poi/hssf/record/CellValueRecordInterface.java index c91a400d6a..7f19a2215f 100644 --- a/poi/src/main/java/org/apache/poi/hssf/record/CellValueRecordInterface.java +++ b/poi/src/main/java/org/apache/poi/hssf/record/CellValueRecordInterface.java @@ -22,9 +22,6 @@ package org.apache.poi.hssf.record; * contain cell values. It allows the containing sheet to move through them and compare * them. * - * @author Andrew C. Oliver (acoliver at apache dot org) - * @author Jason Height (jheight at chariot dot net dot au) - * * @see org.apache.poi.hssf.record.Record * @see org.apache.poi.hssf.record.RecordFactory */ diff --git a/poi/src/main/java/org/apache/poi/hssf/record/FormulaSpecialCachedValue.java b/poi/src/main/java/org/apache/poi/hssf/record/FormulaSpecialCachedValue.java index 9eadacea83..fe4cd5a48a 100644 --- a/poi/src/main/java/org/apache/poi/hssf/record/FormulaSpecialCachedValue.java +++ b/poi/src/main/java/org/apache/poi/hssf/record/FormulaSpecialCachedValue.java @@ -64,7 +64,7 @@ public final class FormulaSpecialCachedValue implements GenericRecord { } /** - * @return <code>null</code> if the double value encoded by <tt>valueLongBits</tt> + * @return {@code null} if the double value encoded by {@code valueLongBits} * is a normal (non NaN) double value. */ public static FormulaSpecialCachedValue create(long valueLongBits) { diff --git a/poi/src/main/java/org/apache/poi/hssf/record/SSTDeserializer.java b/poi/src/main/java/org/apache/poi/hssf/record/SSTDeserializer.java index 6b3bce351d..c2d7e7d8c3 100644 --- a/poi/src/main/java/org/apache/poi/hssf/record/SSTDeserializer.java +++ b/poi/src/main/java/org/apache/poi/hssf/record/SSTDeserializer.java @@ -28,9 +28,6 @@ import static org.apache.logging.log4j.util.Unbox.box; /** * Handles the task of deserializing a SST string. The two main entry points are - * - * @author Glen Stampoultzis (glens at apache.org) - * @author Jason Height (jheight at apache.org) */ class SSTDeserializer { diff --git a/poi/src/main/java/org/apache/poi/hssf/record/SSTSerializer.java b/poi/src/main/java/org/apache/poi/hssf/record/SSTSerializer.java index c15c7ad1ff..c5ef2933d6 100644 --- a/poi/src/main/java/org/apache/poi/hssf/record/SSTSerializer.java +++ b/poi/src/main/java/org/apache/poi/hssf/record/SSTSerializer.java @@ -24,8 +24,6 @@ import org.apache.poi.util.IntMapper; /** * This class handles serialization of SST records. It utilizes the record processor * class write individual records. This has been refactored from the SSTRecord class. - * - * @author Glen Stampoultzis (glens at apache.org) */ final class SSTSerializer { diff --git a/poi/src/main/java/org/apache/poi/hssf/record/aggregates/CFRecordsAggregate.java b/poi/src/main/java/org/apache/poi/hssf/record/aggregates/CFRecordsAggregate.java index cd513e8683..bcf80e6189 100644 --- a/poi/src/main/java/org/apache/poi/hssf/record/aggregates/CFRecordsAggregate.java +++ b/poi/src/main/java/org/apache/poi/hssf/record/aggregates/CFRecordsAggregate.java @@ -209,6 +209,7 @@ public final class CFRecordsAggregate extends RecordAggregate implements Generic return GenericRecordJsonWriter.marshal(this); } + @Override public void visitContainedRecords(RecordVisitor rv) { rv.visitRecord(header); for (CFRuleBase rule : rules) { diff --git a/poi/src/main/java/org/apache/poi/hssf/record/aggregates/ChartSubstreamRecordAggregate.java b/poi/src/main/java/org/apache/poi/hssf/record/aggregates/ChartSubstreamRecordAggregate.java index 795a66389e..79820aae71 100644 --- a/poi/src/main/java/org/apache/poi/hssf/record/aggregates/ChartSubstreamRecordAggregate.java +++ b/poi/src/main/java/org/apache/poi/hssf/record/aggregates/ChartSubstreamRecordAggregate.java @@ -63,7 +63,8 @@ public final class ChartSubstreamRecordAggregate extends RecordAggregate { } } - public void visitContainedRecords(RecordVisitor rv) { + @Override + public void visitContainedRecords(RecordVisitor rv) { if (_recs.isEmpty()) { return; } diff --git a/poi/src/main/java/org/apache/poi/hssf/record/aggregates/ColumnInfoRecordsAggregate.java b/poi/src/main/java/org/apache/poi/hssf/record/aggregates/ColumnInfoRecordsAggregate.java index ab14e35e34..e7b85625fa 100644 --- a/poi/src/main/java/org/apache/poi/hssf/record/aggregates/ColumnInfoRecordsAggregate.java +++ b/poi/src/main/java/org/apache/poi/hssf/record/aggregates/ColumnInfoRecordsAggregate.java @@ -75,7 +75,7 @@ public final class ColumnInfoRecordsAggregate extends RecordAggregate implements /** * Inserts a column into the aggregate (at the position specified by - * <code>idx</code>. + * {@code idx}. */ private void insertColumn(int idx, ColumnInfoRecord col) { records.add(idx, col); @@ -85,6 +85,7 @@ public final class ColumnInfoRecordsAggregate extends RecordAggregate implements return records.size(); } + @Override public void visitContainedRecords(RecordVisitor rv) { int nItems = records.size(); if (nItems < 1) { @@ -147,7 +148,6 @@ public final class ColumnInfoRecordsAggregate extends RecordAggregate implements /** * 'Collapsed' state is stored in a single column col info record immediately after the outline group - * @param idx * @return true, if the column is collapsed, false otherwise. */ private boolean isColumnGroupCollapsed(int idx) { @@ -362,7 +362,7 @@ public final class ColumnInfoRecordsAggregate extends RecordAggregate implements } /** - * Sets all non null fields into the <code>ci</code> parameter. + * Sets all non null fields into the {@code ci} parameter. */ private static void setColumnInfoFields(ColumnInfoRecord ci, Short xfStyle, Integer width, Integer level, Boolean hidden, Boolean collapsed) { @@ -428,7 +428,7 @@ public final class ColumnInfoRecordsAggregate extends RecordAggregate implements } /** * merges two column info records (if they are adjacent and have the same formatting, etc) - * @return <code>false</code> if the two column records could not be merged + * @return {@code false} if the two column records could not be merged */ private static boolean mergeColInfoRecords(ColumnInfoRecord ciA, ColumnInfoRecord ciB) { if (ciA.isAdjacentBefore(ciB) && ciA.formatMatches(ciB)) { @@ -447,8 +447,8 @@ public final class ColumnInfoRecordsAggregate extends RecordAggregate implements * @param toColumnIx * group to this column (inclusive) * @param indent - * if <code>true</code> the group will be indented by one - * level, if <code>false</code> indenting will be decreased by + * if {@code true} the group will be indented by one + * level, if {@code false} indenting will be decreased by * one level. */ public void groupColumnRange(int fromColumnIx, int toColumnIx, boolean indent) { @@ -473,9 +473,9 @@ public final class ColumnInfoRecordsAggregate extends RecordAggregate implements } /** - * Finds the <tt>ColumnInfoRecord</tt> which contains the specified columnIndex + * Finds the {@code ColumnInfoRecord} which contains the specified columnIndex * @param columnIndex index of the column (not the index of the ColumnInfoRecord) - * @return <code>null</code> if no column info found for the specified column + * @return {@code null} if no column info found for the specified column */ public ColumnInfoRecord findColumnInfo(int columnIndex) { int nInfos = records.size(); diff --git a/poi/src/main/java/org/apache/poi/hssf/record/aggregates/ConditionalFormattingTable.java b/poi/src/main/java/org/apache/poi/hssf/record/aggregates/ConditionalFormattingTable.java index 2afbb3813d..466243c75c 100644 --- a/poi/src/main/java/org/apache/poi/hssf/record/aggregates/ConditionalFormattingTable.java +++ b/poi/src/main/java/org/apache/poi/hssf/record/aggregates/ConditionalFormattingTable.java @@ -43,7 +43,8 @@ public final class ConditionalFormattingTable extends RecordAggregate { } } - public void visitContainedRecords(RecordVisitor rv) { + @Override + public void visitContainedRecords(RecordVisitor rv) { for (CFRecordsAggregate subAgg : _cfHeaders) { subAgg.visitContainedRecords(rv); } diff --git a/poi/src/main/java/org/apache/poi/hssf/record/aggregates/CustomViewSettingsRecordAggregate.java b/poi/src/main/java/org/apache/poi/hssf/record/aggregates/CustomViewSettingsRecordAggregate.java index 40fe4dfc17..7aa5bd8e25 100644 --- a/poi/src/main/java/org/apache/poi/hssf/record/aggregates/CustomViewSettingsRecordAggregate.java +++ b/poi/src/main/java/org/apache/poi/hssf/record/aggregates/CustomViewSettingsRecordAggregate.java @@ -67,7 +67,8 @@ public final class CustomViewSettingsRecordAggregate extends RecordAggregate { } } - public void visitContainedRecords(RecordVisitor rv) { + @Override + public void visitContainedRecords(RecordVisitor rv) { if (_recs.isEmpty()) { return; } @@ -88,6 +89,6 @@ public final class CustomViewSettingsRecordAggregate extends RecordAggregate { } public void append(RecordBase r){ - _recs.add(r); + _recs.add(r); } } diff --git a/poi/src/main/java/org/apache/poi/hssf/record/aggregates/DataValidityTable.java b/poi/src/main/java/org/apache/poi/hssf/record/aggregates/DataValidityTable.java index e6ad8bb29d..d533a7bc91 100644 --- a/poi/src/main/java/org/apache/poi/hssf/record/aggregates/DataValidityTable.java +++ b/poi/src/main/java/org/apache/poi/hssf/record/aggregates/DataValidityTable.java @@ -51,7 +51,8 @@ public final class DataValidityTable extends RecordAggregate { _validationList = new ArrayList<>(); } - public void visitContainedRecords(RecordVisitor rv) { + @Override + public void visitContainedRecords(RecordVisitor rv) { if (_validationList.isEmpty()) { return; } diff --git a/poi/src/main/java/org/apache/poi/hssf/record/aggregates/FormulaRecordAggregate.java b/poi/src/main/java/org/apache/poi/hssf/record/aggregates/FormulaRecordAggregate.java index 62c3df3a05..200365ee43 100644 --- a/poi/src/main/java/org/apache/poi/hssf/record/aggregates/FormulaRecordAggregate.java +++ b/poi/src/main/java/org/apache/poi/hssf/record/aggregates/FormulaRecordAggregate.java @@ -140,7 +140,8 @@ public final class FormulaRecordAggregate extends RecordAggregate implements Cel return _formulaRecord.toString(); } - public void visitContainedRecords(RecordVisitor rv) { + @Override + public void visitContainedRecords(RecordVisitor rv) { rv.visitRecord(_formulaRecord); Record sharedFormulaRecord = _sharedValueManager.getRecordForFirstCell(this); if (sharedFormulaRecord != null) { diff --git a/poi/src/main/java/org/apache/poi/hssf/record/aggregates/MergedCellsTable.java b/poi/src/main/java/org/apache/poi/hssf/record/aggregates/MergedCellsTable.java index c698cb0d27..667f736c6c 100644 --- a/poi/src/main/java/org/apache/poi/hssf/record/aggregates/MergedCellsTable.java +++ b/poi/src/main/java/org/apache/poi/hssf/record/aggregates/MergedCellsTable.java @@ -53,6 +53,7 @@ public final class MergedCellsTable extends RecordAggregate { } } + @Override public int getRecordSize() { // a bit cheaper than the default impl int nRegions = _mergedRegions.size(); @@ -68,7 +69,8 @@ public final class MergedCellsTable extends RecordAggregate { + CellRangeAddressList.getEncodedSize(nLeftoverMergedRegions); } - public void visitContainedRecords(RecordVisitor rv) { + @Override + public void visitContainedRecords(RecordVisitor rv) { int nRegions = _mergedRegions.size(); if (nRegions < 1) { // no need to write a single empty MergeCellsRecord diff --git a/poi/src/main/java/org/apache/poi/hssf/record/aggregates/RecordAggregate.java b/poi/src/main/java/org/apache/poi/hssf/record/aggregates/RecordAggregate.java index c8103501ed..79148c175e 100644 --- a/poi/src/main/java/org/apache/poi/hssf/record/aggregates/RecordAggregate.java +++ b/poi/src/main/java/org/apache/poi/hssf/record/aggregates/RecordAggregate.java @@ -21,14 +21,14 @@ import org.apache.poi.hssf.record.Record; import org.apache.poi.hssf.record.RecordBase; /** - * <tt>RecordAggregate</tt>s are groups of of BIFF <tt>Record</tt>s that are typically stored + * {@code RecordAggregate}s are groups of of BIFF {@code Record}s that are typically stored * together and/or updated together. Workbook / Sheet records are typically stored in a sequential * list, which does not provide much structure to coordinate updates. */ public abstract class RecordAggregate extends RecordBase { /** - * Visit each of the atomic BIFF records contained in this {@link RecordAggregate} in the order + * Visit each of the atomic BIFF records contained in this RecordAggregate in the order * that they should be written to file. Implementors may or may not return the actual * {@link Record}s being used to manage POI's internal implementation. Callers should not * assume either way, and therefore only attempt to modify those {@link Record}s after cloning @@ -37,11 +37,13 @@ public abstract class RecordAggregate extends RecordBase { */ public abstract void visitContainedRecords(RecordVisitor rv); + @Override public final int serialize(int offset, byte[] data) { SerializingRecordVisitor srv = new SerializingRecordVisitor(data, offset); visitContainedRecords(srv); return srv.countBytesWritten(); } + @Override public int getRecordSize() { RecordSizingVisitor rsv = new RecordSizingVisitor(); visitContainedRecords(rsv); @@ -51,7 +53,7 @@ public abstract class RecordAggregate extends RecordBase { public interface RecordVisitor { /** * Implementors may call non-mutating methods on Record r. - * @param r must not be <code>null</code> + * @param r must not be {@code null} */ void visitRecord(org.apache.poi.hssf.record.Record r); } @@ -70,6 +72,7 @@ public abstract class RecordAggregate extends RecordBase { public int countBytesWritten() { return _countBytesWritten; } + @Override public void visitRecord(org.apache.poi.hssf.record.Record r) { int currentOffset = _startOffset + _countBytesWritten; _countBytesWritten += r.serialize(currentOffset, _data); @@ -85,6 +88,7 @@ public abstract class RecordAggregate extends RecordBase { public int getTotalSize() { return _totalSize; } + @Override public void visitRecord(org.apache.poi.hssf.record.Record r) { _totalSize += r.getRecordSize(); } @@ -101,6 +105,7 @@ public abstract class RecordAggregate extends RecordBase { _rv = rv; _position = initialPosition; } + @Override public void visitRecord(org.apache.poi.hssf.record.Record r) { _position += r.getRecordSize(); _rv.visitRecord(r); diff --git a/poi/src/main/java/org/apache/poi/hssf/record/aggregates/RowRecordsAggregate.java b/poi/src/main/java/org/apache/poi/hssf/record/aggregates/RowRecordsAggregate.java index 738d1d9b13..172ce0e7ea 100644 --- a/poi/src/main/java/org/apache/poi/hssf/record/aggregates/RowRecordsAggregate.java +++ b/poi/src/main/java/org/apache/poi/hssf/record/aggregates/RowRecordsAggregate.java @@ -42,11 +42,6 @@ import org.apache.poi.hssf.record.UnknownRecord; import org.apache.poi.ss.SpreadsheetVersion; import org.apache.poi.ss.formula.FormulaShifter; -/** - * - * @author andy - * @author Jason Height (jheight at chariot dot net dot au) - */ public final class RowRecordsAggregate extends RecordAggregate { private int _firstrow = -1; private int _lastrow = -1; diff --git a/poi/src/main/java/org/apache/poi/hssf/record/aggregates/SharedValueManager.java b/poi/src/main/java/org/apache/poi/hssf/record/aggregates/SharedValueManager.java index 03de03ebbd..9a635b566a 100644 --- a/poi/src/main/java/org/apache/poi/hssf/record/aggregates/SharedValueManager.java +++ b/poi/src/main/java/org/apache/poi/hssf/record/aggregates/SharedValueManager.java @@ -40,9 +40,6 @@ import org.apache.poi.ss.util.CellReference; * <li>{@link ArrayRecord}s</li> * <li>{@link TableRecord}s</li> * </ul> - * - * @author Josh Micich - * @author Vladimirs Abramovs(Vladimirs.Abramovs at exigenservices.com) - handling of ArrayRecords */ public final class SharedValueManager { @@ -100,7 +97,7 @@ public final class SharedValueManager { } /** - * @return a new empty {@link SharedValueManager}. + * @return a new empty SharedValueManager. */ public static SharedValueManager createEmpty() { // Note - must create distinct instances because they are assumed to be mutable. @@ -151,7 +148,7 @@ public final class SharedValueManager { /** * @param firstCell as extracted from the {@link ExpPtg} from the cell's formula. - * @return never <code>null</code> + * @return never {@code null} */ public SharedFormulaRecord linkSharedFormulaRecord(CellReference firstCell, FormulaRecordAggregate agg) { SharedFormulaGroup result = findFormulaGroupForCell(firstCell); @@ -186,7 +183,7 @@ public final class SharedValueManager { * top left cell. * * @return the SHRFMLA, TABLE or ARRAY record for the formula cell, if it is the first cell of - * a table or array region. <code>null</code> if the formula cell is not shared/array/table, + * a table or array region. {@code null} if the formula cell is not shared/array/table, * or if the specified formula is not the the first in the group. */ public SharedValueRecordBase getRecordForFirstCell(FormulaRecordAggregate agg) { @@ -231,7 +228,7 @@ public final class SharedValueManager { } /** - * Converts all {@link FormulaRecord}s handled by <tt>sharedFormulaRecord</tt> + * Converts all {@link FormulaRecord}s handled by {@code sharedFormulaRecord} * to plain unshared formulas */ public void unlink(SharedFormulaRecord sharedFormulaRecord) { @@ -254,7 +251,7 @@ public final class SharedValueManager { /** * Removes the {@link ArrayRecord} for the cell group containing the specified cell. * The caller should clear (set blank) all cells in the returned range. - * @return the range of the array formula which was just removed. Never <code>null</code>. + * @return the range of the array formula which was just removed. Never {@code null}. */ public CellRangeAddress8Bit removeArrayFormula(int rowIndex, int columnIndex) { for (ArrayRecord ar : _arrayRecords) { @@ -269,7 +266,7 @@ public final class SharedValueManager { } /** - * @return the shared ArrayRecord identified by (firstRow, firstColumn). never <code>null</code>. + * @return the shared ArrayRecord identified by (firstRow, firstColumn). never {@code null}. */ public ArrayRecord getArrayRecord(int firstRow, int firstColumn) { for(ArrayRecord ar : _arrayRecords) { diff --git a/poi/src/main/java/org/apache/poi/hssf/record/aggregates/ValueRecordsAggregate.java b/poi/src/main/java/org/apache/poi/hssf/record/aggregates/ValueRecordsAggregate.java index fff9cc9b37..573dd2e54f 100644 --- a/poi/src/main/java/org/apache/poi/hssf/record/aggregates/ValueRecordsAggregate.java +++ b/poi/src/main/java/org/apache/poi/hssf/record/aggregates/ValueRecordsAggregate.java @@ -37,10 +37,6 @@ import org.apache.poi.util.Removal; /** * * Aggregate value records together. Things are easier to handle that way. - * - * @author andy - * @author Glen Stampoultzis (glens at apache.org) - * @author Jason Height (jheight at chariot dot net dot au) */ public final class ValueRecordsAggregate implements Iterable<CellValueRecordInterface> { private static final int MAX_ROW_INDEX = 0XFFFF; diff --git a/poi/src/main/java/org/apache/poi/hssf/record/aggregates/WorksheetProtectionBlock.java b/poi/src/main/java/org/apache/poi/hssf/record/aggregates/WorksheetProtectionBlock.java index 9a1a6418db..995b6466ba 100644 --- a/poi/src/main/java/org/apache/poi/hssf/record/aggregates/WorksheetProtectionBlock.java +++ b/poi/src/main/java/org/apache/poi/hssf/record/aggregates/WorksheetProtectionBlock.java @@ -21,7 +21,6 @@ import org.apache.poi.hssf.model.RecordStream; 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.RecordFormatException; * * 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 WorksheetProtectionBlock extends RecordAggregate { } /** - * @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 WorksheetProtectionBlock extends RecordAggregate { } } - 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 WorksheetProtectionBlock extends RecordAggregate { } /** - * 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 WorksheetProtectionBlock extends RecordAggregate { * 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 */ diff --git a/poi/src/main/java/org/apache/poi/hssf/record/cont/ContinuableRecordOutput.java b/poi/src/main/java/org/apache/poi/hssf/record/cont/ContinuableRecordOutput.java index a39f1393e0..274ffe96d1 100644 --- a/poi/src/main/java/org/apache/poi/hssf/record/cont/ContinuableRecordOutput.java +++ b/poi/src/main/java/org/apache/poi/hssf/record/cont/ContinuableRecordOutput.java @@ -92,7 +92,7 @@ public final class ContinuableRecordOutput implements LittleEndianOutput { * 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 ContinuableRecordOutput implements LittleEndianOutput { * 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 ContinuableRecordOutput implements LittleEndianOutput { } } 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 ContinuableRecordOutput implements LittleEndianOutput { } } + @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 ContinuableRecordOutput implements LittleEndianOutput { } } + @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 ContinuableRecordOutput implements LittleEndianOutput { */ 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 } diff --git a/poi/src/main/java/org/apache/poi/hssf/record/crypto/Biff8DecryptingStream.java b/poi/src/main/java/org/apache/poi/hssf/record/crypto/Biff8DecryptingStream.java index b9a7638789..e04870b943 100644 --- a/poi/src/main/java/org/apache/poi/hssf/record/crypto/Biff8DecryptingStream.java +++ b/poi/src/main/java/org/apache/poi/hssf/record/crypto/Biff8DecryptingStream.java @@ -40,7 +40,7 @@ public final class Biff8DecryptingStream implements BiffHeaderInput, LittleEndia //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 implements BiffHeaderInput, LittleEndia 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 implements BiffHeaderInput, LittleEndia public int readUByte() { return readByte() & 0xFF; } - + @Override public byte readByte() { if (shouldSkipEncryptionOnCurrentRecord) { @@ -139,7 +139,7 @@ public final class Biff8DecryptingStream implements BiffHeaderInput, LittleEndia public int readUShort() { return readShort() & 0xFFFF; } - + @Override public short readShort() { if (shouldSkipEncryptionOnCurrentRecord) { @@ -176,11 +176,11 @@ public final class Biff8DecryptingStream implements BiffHeaderInput, LittleEndia 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) { diff --git a/poi/src/main/java/org/apache/poi/hssf/record/pivottable/ViewFieldsRecord.java b/poi/src/main/java/org/apache/poi/hssf/record/pivottable/ViewFieldsRecord.java index 7bbfbb68fb..2f5a6da67a 100644 --- a/poi/src/main/java/org/apache/poi/hssf/record/pivottable/ViewFieldsRecord.java +++ b/poi/src/main/java/org/apache/poi/hssf/record/pivottable/ViewFieldsRecord.java @@ -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 extends StandardRecord { COLUMN(2), PAGE(4), DATA(8); - int id; + final int id; Axis(int id) { this.id = id; } diff --git a/poi/src/main/java/org/apache/poi/hssf/usermodel/DVConstraint.java b/poi/src/main/java/org/apache/poi/hssf/usermodel/DVConstraint.java index 5317969278..a7fa156dbc 100644 --- a/poi/src/main/java/org/apache/poi/hssf/usermodel/DVConstraint.java +++ b/poi/src/main/java/org/apache/poi/hssf/usermodel/DVConstraint.java @@ -53,19 +53,19 @@ public class DVConstraint implements DataValidationConstraint { 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 DataValidationConstraint { _value2 = value2; _explicitListValues = (explicitListValues == null) ? null : explicitListValues.clone(); } - - + + /** * Creates a list constraint */ @@ -88,9 +88,9 @@ public class DVConstraint implements DataValidationConstraint { /** * 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 DataValidationConstraint { * @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 DataValidationConstraint { 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 DataValidationConstraint { 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 DataValidationConstraint { 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 DataValidationConstraint { 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 DataValidationConstraint { 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 DataValidationConstraint { /** - * @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 DataValidationConstraint { 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 DataValidationConstraint { } 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 DataValidationConstraint { /* (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 DataValidationConstraint { /* (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 DataValidationConstraint { /* (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 DataValidationConstraint { */ 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 DataValidationConstraint { */ 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 DataValidationConstraint { 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 DataValidationConstraint { 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()) { diff --git a/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFConditionalFormatting.java b/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFConditionalFormatting.java index 26bdd6bd95..37fb0d09e3 100644 --- a/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFConditionalFormatting.java +++ b/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFConditionalFormatting.java @@ -23,55 +23,45 @@ import org.apache.poi.ss.usermodel.ConditionalFormattingRule; 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 HSSFConditionalFormatting implements ConditionalFormatting { 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 HSSFConditionalFormatting implements ConditionalFormatting { } /** - * @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 HSSFConditionalFormatting implements ConditionalFormatting { } /** - * 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 HSSFConditionalFormatting implements ConditionalFormatting { } /** - * 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 */ diff --git a/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFSheetConditionalFormatting.java b/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFSheetConditionalFormatting.java index 436a7f5d1f..3f723de47f 100644 --- a/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFSheetConditionalFormatting.java +++ b/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFSheetConditionalFormatting.java @@ -31,7 +31,7 @@ import org.apache.poi.ss.usermodel.SheetConditionalFormatting; 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 HSSFSheetConditionalFormatting implements SheetConditionalFor * 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 HSSFSheetConditionalFormatting implements SheetConditionalFor * <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 HSSFSheetConditionalFormatting implements SheetConditionalFor return new HSSFConditionalFormattingRule(_sheet, rr); } + @Override public HSSFConditionalFormattingRule createConditionalFormattingRule( byte comparisonOperation, String formula1) { @@ -87,6 +89,7 @@ public final class HSSFSheetConditionalFormatting implements SheetConditionalFor * 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 HSSFSheetConditionalFormatting implements SheetConditionalFor * then * {@link HSSFIconMultiStateFormatting#getThresholds()} */ + @Override public HSSFConditionalFormattingRule createConditionalFormattingRule( IconSet iconSet) { CFRule12Record rr = CFRule12Record.create(_sheet, iconSet); @@ -121,6 +125,7 @@ public final class HSSFSheetConditionalFormatting implements SheetConditionalFor 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 HSSFSheetConditionalFormatting implements SheetConditionalFor * 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 HSSFSheetConditionalFormatting implements SheetConditionalFor return _conditionalFormattingTable.add(cfraClone); } + @Override public int addConditionalFormatting( ConditionalFormatting cf ) { return addConditionalFormatting((HSSFConditionalFormatting)cf); } @@ -194,6 +201,7 @@ public final class HSSFSheetConditionalFormatting implements SheetConditionalFor 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 HSSFSheetConditionalFormatting implements SheetConditionalFor ); } + @Override public int addConditionalFormatting(CellRangeAddress[] regions, ConditionalFormattingRule rule1) { return addConditionalFormatting(regions, (HSSFConditionalFormattingRule)rule1); @@ -224,6 +233,7 @@ public final class HSSFSheetConditionalFormatting implements SheetConditionalFor new HSSFConditionalFormattingRule[] { rule1, rule2 }); } + @Override public int addConditionalFormatting(CellRangeAddress[] regions, ConditionalFormattingRule rule1, ConditionalFormattingRule rule2) { @@ -240,6 +250,7 @@ public final class HSSFSheetConditionalFormatting implements SheetConditionalFor * 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 HSSFSheetConditionalFormatting implements SheetConditionalFor /** * @return number of Conditional Formatting objects of the sheet */ + @Override public int getNumConditionalFormattings() { return _conditionalFormattingTable.size(); } @@ -259,6 +271,7 @@ public final class HSSFSheetConditionalFormatting implements SheetConditionalFor * 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); } diff --git a/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java b/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java index bd86c2857f..dac56c030b 100644 --- a/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java +++ b/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java @@ -177,7 +177,7 @@ public final class HSSFWorkbook extends POIDocument implements Workbook { * 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 POIDocument implements Workbook { * 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 POIDocument implements Workbook { /** * 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 POIDocument implements Workbook { /** * 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 POIDocument implements Workbook { * 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 POIDocument implements Workbook { * 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 POIDocument implements Workbook { * 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 POIDocument implements Workbook { } /** - * 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 POIDocument implements Workbook { */ 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 POIDocument implements Workbook { * 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 diff --git a/poi/src/main/java/org/apache/poi/hssf/util/HSSFColor.java b/poi/src/main/java/org/apache/poi/hssf/util/HSSFColor.java index a7d53da928..de58ba380d 100644 --- a/poi/src/main/java/org/apache/poi/hssf/util/HSSFColor.java +++ b/poi/src/main/java/org/apache/poi/hssf/util/HSSFColor.java @@ -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 diff --git a/poi/src/main/java/org/apache/poi/poifs/dev/POIFSViewEngine.java b/poi/src/main/java/org/apache/poi/poifs/dev/POIFSViewEngine.java index 8db1bf3129..8eee26e13c 100644 --- a/poi/src/main/java/org/apache/poi/poifs/dev/POIFSViewEngine.java +++ b/poi/src/main/java/org/apache/poi/poifs/dev/POIFSViewEngine.java @@ -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 diff --git a/poi/src/main/java/org/apache/poi/poifs/dev/POIFSViewable.java b/poi/src/main/java/org/apache/poi/poifs/dev/POIFSViewable.java index 8349e66973..a74ecb1025 100644 --- a/poi/src/main/java/org/apache/poi/poifs/dev/POIFSViewable.java +++ b/poi/src/main/java/org/apache/poi/poifs/dev/POIFSViewable.java @@ -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 diff --git a/poi/src/main/java/org/apache/poi/poifs/dev/POIFSViewer.java b/poi/src/main/java/org/apache/poi/poifs/dev/POIFSViewer.java index 0be693444f..4fc8d7a49e 100644 --- a/poi/src/main/java/org/apache/poi/poifs/dev/POIFSViewer.java +++ b/poi/src/main/java/org/apache/poi/poifs/dev/POIFSViewer.java @@ -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.POIFSFileSystem; /** * A simple viewer for POIFS files - * - * @author Marc Johnson (mjohnson at apache dot org) */ public final class POIFSViewer { diff --git a/poi/src/main/java/org/apache/poi/poifs/eventfilesystem/POIFSReaderListener.java b/poi/src/main/java/org/apache/poi/poifs/eventfilesystem/POIFSReaderListener.java index 56a3b78479..e095b486f5 100644 --- a/poi/src/main/java/org/apache/poi/poifs/eventfilesystem/POIFSReaderListener.java +++ b/poi/src/main/java/org/apache/poi/poifs/eventfilesystem/POIFSReaderListener.java @@ -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 diff --git a/poi/src/main/java/org/apache/poi/poifs/eventfilesystem/POIFSReaderRegistry.java b/poi/src/main/java/org/apache/poi/poifs/eventfilesystem/POIFSReaderRegistry.java index 9ffac63120..2091eec512 100644 --- a/poi/src/main/java/org/apache/poi/poifs/eventfilesystem/POIFSReaderRegistry.java +++ b/poi/src/main/java/org/apache/poi/poifs/eventfilesystem/POIFSReaderRegistry.java @@ -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.POIFSDocumentPath; /** * 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 diff --git a/poi/src/main/java/org/apache/poi/poifs/filesystem/BATManaged.java b/poi/src/main/java/org/apache/poi/poifs/filesystem/BATManaged.java index fcd3bde649..dd0a6d679a 100644 --- a/poi/src/main/java/org/apache/poi/poifs/filesystem/BATManaged.java +++ b/poi/src/main/java/org/apache/poi/poifs/filesystem/BATManaged.java @@ -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 diff --git a/poi/src/main/java/org/apache/poi/poifs/filesystem/DirectoryEntry.java b/poi/src/main/java/org/apache/poi/poifs/filesystem/DirectoryEntry.java index 7148fda3cf..ed4f8c2bc5 100644 --- a/poi/src/main/java/org/apache/poi/poifs/filesystem/DirectoryEntry.java +++ b/poi/src/main/java/org/apache/poi/poifs/filesystem/DirectoryEntry.java @@ -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(); diff --git a/poi/src/main/java/org/apache/poi/poifs/filesystem/DocumentDescriptor.java b/poi/src/main/java/org/apache/poi/poifs/filesystem/DocumentDescriptor.java index 0c1b2c8177..b8d783638e 100644 --- a/poi/src/main/java/org/apache/poi/poifs/filesystem/DocumentDescriptor.java +++ b/poi/src/main/java/org/apache/poi/poifs/filesystem/DocumentDescriptor.java @@ -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 diff --git a/poi/src/main/java/org/apache/poi/poifs/filesystem/DocumentEntry.java b/poi/src/main/java/org/apache/poi/poifs/filesystem/DocumentEntry.java index 29f4b8afbf..dd1d9c21c9 100644 --- a/poi/src/main/java/org/apache/poi/poifs/filesystem/DocumentEntry.java +++ b/poi/src/main/java/org/apache/poi/poifs/filesystem/DocumentEntry.java @@ -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 diff --git a/poi/src/main/java/org/apache/poi/poifs/filesystem/Entry.java b/poi/src/main/java/org/apache/poi/poifs/filesystem/Entry.java index 2a8ea16aac..325c2a2738 100644 --- a/poi/src/main/java/org/apache/poi/poifs/filesystem/Entry.java +++ b/poi/src/main/java/org/apache/poi/poifs/filesystem/Entry.java @@ -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 diff --git a/poi/src/main/java/org/apache/poi/poifs/filesystem/EntryNode.java b/poi/src/main/java/org/apache/poi/poifs/filesystem/EntryNode.java index a48d8e4f9a..c8c9b39deb 100644 --- a/poi/src/main/java/org/apache/poi/poifs/filesystem/EntryNode.java +++ b/poi/src/main/java/org/apache/poi/poifs/filesystem/EntryNode.java @@ -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.Property; * appropriate * * Extending classes must override isDeleteOK() - * - * @author Marc Johnson (mjohnson at apache dot org) */ public abstract class EntryNode diff --git a/poi/src/main/java/org/apache/poi/poifs/filesystem/POIFSFileSystem.java b/poi/src/main/java/org/apache/poi/poifs/filesystem/POIFSFileSystem.java index 2fb09dc04d..7ac288a8a8 100644 --- a/poi/src/main/java/org/apache/poi/poifs/filesystem/POIFSFileSystem.java +++ b/poi/src/main/java/org/apache/poi/poifs/filesystem/POIFSFileSystem.java @@ -67,7 +67,7 @@ public class POIFSFileSystem extends BlockStore /** * 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 BlockStore } /** - * <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 BlockStore } /** - * <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 BlockStore } /** - * <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 BlockStore } /** - * <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 BlockStore } /** - * 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 BlockStore /** * @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 BlockStore } /** - * 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 diff --git a/poi/src/main/java/org/apache/poi/poifs/filesystem/POIFSWriterEvent.java b/poi/src/main/java/org/apache/poi/poifs/filesystem/POIFSWriterEvent.java index a3954c3720..5d08310202 100644 --- a/poi/src/main/java/org/apache/poi/poifs/filesystem/POIFSWriterEvent.java +++ b/poi/src/main/java/org/apache/poi/poifs/filesystem/POIFSWriterEvent.java @@ -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 diff --git a/poi/src/main/java/org/apache/poi/poifs/filesystem/POIFSWriterListener.java b/poi/src/main/java/org/apache/poi/poifs/filesystem/POIFSWriterListener.java index 9f9e396a11..0d57788283 100644 --- a/poi/src/main/java/org/apache/poi/poifs/filesystem/POIFSWriterListener.java +++ b/poi/src/main/java/org/apache/poi/poifs/filesystem/POIFSWriterListener.java @@ -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 diff --git a/poi/src/main/java/org/apache/poi/poifs/filesystem/TempFilePOIFSFileSystem.java b/poi/src/main/java/org/apache/poi/poifs/filesystem/TempFilePOIFSFileSystem.java index be162b6079..4bfb992d75 100644 --- a/poi/src/main/java/org/apache/poi/poifs/filesystem/TempFilePOIFSFileSystem.java +++ b/poi/src/main/java/org/apache/poi/poifs/filesystem/TempFilePOIFSFileSystem.java @@ -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 extends POIFSFileSystem { } } + @Override public void close() throws IOException { if (tempFile != null && tempFile.exists()) tempFile.delete(); super.close(); diff --git a/poi/src/main/java/org/apache/poi/poifs/macros/VBAMacroExtractor.java b/poi/src/main/java/org/apache/poi/poifs/macros/VBAMacroExtractor.java index 9874270a9d..c4ff962a94 100644 --- a/poi/src/main/java/org/apache/poi/poifs/macros/VBAMacroExtractor.java +++ b/poi/src/main/java/org/apache/poi/poifs/macros/VBAMacroExtractor.java @@ -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 diff --git a/poi/src/main/java/org/apache/poi/poifs/macros/VBAMacroReader.java b/poi/src/main/java/org/apache/poi/poifs/macros/VBAMacroReader.java index 2f28c6397e..76cfd66472 100644 --- a/poi/src/main/java/org/apache/poi/poifs/macros/VBAMacroReader.java +++ b/poi/src/main/java/org/apache/poi/poifs/macros/VBAMacroReader.java @@ -121,6 +121,7 @@ public class VBAMacroReader implements Closeable { 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 Closeable { 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 Closeable { } /** - * 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 Closeable { 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 Closeable { } /** - * 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 Closeable { /** * 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 Closeable { 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 Closeable { } /** - * 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 Closeable { * 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 { diff --git a/poi/src/main/java/org/apache/poi/poifs/property/Child.java b/poi/src/main/java/org/apache/poi/poifs/property/Child.java index 6047452149..340164911c 100644 --- a/poi/src/main/java/org/apache/poi/poifs/property/Child.java +++ b/poi/src/main/java/org/apache/poi/poifs/property/Child.java @@ -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 { diff --git a/poi/src/main/java/org/apache/poi/poifs/property/Property.java b/poi/src/main/java/org/apache/poi/poifs/property/Property.java index 6ffff00424..63f677c8ce 100644 --- a/poi/src/main/java/org/apache/poi/poifs/property/Property.java +++ b/poi/src/main/java/org/apache/poi/poifs/property/Property.java @@ -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 { diff --git a/poi/src/main/java/org/apache/poi/poifs/property/PropertyFactory.java b/poi/src/main/java/org/apache/poi/poifs/property/PropertyFactory.java index ba459050bf..469670b576 100644 --- a/poi/src/main/java/org/apache/poi/poifs/property/PropertyFactory.java +++ b/poi/src/main/java/org/apache/poi/poifs/property/PropertyFactory.java @@ -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.POIFSConstants; * 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; } } diff --git a/poi/src/main/java/org/apache/poi/poifs/storage/BlockWritable.java b/poi/src/main/java/org/apache/poi/poifs/storage/BlockWritable.java index 3bf833ec10..96f6d181c9 100644 --- a/poi/src/main/java/org/apache/poi/poifs/storage/BlockWritable.java +++ b/poi/src/main/java/org/apache/poi/poifs/storage/BlockWritable.java @@ -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 diff --git a/poi/src/main/java/org/apache/poi/poifs/storage/HeaderBlockConstants.java b/poi/src/main/java/org/apache/poi/poifs/storage/HeaderBlockConstants.java index 5470bde5b8..a029505ac3 100644 --- a/poi/src/main/java/org/apache/poi/poifs/storage/HeaderBlockConstants.java +++ b/poi/src/main/java/org/apache/poi/poifs/storage/HeaderBlockConstants.java @@ -22,8 +22,6 @@ import org.apache.poi.util.LittleEndianConsts; /** * 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; diff --git a/poi/src/main/java/org/apache/poi/sl/usermodel/ShapeContainer.java b/poi/src/main/java/org/apache/poi/sl/usermodel/ShapeContainer.java index 7706828c52..bd6b6e72c3 100644 --- a/poi/src/main/java/org/apache/poi/sl/usermodel/ShapeContainer.java +++ b/poi/src/main/java/org/apache/poi/sl/usermodel/ShapeContainer.java @@ -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 * diff --git a/poi/src/main/java/org/apache/poi/sl/usermodel/VerticalAlignment.java b/poi/src/main/java/org/apache/poi/sl/usermodel/VerticalAlignment.java index f302d8288f..1defe11f8e 100644 --- a/poi/src/main/java/org/apache/poi/sl/usermodel/VerticalAlignment.java +++ b/poi/src/main/java/org/apache/poi/sl/usermodel/VerticalAlignment.java @@ -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 { /** diff --git a/poi/src/main/java/org/apache/poi/ss/format/CellDateFormatter.java b/poi/src/main/java/org/apache/poi/ss/format/CellDateFormatter.java index 94a4f46710..b1d7f24431 100644 --- a/poi/src/main/java/org/apache/poi/ss/format/CellDateFormatter.java +++ b/poi/src/main/java/org/apache/poi/ss/format/CellDateFormatter.java @@ -162,7 +162,7 @@ public class CellDateFormatter extends CellFormatter { 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 CellFormatter { /** * {@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)) { diff --git a/poi/src/main/java/org/apache/poi/ss/format/CellElapsedFormatter.java b/poi/src/main/java/org/apache/poi/ss/format/CellElapsedFormatter.java index 4a5e370e86..b877f1db56 100644 --- a/poi/src/main/java/org/apache/poi/ss/format/CellElapsedFormatter.java +++ b/poi/src/main/java/org/apache/poi/ss/format/CellElapsedFormatter.java @@ -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 extends CellFormatter { // 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 extends CellFormatter { } } - /** {@inheritDoc} */ + @Override public void formatValue(StringBuffer toAppendTo, Object value) { double elapsed = ((Number) value).doubleValue(); @@ -208,8 +207,9 @@ public class CellElapsedFormatter extends CellFormatter { /** * {@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); } diff --git a/poi/src/main/java/org/apache/poi/ss/format/CellFormat.java b/poi/src/main/java/org/apache/poi/ss/format/CellFormat.java index 86a1dabf4f..66a8ea5c49 100644 --- a/poi/src/main/java/org/apache/poi/ss/format/CellFormat.java +++ b/poi/src/main/java/org/apache/poi/ss/format/CellFormat.java @@ -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) { diff --git a/poi/src/main/java/org/apache/poi/ss/format/CellFormatCondition.java b/poi/src/main/java/org/apache/poi/ss/format/CellFormatCondition.java index d44e18f4a7..b482d822d9 100644 --- a/poi/src/main/java/org/apache/poi/ss/format/CellFormatCondition.java +++ b/poi/src/main/java/org/apache/poi/ss/format/CellFormatCondition.java @@ -21,8 +21,6 @@ import java.util.Map; /** * This object represents a condition in a cell format. - * - * @author Ken Arnold, Industrious Media LLC */ public abstract class CellFormatCondition { private static final int LT = 0; @@ -69,36 +67,42 @@ public abstract class CellFormatCondition { switch (test) { case LT: return new CellFormatCondition() { + @Override public boolean pass(double value) { return value < c; } }; case LE: return new CellFormatCondition() { + @Override public boolean pass(double value) { return value <= c; } }; case GT: return new CellFormatCondition() { + @Override public boolean pass(double value) { return value > c; } }; case GE: return new CellFormatCondition() { + @Override public boolean pass(double value) { return value >= c; } }; case EQ: return new CellFormatCondition() { + @Override public boolean pass(double value) { return value == c; } }; case NE: return new CellFormatCondition() { + @Override public boolean pass(double value) { return value != c; } @@ -111,11 +115,11 @@ public abstract class CellFormatCondition { } /** - * Returns <tt>true</tt> if the given value passes the constraint's test. + * Returns {@code true} if the given value passes the constraint's test. * * @param value The value to compare against. * - * @return <tt>true</tt> if the given value passes the constraint's test. + * @return {@code true} if the given value passes the constraint's test. */ public abstract boolean pass(double value); }
\ No newline at end of file diff --git a/poi/src/main/java/org/apache/poi/ss/format/CellFormatPart.java b/poi/src/main/java/org/apache/poi/ss/format/CellFormatPart.java index 51f67df8b3..5aaec56b19 100644 --- a/poi/src/main/java/org/apache/poi/ss/format/CellFormatPart.java +++ b/poi/src/main/java/org/apache/poi/ss/format/CellFormatPart.java @@ -194,14 +194,14 @@ public class CellFormatPart { } /** - * Returns <tt>true</tt> if this format part applies to the given value. If + * Returns {@code true} if this format part applies to the given value. If * the value is a number and this is part has a condition, returns - * <tt>true</tt> only if the number passes the condition. Otherwise, this - * always return <tt>true</tt>. + * {@code true} only if the number passes the condition. Otherwise, this + * always return {@code true}. * * @param valueObject The value to evaluate. * - * @return <tt>true</tt> if this format part applies to the given value. + * @return {@code true} if this format part applies to the given value. */ public boolean applies(Object valueObject) { if (condition == null || !(valueObject instanceof Number)) { @@ -242,12 +242,12 @@ public class CellFormatPart { } /** - * Returns the color specification from the matcher, or <tt>null</tt> if + * Returns the color specification from the matcher, or {@code null} if * there is none. * * @param m The matcher for the format part. * - * @return The color specification or <tt>null</tt>. + * @return The color specification or {@code null}. */ private static Color getColor(Matcher m) { String cdesc = m.group(COLOR_GROUP); @@ -261,12 +261,12 @@ public class CellFormatPart { } /** - * Returns the condition specification from the matcher, or <tt>null</tt> if + * Returns the condition specification from the matcher, or {@code null} if * there is none. * * @param m The matcher for the format part. * - * @return The condition specification or <tt>null</tt>. + * @return The condition specification or {@code null}. */ private CellFormatCondition getCondition(Matcher m) { String mdesc = m.group(CONDITION_OPERATOR_GROUP); @@ -451,7 +451,7 @@ public class CellFormatPart { * @param label The label * @param value The value to apply this format part to. * - * @return <tt>true</tt> if the + * @return {@code true} if the */ public CellFormatResult apply(JLabel label, Object value) { CellFormatResult result = apply(value); @@ -473,9 +473,9 @@ public class CellFormatPart { } /** - * Returns <tt>true</tt> if this format part has a condition. + * Returns {@code true} if this format part has a condition. * - * @return <tt>true</tt> if this format part has a condition. + * @return {@code true} if this format part has a condition. */ boolean hasCondition() { return condition != null; @@ -566,13 +566,13 @@ public class CellFormatPart { } /** - * Returns the string from the group, or <tt>""</tt> if the group is - * <tt>null</tt>. + * Returns the string from the group, or {@code ""} if the group is + * {@code null}. * * @param m The matcher. * @param g The group number. * - * @return The group or <tt>""</tt>. + * @return The group or {@code ""}. */ public static String group(Matcher m, int g) { String str = m.group(g); diff --git a/poi/src/main/java/org/apache/poi/ss/format/CellFormatResult.java b/poi/src/main/java/org/apache/poi/ss/format/CellFormatResult.java index a22f77c277..f1a18d7b38 100644 --- a/poi/src/main/java/org/apache/poi/ss/format/CellFormatResult.java +++ b/poi/src/main/java/org/apache/poi/ss/format/CellFormatResult.java @@ -22,24 +22,23 @@ import java.awt.Color; * This object contains the result of applying a cell format or cell format part * to a value. * - * @author Ken Arnold, Industrious Media LLC * @see CellFormatPart#apply(Object) * @see CellFormat#apply(Object) */ public class CellFormatResult { /** - * This is <tt>true</tt> if no condition was given that applied to the + * This is {@code true} if no condition was given that applied to the * value, or if the condition is satisfied. If a condition is relevant, and - * when applied the value fails the test, this is <tt>false</tt>. + * when applied the value fails the test, this is {@code false}. */ public final boolean applies; - /** The resulting text. This will never be <tt>null</tt>. */ + /** The resulting text. This will never be {@code null}. */ public final String text; /** - * The color the format sets, or <tt>null</tt> if the format sets no color. - * This will always be <tt>null</tt> if {@link #applies} is <tt>false</tt>. + * The color the format sets, or {@code null} if the format sets no color. + * This will always be {@code null} if {@link #applies} is {@code false}. */ public final Color textColor; diff --git a/poi/src/main/java/org/apache/poi/ss/format/CellFormatType.java b/poi/src/main/java/org/apache/poi/ss/format/CellFormatType.java index af947b1db4..7693470afb 100644 --- a/poi/src/main/java/org/apache/poi/ss/format/CellFormatType.java +++ b/poi/src/main/java/org/apache/poi/ss/format/CellFormatType.java @@ -21,78 +21,91 @@ import java.util.Locale; /** * The different kinds of formats that the formatter understands. - * - * @author Ken Arnold, Industrious Media LLC */ public enum CellFormatType { - /** The general (default) format; also used for <tt>"General"</tt>. */ + /** The general (default) format; also used for {@code "General"}. */ GENERAL { + @Override boolean isSpecial(char ch) { return false; } + @Override CellFormatter formatter(String pattern) { return new CellGeneralFormatter(); } + @Override CellFormatter formatter(Locale locale, String pattern) { return new CellGeneralFormatter(locale); } }, /** A numeric format. */ NUMBER { + @Override boolean isSpecial(char ch) { return false; } + @Override CellFormatter formatter(String pattern) { return new CellNumberFormatter(pattern); } + @Override CellFormatter formatter(Locale locale, String pattern) { return new CellNumberFormatter(locale, pattern); } }, /** A date format. */ DATE { + @Override boolean isSpecial(char ch) { return ch == '\'' || (ch <= '\u007f' && Character.isLetter(ch)); } + @Override CellFormatter formatter(String pattern) { return new CellDateFormatter(pattern); } + @Override CellFormatter formatter(Locale locale, String pattern) { return new CellDateFormatter(locale, pattern); } }, /** An elapsed time format. */ ELAPSED { + @Override boolean isSpecial(char ch) { return false; } + @Override CellFormatter formatter(String pattern) { return new CellElapsedFormatter(pattern); } + @Override CellFormatter formatter(Locale locale, String pattern) { return new CellElapsedFormatter(pattern); } }, /** A text format. */ TEXT { + @Override boolean isSpecial(char ch) { return false; } + @Override CellFormatter formatter(String pattern) { return new CellTextFormatter(pattern); } + @Override CellFormatter formatter(Locale locale, String pattern) { return new CellTextFormatter(pattern); } }; /** - * Returns <tt>true</tt> if the format is special and needs to be quoted. + * Returns {@code true} if the format is special and needs to be quoted. * * @param ch The character to test. * - * @return <tt>true</tt> if the format is special and needs to be quoted. + * @return {@code true} if the format is special and needs to be quoted. */ abstract boolean isSpecial(char ch); diff --git a/poi/src/main/java/org/apache/poi/ss/format/CellGeneralFormatter.java b/poi/src/main/java/org/apache/poi/ss/format/CellGeneralFormatter.java index 2233c284aa..79fedf4539 100644 --- a/poi/src/main/java/org/apache/poi/ss/format/CellGeneralFormatter.java +++ b/poi/src/main/java/org/apache/poi/ss/format/CellGeneralFormatter.java @@ -23,8 +23,6 @@ import org.apache.poi.util.LocaleUtil; /** * A formatter for the default "General" cell format. - * - * @author Ken Arnold, Industrious Media LLC */ public class CellGeneralFormatter extends CellFormatter { /** Creates a new general formatter. */ diff --git a/poi/src/main/java/org/apache/poi/ss/format/CellNumberFormatter.java b/poi/src/main/java/org/apache/poi/ss/format/CellNumberFormatter.java index f25965af75..2da55efe90 100644 --- a/poi/src/main/java/org/apache/poi/ss/format/CellNumberFormatter.java +++ b/poi/src/main/java/org/apache/poi/ss/format/CellNumberFormatter.java @@ -79,6 +79,7 @@ public class CellNumberFormatter extends CellFormatter { super(locale, "General"); } + @Override public void formatValue(StringBuffer toAppendTo, Object value) { if (value == null) { return; @@ -95,6 +96,7 @@ public class CellNumberFormatter extends CellFormatter { cf.formatValue(toAppendTo, value); } + @Override public void simpleValue(StringBuffer toAppendTo, Object value) { formatValue(toAppendTo, value); } @@ -420,7 +422,7 @@ public class CellNumberFormatter extends CellFormatter { return (afterFractional == null) ? specials.size() : specials.indexOf(afterFractional); } - /** {@inheritDoc} */ + @Override public void formatValue(StringBuffer toAppendTo, Object valueObject) { double value = ((Number) valueObject).doubleValue(); value *= scale; @@ -842,9 +844,10 @@ public class CellNumberFormatter extends CellFormatter { /** * {@inheritDoc} * <p> - * For a number, this is <tt>"#"</tt> for integer values, and <tt>"#.#"</tt> + * For a number, this is {@code "#"} for integer values, and {@code "#.#"} * for floating-point values. */ + @Override public void simpleValue(StringBuffer toAppendTo, Object value) { SIMPLE_NUMBER.formatValue(toAppendTo, value); } diff --git a/poi/src/main/java/org/apache/poi/ss/format/CellNumberPartHandler.java b/poi/src/main/java/org/apache/poi/ss/format/CellNumberPartHandler.java index a9af31851f..a10aca3a28 100644 --- a/poi/src/main/java/org/apache/poi/ss/format/CellNumberPartHandler.java +++ b/poi/src/main/java/org/apache/poi/ss/format/CellNumberPartHandler.java @@ -39,6 +39,7 @@ public class CellNumberPartHandler implements PartHandler { private final List<Special> specials = new LinkedList<>(); private boolean improperFraction; + @Override public String handlePart(Matcher m, String part, CellFormatType type, StringBuffer descBuf) { int pos = descBuf.length(); char firstCh = part.charAt(0); @@ -148,7 +149,7 @@ public class CellNumberPartHandler implements PartHandler { } return null; } - + private static boolean isDigitFmt(Special s) { return s.ch == '0' || s.ch == '?' || s.ch == '#'; } diff --git a/poi/src/main/java/org/apache/poi/ss/format/CellTextFormatter.java b/poi/src/main/java/org/apache/poi/ss/format/CellTextFormatter.java index 3537520c46..f815407561 100644 --- a/poi/src/main/java/org/apache/poi/ss/format/CellTextFormatter.java +++ b/poi/src/main/java/org/apache/poi/ss/format/CellTextFormatter.java @@ -20,8 +20,6 @@ import java.util.Locale; /** * This class implements printing out text. - * - * @author Ken Arnold, Industrious Media LLC */ public class CellTextFormatter extends CellFormatter { private final int[] textPos; diff --git a/poi/src/main/java/org/apache/poi/ss/formula/CacheAreaEval.java b/poi/src/main/java/org/apache/poi/ss/formula/CacheAreaEval.java index 2716e24084..e8c8d5a0ac 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/CacheAreaEval.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/CacheAreaEval.java @@ -26,7 +26,6 @@ import org.apache.poi.ss.formula.ptg.AreaI.OffsetArea; import org.apache.poi.ss.util.CellReference; /** - * @author Robert Hulbert * Provides holding structure for temporary values in arrays during the evaluation process. * As such, Row/Column references do not actually correspond to data in the file. */ diff --git a/poi/src/main/java/org/apache/poi/ss/formula/EvaluationCache.java b/poi/src/main/java/org/apache/poi/ss/formula/EvaluationCache.java index 451ccc7ba3..be8c5a09ef 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/EvaluationCache.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/EvaluationCache.java @@ -32,8 +32,6 @@ import org.apache.poi.ss.usermodel.CellType; * Performance optimisation for {@link org.apache.poi.ss.usermodel.FormulaEvaluator}. * This class stores previously calculated values of already visited cells, * to avoid unnecessary re-calculation when the same cells are referenced multiple times - * - * @author Josh Micich */ final class EvaluationCache { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/EvaluationCell.java b/poi/src/main/java/org/apache/poi/ss/formula/EvaluationCell.java index ae983d11d8..5dafd4aec7 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/EvaluationCell.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/EvaluationCell.java @@ -19,15 +19,13 @@ package org.apache.poi.ss.formula; import org.apache.poi.ss.usermodel.CellType; import org.apache.poi.ss.util.CellRangeAddress; +import org.apache.poi.util.Internal; /** * Abstracts a cell for the purpose of formula evaluation. This interface represents both formula - * and non-formula cells.<br> - * - * For POI internal use only - * - * @author Josh Micich + * and non-formula cells. */ +@Internal public interface EvaluationCell { /** * @return an Object that identifies the underlying cell, diff --git a/poi/src/main/java/org/apache/poi/ss/formula/EvaluationName.java b/poi/src/main/java/org/apache/poi/ss/formula/EvaluationName.java index e43ab76c46..c7931069cc 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/EvaluationName.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/EvaluationName.java @@ -19,13 +19,12 @@ package org.apache.poi.ss.formula; import org.apache.poi.ss.formula.ptg.NamePtg; import org.apache.poi.ss.formula.ptg.Ptg; +import org.apache.poi.util.Internal; + /** - * Abstracts a name record for formula evaluation.<br> - * - * For POI internal use only - * - * @author Josh Micich + * Abstracts a name record for formula evaluation. */ +@Internal public interface EvaluationName { String getNameText(); diff --git a/poi/src/main/java/org/apache/poi/ss/formula/EvaluationSheet.java b/poi/src/main/java/org/apache/poi/ss/formula/EvaluationSheet.java index 881f00fafd..885ba81985 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/EvaluationSheet.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/EvaluationSheet.java @@ -20,11 +20,7 @@ package org.apache.poi.ss.formula; import org.apache.poi.util.Internal; /** - * Abstracts a sheet for the purpose of formula evaluation.<br> - * - * For POI internal use only - * - * @author Josh Micich + * Abstracts a sheet for the purpose of formula evaluation. */ @Internal public interface EvaluationSheet { @@ -33,22 +29,22 @@ public interface EvaluationSheet { * @return <code>null</code> if there is no cell at the specified coordinates */ EvaluationCell getCell(int rowIndex, int columnIndex); - + /** * Propagated from {@link EvaluationWorkbook#clearAllCachedResultValues()} to clear locally cached data. - * + * * @see WorkbookEvaluator#clearAllCachedResultValues() * @see EvaluationWorkbook#clearAllCachedResultValues() * @since POI 3.15 beta 3 */ public void clearAllCachedResultValues(); - + /** * @return last row index referenced on this sheet, for evaluation optimization * @since POI 4.0.0 */ public int getLastRowNum(); - + /** * Used by SUBTOTAL and similar functions that have options to ignore hidden rows * @param rowIndex diff --git a/poi/src/main/java/org/apache/poi/ss/formula/EvaluationTracker.java b/poi/src/main/java/org/apache/poi/ss/formula/EvaluationTracker.java index a69386389c..30b9a45469 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/EvaluationTracker.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/EvaluationTracker.java @@ -32,8 +32,6 @@ import org.apache.poi.ss.formula.eval.ValueEval; * The main purpose of this class is to detect an attempt to evaluate a cell * that is already being evaluated. In other words, it detects circular * references in spreadsheet formulas. - * - * @author Josh Micich */ final class EvaluationTracker { // TODO - consider deleting this class and letting CellEvaluationFrame take care of itself @@ -51,15 +49,15 @@ final class EvaluationTracker { * Notifies this evaluation tracker that evaluation of the specified cell is * about to start.<br> * - * In the case of a <code>true</code> return code, the caller should + * In the case of a {@code true} return code, the caller should * continue evaluation of the specified cell, and also be sure to call - * <tt>endEvaluate()</tt> when complete.<br> + * {@code endEvaluate()} when complete.<br> * - * In the case of a <code>null</code> return code, the caller should + * In the case of a {@code null} return code, the caller should * return an evaluation result of - * <tt>ErrorEval.CIRCULAR_REF_ERROR<tt>, and not call <tt>endEvaluate()</tt>. + * {@code ErrorEval.CIRCULAR_REF_ERROR}, and not call {@code endEvaluate()}. * <br> - * @return <code>false</code> if the specified cell is already being evaluated + * @return {@code false} if the specified cell is already being evaluated */ public boolean startEvaluate(FormulaCellCacheEntry cce) { if (cce == null) { @@ -96,7 +94,7 @@ final class EvaluationTracker { /** * Notifies this evaluation tracker that the evaluation of the specified cell is complete. <p> * - * Every successful call to <tt>startEvaluate</tt> must be followed by a call to <tt>endEvaluate</tt> (recommended in a finally block) to enable + * Every successful call to {@code startEvaluate} must be followed by a call to {@code endEvaluate} (recommended in a finally block) to enable * proper tracking of which cells are being evaluated at any point in time.<p> * * Assuming a well behaved client, parameters to this method would not be diff --git a/poi/src/main/java/org/apache/poi/ss/formula/EvaluationWorkbook.java b/poi/src/main/java/org/apache/poi/ss/formula/EvaluationWorkbook.java index 2a6aed0751..39a11e1259 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/EvaluationWorkbook.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/EvaluationWorkbook.java @@ -25,11 +25,7 @@ import org.apache.poi.ss.formula.udf.UDFFinder; import org.apache.poi.util.Internal; /** - * Abstracts a workbook for the purpose of formula evaluation.<br> - * - * For POI internal use only - * - * @author Josh Micich + * Abstracts a workbook for the purpose of formula evaluation. */ @Internal public interface EvaluationWorkbook { @@ -58,7 +54,7 @@ public interface EvaluationWorkbook { ExternalSheet getExternalSheet(String firstSheetName, String lastSheetName, int externalWorkbookNumber); /** * HSSF Only - convert an external sheet index to an internal sheet index, - * for an external-style reference to one of this workbook's own sheets + * for an external-style reference to one of this workbook's own sheets */ int convertFromExternSheetIndex(int externSheetIndex); @@ -70,19 +66,19 @@ public interface EvaluationWorkbook { * XSSF Only - fetch the external-style name details */ ExternalName getExternalName(String nameName, String sheetName, int externalWorkbookNumber); - + EvaluationName getName(NamePtg namePtg); EvaluationName getName(String name, int sheetIndex); String resolveNameXText(NameXPtg ptg); Ptg[] getFormulaTokens(EvaluationCell cell); UDFFinder getUDFFinder(); SpreadsheetVersion getSpreadsheetVersion(); - + /** * Propagated from {@link WorkbookEvaluator#clearAllCachedResultValues()} to clear locally cached data. * Implementations must call the same method on all referenced {@link EvaluationSheet} instances, as well as clearing local caches. * @see WorkbookEvaluator#clearAllCachedResultValues() - * + * * @since POI 3.15 beta 3 */ public void clearAllCachedResultValues(); @@ -108,7 +104,7 @@ public interface EvaluationWorkbook { super(workbookName, firstSheetName); this._lastSheetName = lastSheetName; } - + public String getFirstSheetName() { return getSheetName(); } diff --git a/poi/src/main/java/org/apache/poi/ss/formula/ExternSheetReferenceToken.java b/poi/src/main/java/org/apache/poi/ss/formula/ExternSheetReferenceToken.java index ce6bf0efdb..72adc88e2c 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/ExternSheetReferenceToken.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/ExternSheetReferenceToken.java @@ -21,8 +21,6 @@ package org.apache.poi.ss.formula; * Should be implemented by any {@link org.apache.poi.ss.formula.ptg.Ptg} subclass that needs has an extern sheet index <br> * * For POI internal use only - * - * @author Josh Micich */ public interface ExternSheetReferenceToken { int getExternSheetIndex(); diff --git a/poi/src/main/java/org/apache/poi/ss/formula/Formula.java b/poi/src/main/java/org/apache/poi/ss/formula/Formula.java index cc32a63ad4..05516e0953 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/Formula.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/Formula.java @@ -72,11 +72,11 @@ public class Formula implements GenericRecord { return read(encodedTokenLen, in, encodedTokenLen); } /** - * When there are no array constants present, <tt>encodedTokenLen</tt>==<tt>totalEncodedLen</tt> + * When there are no array constants present, {@code encodedTokenLen}=={@code totalEncodedLen} * @param encodedTokenLen number of bytes in the stream taken by the plain formula tokens * @param totalEncodedLen the total number of bytes in the formula (includes trailing encoding - * for array constants, but does not include 2 bytes for initial <tt>ushort encodedTokenLen</tt> field. - * @return A new formula object as read from the stream. Possibly empty, never <code>null</code>. + * for array constants, but does not include 2 bytes for initial {@code ushort encodedTokenLen} field. + * @return A new formula object as read from the stream. Possibly empty, never {@code null}. */ public static Formula read(int encodedTokenLen, LittleEndianInput in, int totalEncodedLen) { byte[] byteEncoding = IOUtils.safelyAllocate(totalEncodedLen, MAX_ENCODED_LEN); @@ -117,7 +117,7 @@ public class Formula implements GenericRecord { * <li>tokenData</li> * <li>arrayConstantData (optional)</li> * </ul> - * Note - this value is different to <tt>tokenDataLength</tt> + * Note - this value is different to {@code tokenDataLength} */ public int getEncodedSize() { return 2 + _byteEncoding.length; @@ -134,10 +134,10 @@ public class Formula implements GenericRecord { } /** - * Creates a {@link Formula} object from a supplied {@link Ptg} array. - * Handles <code>null</code>s OK. - * @param ptgs may be <code>null</code> - * @return Never <code>null</code> (Possibly empty if the supplied <tt>ptgs</tt> is <code>null</code>) + * Creates a Formula object from a supplied {@link Ptg} array. + * Handles {@code null}s OK. + * @param ptgs may be {@code null} + * @return Never {@code null} (Possibly empty if the supplied {@code ptgs} is {@code null}) */ public static Formula create(Ptg[] ptgs) { if (ptgs == null || ptgs.length < 1) { @@ -150,11 +150,11 @@ public class Formula implements GenericRecord { return new Formula(encodedData, encodedTokenLen); } /** - * Gets the {@link Ptg} array from the supplied {@link Formula}. - * Handles <code>null</code>s OK. + * Gets the {@link Ptg} array from the supplied Formula. + * Handles {@code null}s OK. * - * @param formula may be <code>null</code> - * @return possibly <code>null</code> (if the supplied <tt>formula</tt> is <code>null</code>) + * @param formula may be {@code null} + * @return possibly {@code null} (if the supplied {@code formula} is {@code null}) */ public static Ptg[] getTokens(Formula formula) { if (formula == null) { @@ -176,7 +176,7 @@ public class Formula implements GenericRecord { * The return value is usually not the same as the location of the cell containing this formula. * * @return the firstRow & firstColumn of an array formula or shared formula that this formula - * belongs to. <code>null</code> if this formula is not part of an array or shared formula. + * belongs to. {@code null} if this formula is not part of an array or shared formula. */ public CellReference getExpReference() { byte[] data = _byteEncoding; diff --git a/poi/src/main/java/org/apache/poi/ss/formula/FormulaCellCache.java b/poi/src/main/java/org/apache/poi/ss/formula/FormulaCellCache.java index fc097eb884..41317f934a 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/FormulaCellCache.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/FormulaCellCache.java @@ -21,10 +21,6 @@ import java.util.HashMap; import java.util.Iterator; import java.util.Map; -/** - * - * @author Josh Micich - */ final class FormulaCellCache { static interface IEntryOperation { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/FormulaCellCacheEntrySet.java b/poi/src/main/java/org/apache/poi/ss/formula/FormulaCellCacheEntrySet.java index 9a40cbc95e..aff5522755 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/FormulaCellCacheEntrySet.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/FormulaCellCacheEntrySet.java @@ -23,8 +23,6 @@ package org.apache.poi.ss.formula; * Profiling tests (Oct 2008) have shown that each element {@link FormulaCellCacheEntry} takes * around 32 bytes to store in a HashSet, but around 6 bytes to store here. For Spreadsheets with * thousands of formula cells with multiple interdependencies, the savings can be very significant. - * - * @author Josh Micich */ final class FormulaCellCacheEntrySet { private static final FormulaCellCacheEntry[] EMPTY_ARRAY = { }; diff --git a/poi/src/main/java/org/apache/poi/ss/formula/FormulaParseException.java b/poi/src/main/java/org/apache/poi/ss/formula/FormulaParseException.java index 4b1040f16d..fa8d4b8010 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/FormulaParseException.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/FormulaParseException.java @@ -22,8 +22,6 @@ package org.apache.poi.ss.formula; * supported by POI). It is primarily used by test code to confirm specific parsing exceptions. * Application code should also handle this exception if it potentially supplies formula text * that is not guaranteed to be well-formed. - * - * @author Josh Micich */ public final class FormulaParseException extends RuntimeException { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/FormulaParsingWorkbook.java b/poi/src/main/java/org/apache/poi/ss/formula/FormulaParsingWorkbook.java index 1d0c275b91..df79610b74 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/FormulaParsingWorkbook.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/FormulaParsingWorkbook.java @@ -28,15 +28,13 @@ import org.apache.poi.ss.util.CellReference; * Abstracts a workbook for the purpose of formula parsing.<br> * * For POI internal use only - * - * @author Josh Micich */ public interface FormulaParsingWorkbook { /** * named range name matching is case insensitive */ EvaluationName getName(String name, int sheetIndex); - + /** * Return the underlying workbook */ @@ -46,12 +44,12 @@ public interface FormulaParsingWorkbook { * XSSF Only - gets a table that exists in the worksheet */ Table getTable(String name); - + /** * Return an external name (named range, function, user-defined function) Ptg */ Ptg getNameXPtg(String name, SheetIdentifier sheet); - + /** * Produce the appropriate Ptg for a 3d cell reference */ diff --git a/poi/src/main/java/org/apache/poi/ss/formula/FormulaRenderer.java b/poi/src/main/java/org/apache/poi/ss/formula/FormulaRenderer.java index c247b1b61e..599d8fb6f5 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/FormulaRenderer.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/FormulaRenderer.java @@ -26,14 +26,12 @@ import org.apache.poi.ss.formula.ptg.MemFuncPtg; import org.apache.poi.ss.formula.ptg.OperationPtg; import org.apache.poi.ss.formula.ptg.ParenthesisPtg; import org.apache.poi.ss.formula.ptg.Ptg; +import org.apache.poi.util.Internal; /** - * Common logic for rendering formulas.<br> - * - * For POI internal use only - * - * @author Josh Micich + * Common logic for rendering formulas. */ +@Internal public class FormulaRenderer { /** diff --git a/poi/src/main/java/org/apache/poi/ss/formula/FormulaRenderingWorkbook.java b/poi/src/main/java/org/apache/poi/ss/formula/FormulaRenderingWorkbook.java index 94b791d31f..50c93a7531 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/FormulaRenderingWorkbook.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/FormulaRenderingWorkbook.java @@ -20,20 +20,18 @@ package org.apache.poi.ss.formula; import org.apache.poi.ss.formula.EvaluationWorkbook.ExternalSheet; import org.apache.poi.ss.formula.ptg.NamePtg; import org.apache.poi.ss.formula.ptg.NameXPtg; +import org.apache.poi.util.Internal; /** - * Abstracts a workbook for the purpose of converting formula to text.<br> - * - * For POI internal use only - * - * @author Josh Micich + * Abstracts a workbook for the purpose of converting formula to text. */ +@Internal public interface FormulaRenderingWorkbook { /** * @return <code>null</code> if externSheetIndex refers to a sheet inside the current workbook */ ExternalSheet getExternalSheet(int externSheetIndex); - + /** * @return the name of the (first) sheet referred to by the given external sheet index */ @@ -42,7 +40,7 @@ public interface FormulaRenderingWorkbook { * @return the name of the (last) sheet referred to by the given external sheet index */ String getSheetLastNameByExternSheet(int externSheetIndex); - + String resolveNameXText(NameXPtg nameXPtg); String getNameText(NamePtg namePtg); } diff --git a/poi/src/main/java/org/apache/poi/ss/formula/IEvaluationListener.java b/poi/src/main/java/org/apache/poi/ss/formula/IEvaluationListener.java index 6182a28cfd..a7e34fae86 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/IEvaluationListener.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/IEvaluationListener.java @@ -23,8 +23,6 @@ import org.apache.poi.ss.formula.eval.ValueEval; * Tests can implement this class to track the internal working of the {@link WorkbookEvaluator}.<br> * * For POI internal testing use only - * - * @author Josh Micich */ interface IEvaluationListener { /** diff --git a/poi/src/main/java/org/apache/poi/ss/formula/IStabilityClassifier.java b/poi/src/main/java/org/apache/poi/ss/formula/IStabilityClassifier.java index e4576a7c4d..7d1fbedad6 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/IStabilityClassifier.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/IStabilityClassifier.java @@ -22,7 +22,7 @@ package org.apache.poi.ss.formula; * parts of a workbook are <em>final</em>.<br> * The term <b>final</b> is introduced here to denote immutability or 'having constant definition'. * This classification refers to potential actions (on the evaluated workbook) by the evaluating - * application. It does not refer to operations performed by the evaluator ({@link + * application. It does not refer to operations performed by the evaluator ({@link * WorkbookEvaluator}).<br> * <br> * <b>General guidelines</b>: @@ -31,29 +31,27 @@ package org.apache.poi.ss.formula; * to {@link WorkbookEvaluator#evaluate(EvaluationCell)}. * </li> * <li>a formula cell can be marked as 'final' if its formula will not be changed after the first - * call to {@link WorkbookEvaluator#evaluate(EvaluationCell)}. This remains true even if changes + * call to {@link WorkbookEvaluator#evaluate(EvaluationCell)}. This remains true even if changes * in dependent values may cause the evaluated value to change.</li> * <li>plain value cells should be marked as 'not final' if their plain value value may change. - * </li> - * <li>formula cells should be marked as 'not final' if their formula definition may change.</li> + * </li> + * <li>formula cells should be marked as 'not final' if their formula definition may change.</li> * <li>cells which may switch between plain value and formula should also be marked as 'not final'. - * </li> + * </li> * </ul> * <b>Notes</b>: * <ul> * <li>If none of the spreadsheet cells is expected to have its definition changed after evaluation - * begins, every cell can be marked as 'final'. This is the most efficient / least resource + * begins, every cell can be marked as 'final'. This is the most efficient / least resource * intensive option.</li> * <li>To retain freedom to change any cell definition at any time, an application may classify all * cells as 'not final'. This freedom comes at the expense of greater memory consumption.</li> - * <li>For the purpose of these classifications, setting the cached formula result of a cell (for + * <li>For the purpose of these classifications, setting the cached formula result of a cell (for * example in {@link org.apache.poi.ss.usermodel.FormulaEvaluator#evaluateFormulaCell(org.apache.poi.ss.usermodel.Cell)}) * does not constitute changing the definition of the cell.</li> - * <li>Updating cells which have been classified as 'final' will cause the evaluator to behave - * unpredictably (typically ignoring the update).</li> + * <li>Updating cells which have been classified as 'final' will cause the evaluator to behave + * unpredictably (typically ignoring the update).</li> * </ul> - * - * @author Josh Micich */ public interface IStabilityClassifier { @@ -69,14 +67,14 @@ public interface IStabilityClassifier { /** * Checks if a cell's value(/formula) is fixed - in other words - not expected to be modified - * between calls to the evaluator. (Note - this is an independent concept from whether a + * between calls to the evaluator. (Note - this is an independent concept from whether a * formula cell's evaluated value may change during successive calls to the evaluator). - * + * * @param sheetIndex zero based index into workbook sheet list * @param rowIndex zero based row index of cell * @param columnIndex zero based column index of cell - * @return <code>false</code> if the evaluating application may need to modify the specified - * cell between calls to the evaluator. + * @return <code>false</code> if the evaluating application may need to modify the specified + * cell between calls to the evaluator. */ boolean isCellFinal(int sheetIndex, int rowIndex, int columnIndex); } diff --git a/poi/src/main/java/org/apache/poi/ss/formula/OperandClassTransformer.java b/poi/src/main/java/org/apache/poi/ss/formula/OperandClassTransformer.java index 341919af58..ce5e5b539c 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/OperandClassTransformer.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/OperandClassTransformer.java @@ -28,7 +28,6 @@ import org.apache.poi.ss.formula.ptg.Ptg; import org.apache.poi.ss.formula.ptg.RangePtg; import org.apache.poi.ss.formula.ptg.UnionPtg; import org.apache.poi.ss.formula.ptg.ValueOperatorPtg; -import org.apache.poi.util.Removal; /** * This class performs 'operand class' transformation. Non-base tokens are classified into three @@ -53,8 +52,6 @@ import org.apache.poi.util.Removal; * * Hopefully, as additional important test cases are identified and added to the test suite, * patterns might become more obvious in this code and allow for simplification. - * - * @author Josh Micich */ final class OperandClassTransformer { @@ -65,7 +62,7 @@ final class OperandClassTransformer { } /** - * Traverses the supplied formula parse tree, calling <tt>Ptg.setClass()</tt> for each non-base + * Traverses the supplied formula parse tree, calling {@code Ptg.setClass()} for each non-base * token to set its operand class. */ public void transformFormula(ParseNode rootNode) { @@ -90,7 +87,7 @@ final class OperandClassTransformer { } /** - * @param callerForceArrayFlag <code>true</code> if one of the current node's parents is a + * @param callerForceArrayFlag {@code true} if one of the current node's parents is a * function Ptg which has been changed from default 'V' to 'A' type (due to requirements on * the function return value). */ @@ -102,8 +99,8 @@ final class OperandClassTransformer { if (isSimpleValueFunc) { boolean localForceArray = desiredOperandClass == Ptg.CLASS_ARRAY; - for (int i = 0; i < children.length; i++) { - transformNode(children[i], desiredOperandClass, localForceArray); + for (ParseNode child : children) { + transformNode(child, desiredOperandClass, localForceArray); } setSimpleValueFuncClass((AbstractFunctionPtg) token, desiredOperandClass, callerForceArrayFlag); return; @@ -128,8 +125,8 @@ final class OperandClassTransformer { // All direct operands of value operators that are initially 'R' type will // be converted to 'V' type. byte localDesiredOperandClass = desiredOperandClass == Ptg.CLASS_REF ? Ptg.CLASS_VALUE : desiredOperandClass; - for (int i = 0; i < children.length; i++) { - transformNode(children[i], localDesiredOperandClass, callerForceArrayFlag); + for (ParseNode child : children) { + transformNode(child, localDesiredOperandClass, callerForceArrayFlag); } return; } diff --git a/poi/src/main/java/org/apache/poi/ss/formula/OperationEvaluationContext.java b/poi/src/main/java/org/apache/poi/ss/formula/OperationEvaluationContext.java index fcb1ccf9f2..9b6cda50c5 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/OperationEvaluationContext.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/OperationEvaluationContext.java @@ -152,7 +152,7 @@ public final class OperationEvaluationContext { } /** - * @return <code>null</code> if either workbook or sheet is not found + * @return {@code null} if either workbook or sheet is not found */ private SheetRefEvaluator createExternSheetRefEvaluator(String workbookName, String sheetName) { WorkbookEvaluator targetEvaluator; @@ -184,18 +184,18 @@ public final class OperationEvaluationContext { /** * Resolves a cell or area reference dynamically. - * @param workbookName the name of the workbook containing the reference. If <code>null</code> + * @param workbookName the name of the workbook containing the reference. If {@code null} * the current workbook is assumed. Note - to evaluate formulas which use multiple workbooks, * a {@link CollaboratingWorkbooksEnvironment} must be set up. - * @param sheetName the name of the sheet containing the reference. May be <code>null</code> - * (when <tt>workbookName</tt> is also null) in which case the current workbook and sheet is + * @param sheetName the name of the sheet containing the reference. May be {@code null} + * (when {@code workbookName} is also null) in which case the current workbook and sheet is * assumed. * @param refStrPart1 the single cell reference or first part of the area reference. Must not - * be <code>null</code>. + * be {@code null}. * @param refStrPart2 the second part of the area reference. For single cell references this - * parameter must be <code>null</code> - * @param isA1Style specifies the format for <tt>refStrPart1</tt> and <tt>refStrPart2</tt>. - * Pass <code>true</code> for 'A1' style and <code>false</code> for 'R1C1' style. + * parameter must be {@code null} + * @param isA1Style specifies the format for {@code refStrPart1} and {@code refStrPart2}. + * Pass {@code true} for 'A1' style and {@code false} for 'R1C1' style. * TODO - currently POI only supports 'A1' reference style * @return a {@link RefEval} or {@link AreaEval} */ diff --git a/poi/src/main/java/org/apache/poi/ss/formula/OperationEvaluatorFactory.java b/poi/src/main/java/org/apache/poi/ss/formula/OperationEvaluatorFactory.java index ca10b13075..542e026ad9 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/OperationEvaluatorFactory.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/OperationEvaluatorFactory.java @@ -57,10 +57,8 @@ import org.apache.poi.ss.formula.ptg.UnaryPlusPtg; import org.apache.poi.ss.util.CellRangeAddress; /** - * This class creates <tt>OperationEval</tt> instances to help evaluate <tt>OperationPtg</tt> + * This class creates {@code OperationEval} instances to help evaluate {@code OperationPtg} * formula tokens. - * - * @author Josh Micich */ final class OperationEvaluatorFactory { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/ParseNode.java b/poi/src/main/java/org/apache/poi/ss/formula/ParseNode.java index a41ec26346..d9f01cec1c 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/ParseNode.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/ParseNode.java @@ -25,16 +25,16 @@ import org.apache.poi.ss.formula.ptg.MemFuncPtg; import org.apache.poi.ss.formula.ptg.Ptg; import org.apache.poi.ss.formula.function.FunctionMetadataRegistry; /** - * Represents a syntactic element from a formula by encapsulating the corresponding <tt>Ptg</tt> - * token. Each <tt>ParseNode</tt> may have child <tt>ParseNode</tt>s in the case when the wrapped - * <tt>Ptg</tt> is non-atomic. + * Represents a syntactic element from a formula by encapsulating the corresponding {@code Ptg} + * token. Each {@code ParseNode} may have child {@code ParseNode}s in the case when the wrapped + * {@code Ptg} is non-atomic. */ final class ParseNode { public static final ParseNode[] EMPTY_ARRAY = { }; private final Ptg _token; private final ParseNode[] _children; - private boolean _isIf; + private final boolean _isIf; private final int _tokenCount; public ParseNode(Ptg token, ParseNode[] children) { @@ -45,8 +45,8 @@ final class ParseNode { _children = children.clone(); _isIf = isIf(token); int tokenCount = 1; - for (int i = 0; i < children.length; i++) { - tokenCount += children[i].getTokenCount(); + for (ParseNode child : children) { + tokenCount += child.getTokenCount(); } if (_isIf) { // there will be 2 or 3 extra tAttr tokens according to whether the false param is present @@ -68,14 +68,14 @@ final class ParseNode { } public int getEncodedSize() { int result = _token instanceof ArrayPtg ? ArrayPtg.PLAIN_TOKEN_SIZE : _token.getSize(); - for (int i = 0; i < _children.length; i++) { - result += _children[i].getEncodedSize(); + for (ParseNode child : _children) { + result += child.getEncodedSize(); } return result; } /** - * Collects the array of <tt>Ptg</tt> tokens for the specified tree. + * Collects the array of {@code Ptg} tokens for the specified tree. */ public static Ptg[] toTokenArray(ParseNode rootNode) { TokenCollector temp = new TokenCollector(rootNode.getTokenCount()); @@ -150,9 +150,7 @@ final class ParseNode { private static boolean isIf(Ptg token) { if (token instanceof FuncVarPtg) { FuncVarPtg func = (FuncVarPtg) token; - if (FunctionMetadataRegistry.FUNCTION_NAME_IF.equals(func.getName())) { - return true; - } + return FunctionMetadataRegistry.FUNCTION_NAME_IF.equals(func.getName()); } return false; } diff --git a/poi/src/main/java/org/apache/poi/ss/formula/PlainValueCellCacheEntry.java b/poi/src/main/java/org/apache/poi/ss/formula/PlainValueCellCacheEntry.java index 171b12e179..4b62110669 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/PlainValueCellCacheEntry.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/PlainValueCellCacheEntry.java @@ -21,8 +21,6 @@ import org.apache.poi.ss.formula.eval.ValueEval; /** * Used for non-formula cells, primarily to keep track of the referencing (formula) cells. - * - * @author Josh Micich */ final class PlainValueCellCacheEntry extends CellCacheEntry { public PlainValueCellCacheEntry(ValueEval value) { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/SheetNameFormatter.java b/poi/src/main/java/org/apache/poi/ss/formula/SheetNameFormatter.java index cff04f3249..8f92043a5e 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/SheetNameFormatter.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/SheetNameFormatter.java @@ -26,13 +26,11 @@ import org.apache.poi.ss.SpreadsheetVersion; /** * Formats sheet names for use in formula expressions. - * - * @author Josh Micich */ public final class SheetNameFormatter { - + private static final char DELIMITER = '\''; - + /** * Matches a single cell ref with no absolute ('$') markers */ @@ -44,8 +42,8 @@ public final class SheetNameFormatter { /** * Used to format sheet names as they would appear in cell formula expressions. * @return the sheet name unchanged if there is no need for delimiting. Otherwise the sheet - * name is enclosed in single quotes ('). Any single quotes which were already present in the - * sheet name will be converted to double single quotes (''). + * name is enclosed in single quotes ('). Any single quotes which were already present in the + * sheet name will be converted to double single quotes (''). */ public static String format(String rawSheetName) { StringBuilder sb = new StringBuilder((rawSheetName == null ? 0 : rawSheetName.length()) + 2); @@ -158,7 +156,7 @@ public final class SheetNameFormatter { } if(Character.isLetter(rawSheetName.charAt(0)) && Character.isDigit(rawSheetName.charAt(len-1))) { - // note - values like "A$1:$C$20" don't get this far + // note - values like "A$1:$C$20" don't get this far if(nameLooksLikePlainCellReference(rawSheetName)) { return true; } @@ -170,7 +168,7 @@ public final class SheetNameFormatter { // so they don't get this far return false; } - + private static boolean nameLooksLikeBooleanLiteral(String rawSheetName) { switch(rawSheetName.charAt(0)) { case 'T': case 't': @@ -182,8 +180,8 @@ public final class SheetNameFormatter { } /** - * @return <code>true</code> if the presence of the specified character in a sheet name would - * require the sheet name to be delimited in formulas. This includes every non-alphanumeric + * @return <code>true</code> if the presence of the specified character in a sheet name would + * require the sheet name to be delimited in formulas. This includes every non-alphanumeric * character besides underscore '_' and dot '.'. */ /* package */ static boolean isSpecialChar(char ch) { @@ -198,20 +196,20 @@ public final class SheetNameFormatter { case '\n': case '\r': case '\t': - throw new RuntimeException("Illegal character (0x" + throw new RuntimeException("Illegal character (0x" + Integer.toHexString(ch) + ") found in sheet name"); } return true; } - + /** - * Used to decide whether sheet names like 'AB123' need delimiting due to the fact that they + * Used to decide whether sheet names like 'AB123' need delimiting due to the fact that they * look like cell references. * <p> * This code is currently being used for translating formulas represented with <code>Ptg</code> - * tokens into human readable text form. In formula expressions, a sheet name always has a - * trailing '!' so there is little chance for ambiguity. It doesn't matter too much what this + * tokens into human readable text form. In formula expressions, a sheet name always has a + * trailing '!' so there is little chance for ambiguity. It doesn't matter too much what this * method returns but it is worth noting the likely consumers of these formula text strings: * <ol> * <li>POI's own formula parser</li> @@ -220,9 +218,9 @@ public final class SheetNameFormatter { * <li>Manual entry into Excel cell contents</li> * <li>Some third party formula parser</li> * </ol> - * + * * At the time of writing, POI's formula parser tolerates cell-like sheet names in formulas - * with or without delimiters. The same goes for Excel(2007), both manual and automated entry. + * with or without delimiters. The same goes for Excel(2007), both manual and automated entry. * <p> * For better or worse this implementation attempts to replicate Excel's formula renderer. * Excel uses range checking on the apparent 'row' and 'column' components. Note however that @@ -234,11 +232,11 @@ public final class SheetNameFormatter { } /** - * Note - this method assumes the specified rawSheetName has only letters and digits. It + * Note - this method assumes the specified rawSheetName has only letters and digits. It * cannot be used to match absolute or range references (using the dollar or colon char). * <p> * Some notable cases: - * <blockquote><table border="0" cellpadding="1" cellspacing="0" + * <blockquote><table border="0" cellpadding="1" cellspacing="0" * summary="Notable cases."> * <tr><th>Input </th><th>Result </th><th>Comments</th></tr> * <tr><td>"A1" </td><td>true</td><td> </td></tr> @@ -251,7 +249,7 @@ public final class SheetNameFormatter { * <tr><td>"SALES20080101" </td><td>true</td> * <td>Still needs delimiting even though well out of range</td></tr> * </table></blockquote> - * + * * @return <code>true</code> if there is any possible ambiguity that the specified rawSheetName * could be interpreted as a valid cell name. */ @@ -260,7 +258,7 @@ public final class SheetNameFormatter { if(!matcher.matches()) { return false; } - + // rawSheetName == "Sheet1" gets this far. String lettersPrefix = matcher.group(1); String numbersSuffix = matcher.group(2); diff --git a/poi/src/main/java/org/apache/poi/ss/formula/UserDefinedFunction.java b/poi/src/main/java/org/apache/poi/ss/formula/UserDefinedFunction.java index c526137554..70546b2d19 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/UserDefinedFunction.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/UserDefinedFunction.java @@ -24,10 +24,7 @@ import org.apache.poi.ss.formula.functions.FreeRefFunction; /** * * Common entry point for all user-defined (non-built-in) functions (where - * <tt>AbstractFunctionPtg.field_2_fnc_index</tt> == 255) - * - * @author Josh Micich - * @author Petr Udalau - Improved resolving of UDFs through the ToolPacks. + * {@code AbstractFunctionPtg.field_2_fnc_index} == 255) */ final class UserDefinedFunction implements FreeRefFunction { @@ -37,6 +34,7 @@ final class UserDefinedFunction implements FreeRefFunction { // enforce singleton } + @Override public ValueEval evaluate(ValueEval[] args, OperationEvaluationContext ec) { int nIncomingArgs = args.length; if(nIncomingArgs < 1) { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/WorkbookDependentFormula.java b/poi/src/main/java/org/apache/poi/ss/formula/WorkbookDependentFormula.java index 59bd2a1a80..acecc26bd9 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/WorkbookDependentFormula.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/WorkbookDependentFormula.java @@ -17,14 +17,12 @@ package org.apache.poi.ss.formula; +import org.apache.poi.util.Internal; + /** * Should be implemented by any {@link org.apache.poi.ss.formula.ptg.Ptg} subclass that needs a workbook to render its formula. - * <br> - * - * For POI internal use only - * - * @author Josh Micich */ +@Internal public interface WorkbookDependentFormula { String toFormulaString(FormulaRenderingWorkbook book); } diff --git a/poi/src/main/java/org/apache/poi/ss/formula/WorkbookEvaluator.java b/poi/src/main/java/org/apache/poi/ss/formula/WorkbookEvaluator.java index 8cb4cbf26b..2b278a9bc8 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/WorkbookEvaluator.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/WorkbookEvaluator.java @@ -45,20 +45,15 @@ import org.apache.poi.util.Internal; import static org.apache.logging.log4j.util.Unbox.box; /** - * Evaluates formula cells.<p/> + * Evaluates formula cells.<p> * * For performance reasons, this class keeps a cache of all previously calculated intermediate * cell values. Be sure to call {@link #clearAllCachedResultValues()} if any workbook cells are changed between - * calls to evaluate~ methods on this class.<br/> - * - * For POI internal use only - * - * @author Josh Micich - * @author Thies Wellpott (debug output enhancements) + * calls to evaluate~ methods on this class. */ @Internal public final class WorkbookEvaluator { - + private static final Logger LOG = LogManager.getLogger(WorkbookEvaluator.class); private final EvaluationWorkbook _workbook; @@ -86,7 +81,7 @@ public final class WorkbookEvaluator { private int dbgEvaluationOutputIndent = -1; /** - * @param udfFinder pass <code>null</code> for default (AnalysisToolPak only) + * @param udfFinder pass {@code null} for default (AnalysisToolPak only) */ public WorkbookEvaluator(EvaluationWorkbook workbook, IStabilityClassifier stabilityClassifier, UDFFinder udfFinder) { this (workbook, null, stabilityClassifier, udfFinder); @@ -120,7 +115,7 @@ public final class WorkbookEvaluator { /* package */ EvaluationSheet getSheet(int sheetIndex) { return _workbook.getSheet(sheetIndex); } - + /* package */ EvaluationWorkbook getWorkbook() { return _workbook; } @@ -185,7 +180,7 @@ public final class WorkbookEvaluator { int sheetIndex = getSheetIndex(cell.getSheet()); _cache.notifyDeleteCell(_workbookIx, sheetIndex, cell); } - + private int getSheetIndex(EvaluationSheet sheet) { Integer result = _sheetIndexesBySheet.get(sheet); if (result == null) { @@ -193,10 +188,10 @@ public final class WorkbookEvaluator { if (sheetIndex < 0) { throw new RuntimeException("Specified sheet from a different book"); } - result = Integer.valueOf(sheetIndex); + result = sheetIndex; _sheetIndexesBySheet.put(sheet, result); } - return result.intValue(); + return result; } public ValueEval evaluate(EvaluationCell srcCell) { @@ -215,19 +210,19 @@ public final class WorkbookEvaluator { if (sheetIndex < 0) { return -1; } - result = Integer.valueOf(sheetIndex); + result = sheetIndex; _sheetIndexesByName.put(sheetName, result); } - return result.intValue(); + return result; } - + /* package */ int getSheetIndexByExternIndex(int externSheetIndex) { return _workbook.convertFromExternSheetIndex(externSheetIndex); } /** - * @return never <code>null</code>, never {@link BlankEval} + * @return never {@code null}, never {@link BlankEval} */ private ValueEval evaluateAny(EvaluationCell srcCell, int sheetIndex, int rowIndex, int columnIndex, EvaluationTracker tracker) { @@ -339,8 +334,8 @@ public final class WorkbookEvaluator { } /** * Gets the value from a non-formula cell. - * @param cell may be <code>null</code> - * @return {@link BlankEval} if cell is <code>null</code> or blank, never <code>null</code> + * @param cell may be {@code null} + * @return {@link BlankEval} if cell is {@code null} or blank, never {@code null} */ /* package */ static ValueEval getValueFromNonFormulaCell(EvaluationCell cell) { if (cell == null) { @@ -361,7 +356,7 @@ public final class WorkbookEvaluator { default: throw new RuntimeException("Unexpected cell type (" + cellType + ")"); } - + } @@ -518,7 +513,7 @@ public final class WorkbookEvaluator { FuncVarPtg f = (FuncVarPtg)ptgs[ii]; try { Function func = FunctionEval.getBasicFunction(f.getFunctionIndex()); - if (func != null && func instanceof ArrayMode) { + if (func instanceof ArrayMode) { arrayMode = true; } } catch (NotImplementedException ne){ @@ -552,9 +547,9 @@ public final class WorkbookEvaluator { if (!stack.isEmpty()) { throw new IllegalStateException("evaluation stack not empty"); } - + ValueEval result; - + if (ec.isSingleValue()) { result = dereferenceResult(value, ec); } @@ -577,32 +572,32 @@ public final class WorkbookEvaluator { /** * Calculates the number of tokens that the evaluator should skip upon reaching a tAttrSkip. * - * @return the number of tokens (starting from <tt>startIndex+1</tt>) that need to be skipped - * to achieve the specified <tt>distInBytes</tt> skip distance. + * @return the number of tokens (starting from {@code startIndex+1}) that need to be skipped + * to achieve the specified {@code distInBytes} skip distance. */ private static int countTokensToBeSkipped(Ptg[] ptgs, int startIndex, int distInBytes) { int remBytes = distInBytes; int index = startIndex; while (remBytes != 0) { index++; + if (index >= ptgs.length) { + throw new RuntimeException("Skip distance too far (ran out of formula tokens)."); + } remBytes -= ptgs[index].getSize(); if (remBytes < 0) { throw new RuntimeException("Bad skip distance (wrong token size calculation)."); } - if (index >= ptgs.length) { - throw new RuntimeException("Skip distance too far (ran out of formula tokens)."); - } } return index-startIndex; } - + /** * Dereferences a single value from any AreaEval or RefEval evaluation * result. If the supplied evaluationResult is just a plain value, it is * returned as-is. * * @return a {@link NumberEval}, {@link StringEval}, {@link BoolEval}, or - * {@link ErrorEval}. Never <code>null</code>. {@link BlankEval} is + * {@link ErrorEval}. Never {@code null}. {@link BlankEval} is * converted to {@link NumberEval#ZERO} */ private static ValueEval dereferenceResult(ValueEval evaluationResult, OperationEvaluationContext ec) { @@ -617,7 +612,7 @@ public final class WorkbookEvaluator { EvaluationSheet evalSheet = ec.getWorkbook().getSheet(ec.getSheetIndex()); EvaluationCell evalCell = evalSheet.getCell(ec.getRowIndex(), ec.getColumnIndex()); - + if (evalCell != null && evalCell.isPartOfArrayFormulaGroup() && evaluationResult instanceof AreaEval) { value = OperandResolver.getElementFromArray((AreaEval) evaluationResult, evalCell); } @@ -630,7 +625,7 @@ public final class WorkbookEvaluator { // Formulas _never_ evaluate to blank. If a formula appears to have evaluated to // blank, the actual value is empty string. This can be verified with ISBLANK(). } - + return value; } @@ -640,7 +635,7 @@ public final class WorkbookEvaluator { * returned as-is. * * @return a {@link NumberEval}, {@link StringEval}, {@link BoolEval}, or - * {@link ErrorEval}. Never <code>null</code>. {@link BlankEval} is + * {@link ErrorEval}. Never {@code null}. {@link BlankEval} is * converted to {@link NumberEval#ZERO} */ public static ValueEval dereferenceResult(ValueEval evaluationResult, int srcRowNum, int srcColNum) { @@ -663,8 +658,9 @@ public final class WorkbookEvaluator { /** * returns an appropriate Eval impl instance for the Ptg. The Ptg must be * one of: Area3DPtg, AreaPtg, ReferencePtg, Ref3DPtg, IntPtg, NumberPtg, - * StringPtg, BoolPtg <br/>special Note: OperationPtg subtypes cannot be - * passed here! + * StringPtg, BoolPtg<p> + * + * special Note: OperationPtg subtypes cannot be passed here! */ private ValueEval getEvalForPtg(Ptg ptg, OperationEvaluationContext ec) { // consider converting all these (ptg instanceof XxxPtg) expressions to (ptg.getClass() == XxxPtg.class) @@ -726,7 +722,7 @@ public final class WorkbookEvaluator { AreaPtg aptg = (AreaPtg) ptg; return ec.getAreaEval(aptg.getFirstRow(), aptg.getFirstColumn(), aptg.getLastRow(), aptg.getLastColumn()); } - + if (ptg instanceof ArrayPtg) { ArrayPtg aptg = (ArrayPtg) ptg; return ec.getAreaValueEval(0, 0, aptg.getRowCount() - 1, aptg.getColumnCount() - 1, aptg.getTokenArrayValues()); @@ -746,7 +742,7 @@ public final class WorkbookEvaluator { throw new RuntimeException("Unexpected ptg class (" + ptg.getClass().getName() + ")"); } - + private ValueEval processNameEval(ValueEval eval, OperationEvaluationContext ec) { if (eval instanceof ExternalNameEval) { EvaluationName name = ((ExternalNameEval)eval).getName(); @@ -754,7 +750,7 @@ public final class WorkbookEvaluator { } return eval; } - + private ValueEval getEvalForNameRecord(EvaluationName nameRecord, OperationEvaluationContext ec) { if (nameRecord.isFunctionName()) { return new FunctionNameEval(nameRecord.getNameText()); @@ -765,7 +761,7 @@ public final class WorkbookEvaluator { throw new RuntimeException("Don't know how to evaluate name '" + nameRecord.getNameText() + "'"); } - + /** * YK: Used by OperationEvaluationContext to resolve indirect names. */ @@ -773,7 +769,7 @@ public final class WorkbookEvaluator { if (ptgs.length == 1 && !(ptgs[0] instanceof FuncVarPtg)) { return getEvalForPtg(ptgs[0], ec); } - + OperationEvaluationContext anyValueContext = new OperationEvaluationContext(this, ec.getWorkbook(), ec.getSheetIndex(), ec.getRowIndex(), ec.getColumnIndex(), new EvaluationTracker(_cache), false); return evaluateFormula(anyValueContext, ptgs); } @@ -794,7 +790,7 @@ public final class WorkbookEvaluator { /** * Evaluate a formula outside a cell value, e.g. conditional format rules or data validation expressions - * + * * @param formula to evaluate * @param ref defines the optional sheet and row/column base for the formula, if it is relative * @return value @@ -810,17 +806,17 @@ public final class WorkbookEvaluator { int rowIndex = ref == null ? -1 : ref.getRow(); short colIndex = ref == null ? -1 : ref.getCol(); final OperationEvaluationContext ec = new OperationEvaluationContext( - this, - getWorkbook(), - sheetIndex, - rowIndex, - colIndex, + this, + getWorkbook(), + sheetIndex, + rowIndex, + colIndex, new EvaluationTracker(_cache) ); Ptg[] ptgs = FormulaParser.parse(formula, (FormulaParsingWorkbook) getWorkbook(), FormulaType.CELL, sheetIndex, rowIndex); return evaluateNameFormula(ptgs, ec); } - + /** * Some expressions need to be evaluated in terms of an offset from the top left corner of a region, * such as some data validation and conditional format expressions, when those constraints apply @@ -828,7 +824,7 @@ public final class WorkbookEvaluator { * offset position relative to the top left of the range. * <p> * Returns a single value e.g. a cell formula result or boolean value for conditional formatting. - * + * * @param formula The formula to evaluate * @param target cell context for the operation * @param region containing the cell @@ -838,7 +834,7 @@ public final class WorkbookEvaluator { public ValueEval evaluate(String formula, CellReference target, CellRangeAddressBase region) { return evaluate(formula, target, region, FormulaType.CELL); } - + /** * Some expressions need to be evaluated in terms of an offset from the top left corner of a region, * such as some data validation and conditional format expressions, when those constraints apply @@ -856,28 +852,29 @@ public final class WorkbookEvaluator { public ValueEval evaluateList(String formula, CellReference target, CellRangeAddressBase region) { return evaluate(formula, target, region, FormulaType.DATAVALIDATION_LIST); } - + private ValueEval evaluate(String formula, CellReference target, CellRangeAddressBase region, FormulaType formulaType) { final String sheetName = target == null ? null : target.getSheetName(); if (sheetName == null) throw new IllegalArgumentException("Sheet name is required"); - + final int sheetIndex = getWorkbook().getSheetIndex(sheetName); Ptg[] ptgs = FormulaParser.parse(formula, (FormulaParsingWorkbook) getWorkbook(), formulaType, sheetIndex, target.getRow()); adjustRegionRelativeReference(ptgs, target, region); - + final OperationEvaluationContext ec = new OperationEvaluationContext(this, getWorkbook(), sheetIndex, target.getRow(), target.getCol(), new EvaluationTracker(_cache), formulaType.isSingleValue()); return evaluateNameFormula(ptgs, ec); } - + /** * Adjust formula relative references by the offset between the start of the given region and the given target cell. * That is, treat the region top-left cell as "A1" for the purposes of evaluating relative reference components (row and/or column), - * and further move references by the position of the target within the region. - * <p><pre>formula ref + range top-left + current cell range offset </pre></p> + * and further move references by the position of the target within the region.<p> + * + * {@code formula ref + range top-left + current cell range offset} * which simplifies to - * <p><pre>formula ref + current cell ref</pre></p> - * @param ptgs + * {@code formula ref + current cell ref} + * * @param target cell within the region to use. * @param region containing the cell, OR, for conditional format rules with multiple ranges, the region with the top-left-most cell * @return true if any Ptg references were shifted @@ -886,10 +883,10 @@ public final class WorkbookEvaluator { */ protected boolean adjustRegionRelativeReference(Ptg[] ptgs, CellReference target, CellRangeAddressBase region) { // region may not be the one that contains the target, if a conditional formatting rule applies to multiple regions - + int deltaRow = target.getRow() - region.getFirstRow(); int deltaColumn = target.getCol() - region.getFirstColumn(); - + boolean shifted = false; for (Ptg ptg : ptgs) { // base class for cell reference "things" @@ -917,7 +914,7 @@ public final class WorkbookEvaluator { } return shifted; } - + /** * Whether to ignore missing references to external workbooks and * use cached formula results in the main workbook instead. diff --git a/poi/src/main/java/org/apache/poi/ss/formula/atp/ArgumentsEvaluator.java b/poi/src/main/java/org/apache/poi/ss/formula/atp/ArgumentsEvaluator.java index 0c3f537dd6..00680a8183 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/atp/ArgumentsEvaluator.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/atp/ArgumentsEvaluator.java @@ -31,8 +31,6 @@ import org.apache.poi.ss.util.DateParser; /** * Evaluator for formula arguments. - * - * @author jfaenomoto@gmail.com */ final class ArgumentsEvaluator { @@ -44,7 +42,7 @@ final class ArgumentsEvaluator { /** * Evaluate a generic {@link ValueEval} argument to a double value that represents a date in POI. - * + * * @param arg {@link ValueEval} an argument. * @param srcCellRow number cell row. * @param srcCellCol number cell column. @@ -68,7 +66,7 @@ final class ArgumentsEvaluator { /** * Evaluate a generic {@link ValueEval} argument to an array of double values that represents dates in POI. - * + * * @param arg {@link ValueEval} an argument. * @param srcCellRow number cell row. * @param srcCellCol number cell column. @@ -103,7 +101,7 @@ final class ArgumentsEvaluator { /** * Evaluate a generic {@link ValueEval} argument to a double value. - * + * * @param arg {@link ValueEval} an argument. * @param srcCellRow number cell row. * @param srcCellCol number cell column. diff --git a/poi/src/main/java/org/apache/poi/ss/formula/atp/IfError.java b/poi/src/main/java/org/apache/poi/ss/formula/atp/IfError.java index 9e405e3c23..d500d81807 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/atp/IfError.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/atp/IfError.java @@ -27,11 +27,9 @@ import org.apache.poi.ss.formula.functions.FreeRefFunction; * Implementation of 'Analysis Toolpak' Excel function IFERROR()<br> * * Returns an error text if there is an error in the evaluation<p> - * + * * <b>Syntax</b><br> * <b>IFERROR</b>(<b>expression</b>, <b>string</b>) - * - * @author Johan Karlsteen */ final class IfError implements FreeRefFunction { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/atp/MRound.java b/poi/src/main/java/org/apache/poi/ss/formula/atp/MRound.java index 73f5ab320b..f1e6227a9b 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/atp/MRound.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/atp/MRound.java @@ -29,10 +29,6 @@ import org.apache.poi.ss.formula.functions.NumericFunction; * * <b>Syntax</b><br> * <b>MROUND</b>(<b>number</b>, <b>multiple</b>) - * - * <p> - * - * @author Yegor Kozlov */ final class MRound implements FreeRefFunction { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/atp/NetworkdaysFunction.java b/poi/src/main/java/org/apache/poi/ss/formula/atp/NetworkdaysFunction.java index e01ba84793..da57eef5e1 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/atp/NetworkdaysFunction.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/atp/NetworkdaysFunction.java @@ -33,8 +33,6 @@ import org.apache.poi.ss.formula.functions.FreeRefFunction; * <b>Syntax</b><br> * <b>NETWORKDAYS</b>(<b>startDate</b>, <b>endDate</b>, holidays) * <p> - * - * @author jfaenomoto@gmail.com */ final class NetworkdaysFunction implements FreeRefFunction { @@ -44,7 +42,7 @@ final class NetworkdaysFunction implements FreeRefFunction { /** * Constructor. - * + * * @param anEvaluator an injected {@link ArgumentsEvaluator}. */ private NetworkdaysFunction(ArgumentsEvaluator anEvaluator) { @@ -55,7 +53,7 @@ final class NetworkdaysFunction implements FreeRefFunction { /** * Evaluate for NETWORKDAYS. Given two dates and a optional date or interval of holidays, determines how many working days are there * between those dates. - * + * * @return {@link ValueEval} for the number of days between two dates. */ public ValueEval evaluate(ValueEval[] args, OperationEvaluationContext ec) { // NOSONAR diff --git a/poi/src/main/java/org/apache/poi/ss/formula/atp/ParityFunction.java b/poi/src/main/java/org/apache/poi/ss/formula/atp/ParityFunction.java index b59b4808b5..e01b07eb46 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/atp/ParityFunction.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/atp/ParityFunction.java @@ -26,8 +26,6 @@ import org.apache.poi.ss.formula.functions.FreeRefFunction; import org.apache.poi.ss.formula.OperationEvaluationContext; /** * Implementation of Excel 'Analysis ToolPak' function ISEVEN() ISODD()<br> - * - * @author Josh Micich */ final class ParityFunction implements FreeRefFunction { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/atp/RandBetween.java b/poi/src/main/java/org/apache/poi/ss/formula/atp/RandBetween.java index 79f1c0acea..4e96f9ad57 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/atp/RandBetween.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/atp/RandBetween.java @@ -34,8 +34,6 @@ import org.apache.poi.ss.formula.OperationEvaluationContext; * * <b>bottom</b> is the smallest integer RANDBETWEEN will return.<br> * <b>top</b> is the largest integer RANDBETWEEN will return.<br> - - * @author Brendan Nolan */ final class RandBetween implements FreeRefFunction{ @@ -49,17 +47,17 @@ final class RandBetween implements FreeRefFunction{ * Evaluate for RANDBETWEEN(). Must be given two arguments. Bottom must be greater than top. * Bottom is rounded up and top value is rounded down. After rounding top has to be set greater * than top. - * + * * @see org.apache.poi.ss.formula.functions.FreeRefFunction#evaluate(org.apache.poi.ss.formula.eval.ValueEval[], org.apache.poi.ss.formula.OperationEvaluationContext) */ public ValueEval evaluate(ValueEval[] args, OperationEvaluationContext ec) { - + double bottom, top; if (args.length != 2) { return ErrorEval.VALUE_INVALID; } - + try { bottom = OperandResolver.coerceValueToDouble(OperandResolver.getSingleValue(args[0], ec.getRowIndex(), ec.getColumnIndex())); top = OperandResolver.coerceValueToDouble(OperandResolver.getSingleValue(args[1], ec.getRowIndex(), ec.getColumnIndex())); @@ -76,9 +74,9 @@ final class RandBetween implements FreeRefFunction{ if(bottom > top) { top = bottom; } - + return new NumberEval((bottom + (long)(Math.random() * ((top - bottom) + 1)))); - + } - + } diff --git a/poi/src/main/java/org/apache/poi/ss/formula/atp/WorkdayFunction.java b/poi/src/main/java/org/apache/poi/ss/formula/atp/WorkdayFunction.java index d4eff0261f..83cba23259 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/atp/WorkdayFunction.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/atp/WorkdayFunction.java @@ -33,8 +33,6 @@ import org.apache.poi.ss.usermodel.DateUtil; * <b>Syntax</b><br> * <b>WORKDAY</b>(<b>startDate</b>, <b>days</b>, holidays) * <p> - * - * @author jfaenomoto@gmail.com */ final class WorkdayFunction implements FreeRefFunction { @@ -50,7 +48,7 @@ final class WorkdayFunction implements FreeRefFunction { /** * Evaluate for WORKDAY. Given a date, a number of days and a optional date or interval of holidays, determines which date it is past * number of parametrized workdays. - * + * * @return {@link ValueEval} with date as its value. */ public ValueEval evaluate(ValueEval[] args, OperationEvaluationContext ec) { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/constant/ConstantValueParser.java b/poi/src/main/java/org/apache/poi/ss/formula/constant/ConstantValueParser.java index 2d49270d0d..4487dc83ba 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/constant/ConstantValueParser.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/constant/ConstantValueParser.java @@ -23,22 +23,20 @@ import org.apache.poi.util.StringUtil; /** * To support Constant Values (2.5.7) as required by the CRN record. - * This class is also used for two dimensional arrays which are encoded by + * This class is also used for two dimensional arrays which are encoded by * EXTERNALNAME (5.39) records and Array tokens.<p> - * - * @author Josh Micich */ public final class ConstantValueParser { // note - these (non-combinable) enum values are sparse. private static final int TYPE_EMPTY = 0; private static final int TYPE_NUMBER = 1; private static final int TYPE_STRING = 2; - private static final int TYPE_BOOLEAN = 4; + private static final int TYPE_BOOLEAN = 4; private static final int TYPE_ERROR_CODE = 16; // TODO - update OOO document to include this value - - private static final int TRUE_ENCODING = 1; + + private static final int TRUE_ENCODING = 1; private static final int FALSE_ENCODING = 0; - + // TODO - is this the best way to represent 'EMPTY'? private static final Object EMPTY_REPRESENTATION = null; @@ -59,7 +57,7 @@ public final class ConstantValueParser { switch(grbit) { case TYPE_EMPTY: in.readLong(); // 8 byte 'not used' field - return EMPTY_REPRESENTATION; + return EMPTY_REPRESENTATION; case TYPE_NUMBER: return Double.valueOf(in.readDouble()); case TYPE_STRING: @@ -105,7 +103,7 @@ public final class ConstantValueParser { return 8; } Class<?> cls = object.getClass(); - + if(cls == Boolean.class || cls == Double.class || cls == ErrorConstant.class) { return 8; } diff --git a/poi/src/main/java/org/apache/poi/ss/formula/constant/ErrorConstant.java b/poi/src/main/java/org/apache/poi/ss/formula/constant/ErrorConstant.java index 3d8fb50c84..5082acff75 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/constant/ErrorConstant.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/constant/ErrorConstant.java @@ -27,7 +27,7 @@ import static org.apache.logging.log4j.util.Unbox.box; * Represents a constant error code value as encoded in a constant values array. <p> * * This class is a type-safe wrapper for a 16-bit int value performing a similar job to - * <tt>ErrorEval</tt>. + * {@code ErrorEval}. */ public final class ErrorConstant { private static final Logger LOG = LogManager.getLogger(ErrorConstant.class); @@ -74,10 +74,6 @@ public final class ErrorConstant { } public String toString() { - StringBuilder sb = new StringBuilder(64); - sb.append(getClass().getName()).append(" ["); - sb.append(getText()); - sb.append("]"); - return sb.toString(); + return getClass().getName() + " [" + getText() + "]"; } } diff --git a/poi/src/main/java/org/apache/poi/ss/formula/eval/AreaEvalBase.java b/poi/src/main/java/org/apache/poi/ss/formula/eval/AreaEvalBase.java index 96633318d9..0903f51f29 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/eval/AreaEvalBase.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/eval/AreaEvalBase.java @@ -20,9 +20,6 @@ package org.apache.poi.ss.formula.eval; import org.apache.poi.ss.formula.SheetRange; import org.apache.poi.ss.formula.ptg.AreaI; -/** - * @author Josh Micich - */ public abstract class AreaEvalBase implements AreaEval { private final int _firstSheet; @@ -42,7 +39,7 @@ public abstract class AreaEvalBase implements AreaEval { _nColumns = _lastColumn - _firstColumn + 1; _nRows = _lastRow - _firstRow + 1; - + if (sheets != null) { _firstSheet = sheets.getFirstSheetIndex(); _lastSheet = sheets.getLastSheetIndex(); @@ -77,14 +74,14 @@ public abstract class AreaEvalBase implements AreaEval { public final int getLastRow() { return _lastRow; } - + public int getFirstSheetIndex() { return _firstSheet; } public int getLastSheetIndex() { return _lastSheet; } - + public final ValueEval getAbsoluteValue(int row, int col) { int rowOffsetIx = row - _firstRow; int colOffsetIx = col - _firstColumn; diff --git a/poi/src/main/java/org/apache/poi/ss/formula/eval/BlankEval.java b/poi/src/main/java/org/apache/poi/ss/formula/eval/BlankEval.java index 845e7deaab..894f58b402 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/eval/BlankEval.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/eval/BlankEval.java @@ -18,8 +18,7 @@ package org.apache.poi.ss.formula.eval; /** - * @author Amol S. Deshmukh < amolweb at ya hoo dot com > This class is a - * marker class. It is a special value for empty cells. + * This class is a marker class. It is a special value for empty cells. */ public final class BlankEval implements ValueEval { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/eval/BoolEval.java b/poi/src/main/java/org/apache/poi/ss/formula/eval/BoolEval.java index 49fe3cf2a4..9e35d4c904 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/eval/BoolEval.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/eval/BoolEval.java @@ -17,12 +17,9 @@ package org.apache.poi.ss.formula.eval; -/** - * @author Amol S. Deshmukh < amolweb at ya hoo dot com > - */ public final class BoolEval implements NumericValueEval, StringValueEval { - private boolean _value; + private final boolean _value; public static final BoolEval FALSE = new BoolEval(false); @@ -30,9 +27,9 @@ public final class BoolEval implements NumericValueEval, StringValueEval { /** * Convenience method for the following:<br> - * <code>(b ? BoolEval.TRUE : BoolEval.FALSE)</code> + * {@code (b ? BoolEval.TRUE : BoolEval.FALSE)} * - * @return the <tt>BoolEval</tt> instance representing <tt>b</tt>. + * @return the {@code BoolEval} instance representing {@code b}. */ public static BoolEval valueOf(boolean b) { return b ? TRUE : FALSE; @@ -46,10 +43,12 @@ public final class BoolEval implements NumericValueEval, StringValueEval { return _value; } + @Override public double getNumberValue() { return _value ? 1 : 0; } + @Override public String getStringValue() { return _value ? "TRUE" : "FALSE"; } diff --git a/poi/src/main/java/org/apache/poi/ss/formula/eval/ConcatEval.java b/poi/src/main/java/org/apache/poi/ss/formula/eval/ConcatEval.java index 5622be8705..cec4b987e8 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/eval/ConcatEval.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/eval/ConcatEval.java @@ -20,9 +20,6 @@ package org.apache.poi.ss.formula.eval; import org.apache.poi.ss.formula.functions.Fixed2ArgFunction; import org.apache.poi.ss.formula.functions.Function; -/** - * @author Amol S. Deshmukh < amolweb at ya hoo dot com > - */ public final class ConcatEval extends Fixed2ArgFunction { public static final Function instance = new ConcatEval(); diff --git a/poi/src/main/java/org/apache/poi/ss/formula/eval/EvaluationException.java b/poi/src/main/java/org/apache/poi/ss/formula/eval/EvaluationException.java index b0071a728c..21a368e2e5 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/eval/EvaluationException.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/eval/EvaluationException.java @@ -19,10 +19,10 @@ package org.apache.poi.ss.formula.eval; /** * This class is used to simplify error handling logic <i>within</i> operator and function - * implementations. Note - <tt>OperationEval.evaluate()</tt> and <tt>Function.evaluate()</tt> + * implementations. Note - {@code OperationEval.evaluate()} and {@code Function.evaluate()} * method signatures do not throw this exception so it cannot propagate outside.<p> * - * Here is an example coded without <tt>EvaluationException</tt>, to show how it can help: + * Here is an example coded without {@code EvaluationException}, to show how it can help: * <pre>{@code * public Eval evaluate(Eval[] args, int srcRow, short srcCol) { * // ... @@ -52,8 +52,9 @@ package org.apache.poi.ss.formula.eval; * In this example, if any error is encountered while processing the arguments, an error is * returned immediately. This code is difficult to refactor due to all the points where errors * are returned.<br> - * Using <tt>EvaluationException</tt> allows the error returning code to be consolidated to one - * place.<p> + * Using {@code EvaluationException} allows the error returning code to be consolidated to one + * place. + * * <pre>{@code * public Eval evaluate(Eval[] args, int srcRow, short srcCol) { * try { @@ -100,12 +101,10 @@ package org.apache.poi.ss.formula.eval; * error), because exceptions conveniently propagate up the call stack regardless of execution * points or the number of levels of nested calls.<p> * - * <b>Note</b> - Only standard evaluation errors are represented by <tt>EvaluationException</tt> ( + * <b>Note</b> - Only standard evaluation errors are represented by {@code EvaluationException} ( * i.e. conditions expected to be encountered when evaluating arbitrary Excel formulas). Conditions * that could never occur in an Excel spreadsheet should result in runtime exceptions. Care should * be taken to not translate any POI internal error into an Excel evaluation error code. - * - * @author Josh Micich */ public final class EvaluationException extends Exception { private final ErrorEval _errorEval; diff --git a/poi/src/main/java/org/apache/poi/ss/formula/eval/FunctionNameEval.java b/poi/src/main/java/org/apache/poi/ss/formula/eval/FunctionNameEval.java index 82e0296399..b98c8a80f9 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/eval/FunctionNameEval.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/eval/FunctionNameEval.java @@ -17,9 +17,6 @@ package org.apache.poi.ss.formula.eval; -/** - * @author Josh Micich - */ public final class FunctionNameEval implements ValueEval { private final String _functionName; diff --git a/poi/src/main/java/org/apache/poi/ss/formula/eval/IntersectionEval.java b/poi/src/main/java/org/apache/poi/ss/formula/eval/IntersectionEval.java index 4063790c73..36cd234c68 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/eval/IntersectionEval.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/eval/IntersectionEval.java @@ -20,9 +20,6 @@ package org.apache.poi.ss.formula.eval; import org.apache.poi.ss.formula.functions.Fixed2ArgFunction; import org.apache.poi.ss.formula.functions.Function; -/** - * @author Josh Micich - */ public final class IntersectionEval extends Fixed2ArgFunction { public static final Function instance = new IntersectionEval(); @@ -31,6 +28,7 @@ public final class IntersectionEval extends Fixed2ArgFunction { // enforces singleton } + @Override public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1) { try { @@ -48,7 +46,7 @@ public final class IntersectionEval extends Fixed2ArgFunction { /** * @return simple rectangular {@link AreaEval} which represents the intersection of areas - * <tt>aeA</tt> and <tt>aeB</tt>. If the two areas do not intersect, the result is <code>null</code>. + * {@code aeA} and {@code aeB}. If the two areas do not intersect, the result is {@code null}. */ private static AreaEval resolveRange(AreaEval aeA, AreaEval aeB) { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/eval/MissingArgEval.java b/poi/src/main/java/org/apache/poi/ss/formula/eval/MissingArgEval.java index 70d25040f4..185509e57e 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/eval/MissingArgEval.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/eval/MissingArgEval.java @@ -23,8 +23,6 @@ package org.apache.poi.ss.formula.eval; * COUNT and COUNTA <em>do</em> count their missing args. Note - the differences between * {@link MissingArgEval} and {@link BlankEval} have not been investigated fully, so the POI * evaluator may need to be updated to account for these as they are found. - * - * @author Josh Micich */ public final class MissingArgEval implements ValueEval { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/eval/NumberEval.java b/poi/src/main/java/org/apache/poi/ss/formula/eval/NumberEval.java index 87d425356b..d0a462dbc3 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/eval/NumberEval.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/eval/NumberEval.java @@ -25,12 +25,8 @@ import org.apache.poi.ss.formula.ptg.NumberPtg; import org.apache.poi.ss.formula.ptg.Ptg; import org.apache.poi.ss.util.NumberToTextConverter; -/** - * @author Amol S. Deshmukh < amolweb at ya hoo dot com > - * - */ public final class NumberEval implements NumericValueEval, StringValueEval { - + public static final NumberEval ZERO = new NumberEval(0); private final double _value; diff --git a/poi/src/main/java/org/apache/poi/ss/formula/eval/NumericValueEval.java b/poi/src/main/java/org/apache/poi/ss/formula/eval/NumericValueEval.java index c6dcf1dc27..92c7dc3c47 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/eval/NumericValueEval.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/eval/NumericValueEval.java @@ -14,16 +14,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* - * Created on May 8, 2005 - * - */ package org.apache.poi.ss.formula.eval; -/** - * @author Amol S. Deshmukh < amolweb at ya hoo dot com > - * - */ public interface NumericValueEval extends ValueEval { double getNumberValue(); diff --git a/poi/src/main/java/org/apache/poi/ss/formula/eval/OperandResolver.java b/poi/src/main/java/org/apache/poi/ss/formula/eval/OperandResolver.java index 59a383c3e1..2177e9115b 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/eval/OperandResolver.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/eval/OperandResolver.java @@ -26,9 +26,6 @@ import java.util.regex.Pattern; /** * Provides functionality for evaluating arguments to functions and operators. - * - * @author Josh Micich - * @author Brendan Nolan */ public final class OperandResolver { @@ -43,7 +40,7 @@ public final class OperandResolver { "(\\."+Digits+"("+Exp+")?))"+ "[\\x00-\\x20]*"); private static final Pattern fpPattern = Pattern.compile(fpRegex); - + private OperandResolver() { // no instances of this class } @@ -54,8 +51,8 @@ public final class OperandResolver { * @param arg the evaluated argument as passed to the function or operator. * @param srcCellRow used when arg is a single column AreaRef * @param srcCellCol used when arg is a single row AreaRef - * @return a <tt>NumberEval</tt>, <tt>StringEval</tt>, <tt>BoolEval</tt> or <tt>BlankEval</tt>. - * Never <code>null</code> or <tt>ErrorEval</tt>. + * @return a {@code NumberEval}, {@code StringEval}, {@code BoolEval} or {@code BlankEval}. + * Never {@code null} or {@code ErrorEval}. * @throws EvaluationException if srcCellRow or srcCellCol do not properly index into * an AreaEval. If the actual value retrieved is an ErrorEval, a corresponding * EvaluationException is thrown. @@ -75,15 +72,15 @@ public final class OperandResolver { } return result; } - + /** * Retrieves a single value from an area evaluation utilizing the 2D indices of the cell * within its own area reference to index the value in the area evaluation. * * @param ae area reference after evaluation * @param cell the source cell of the formula that contains its 2D indices - * @return a <tt>NumberEval</tt>, <tt>StringEval</tt>, <tt>BoolEval</tt> or <tt>BlankEval</tt>. or <tt>ErrorEval<tt> - * Never <code>null</code>. + * @return a {@code NumberEval}, {@code StringEval}, {@code BoolEval} or {@code BlankEval}. or {@code ErrorEval} + * Never {@code null}. */ public static ValueEval getElementFromArray(AreaEval ae, EvaluationCell cell) { @@ -105,7 +102,7 @@ public final class OperandResolver { else if (ae.isRow() && relativeColIndex < ae.getWidth()) { return ae.getRelativeValue(0, relativeColIndex); } - + return ErrorEval.NA; } @@ -142,14 +139,14 @@ public final class OperandResolver { * * Of course with carefully (or carelessly) chosen parameters, cyclic references can occur and * hence this method <b>can</b> throw a 'circular reference' EvaluationException. Note that - * this method does not attempt to detect cycles. Every cell in the specified Area <tt>ae</tt> + * this method does not attempt to detect cycles. Every cell in the specified Area {@code ae} * has already been evaluated prior to this method call. Any cell (or cell<b>s</b>) part of - * <tt>ae</tt> that would incur a cyclic reference error if selected by this method, will - * already have the value <t>ErrorEval.CIRCULAR_REF_ERROR</tt> upon entry to this method. It + * {@code ae} that would incur a cyclic reference error if selected by this method, will + * already have the value {@code ErrorEval.CIRCULAR_REF_ERROR} upon entry to this method. It * is assumed logic exists elsewhere to produce this behaviour. * - * @return whatever the selected cell's evaluated value is. Never <code>null</code>. Never - * <tt>ErrorEval</tt>. + * @return whatever the selected cell's evaluated value is. Never {@code null}. Never + * {@code ErrorEval}. * @throws EvaluationException if there is a problem with indexing into the area, or if the * evaluated cell has an error. */ @@ -163,7 +160,7 @@ public final class OperandResolver { } /** - * @return possibly <tt>ErrorEval</tt>, and <code>null</code> + * @return possibly {@code ErrorEval}, and {@code null} */ private static ValueEval chooseSingleElementFromAreaInternal(AreaEval ae, int srcCellRow, int srcCellCol) throws EvaluationException { @@ -212,21 +209,21 @@ public final class OperandResolver { } return ae.getAbsoluteValue(ae.getFirstRow(), srcCellCol); } - + private static ValueEval chooseSingleElementFromRef(RefEval ref) { return ref.getInnerValueEval( ref.getFirstSheetIndex() ); } /** * Applies some conversion rules if the supplied value is not already an integer.<br> - * Value is first coerced to a <tt>double</tt> ( See <tt>coerceValueToDouble()</tt> ). - * Note - <tt>BlankEval</tt> is converted to <code>0</code>.<p> + * Value is first coerced to a {@code double} ( See {@code coerceValueToDouble()} ). + * Note - {@code BlankEval} is converted to {@code 0}.<p> * * Excel typically converts doubles to integers by truncating toward negative infinity.<br> * The equivalent java code is:<br> - * <code>return (int)Math.floor(d);</code><br> + * {@code return (int)Math.floor(d);}<br> * <b>not</b>:<br> - * <code>return (int)d; // wrong - rounds toward zero</code> + * {@code return (int)d; // wrong - rounds toward zero} * */ public static int coerceValueToInt(ValueEval ev) throws EvaluationException { @@ -241,12 +238,12 @@ public final class OperandResolver { /** * Applies some conversion rules if the supplied value is not already a number. - * Note - <tt>BlankEval</tt> is converted to {@link NumberEval#ZERO}. + * Note - {@code BlankEval} is converted to {@link NumberEval#ZERO}. * @param ev must be a {@link NumberEval}, {@link StringEval}, {@link BoolEval} or * {@link BlankEval} * @return actual, parsed or interpreted double value (respectively). * @throws EvaluationException if a StringEval is supplied and cannot be parsed - * as a double (See <tt>parseDouble()</tt> for allowable formats). + * as a double (See {@code parseDouble()} for allowable formats). * @throws RuntimeException if the supplied parameter is not {@link NumberEval}, * {@link StringEval}, {@link BoolEval} or {@link BlankEval} */ @@ -266,7 +263,7 @@ public final class OperandResolver { if (dd == null) { throw EvaluationException.invalidValue(); } - return dd.doubleValue(); + return dd; } throw new RuntimeException("Unexpected arg eval type (" + ev.getClass().getName() + ")"); } @@ -274,8 +271,8 @@ public final class OperandResolver { /** * Converts a string to a double using standard rules that Excel would use.<br> * Tolerates leading and trailing spaces, <p> - * - * Doesn't support currency prefixes, commas, percentage signs or arithmetic operations strings. + * + * Doesn't support currency prefixes, commas, percentage signs or arithmetic operations strings. * * Some examples:<br> * " 123 " -> 123.0<br> @@ -288,7 +285,7 @@ public final class OperandResolver { * "5**2" -> 500<br> * "250%" -> 2.5<br> * - * @return <code>null</code> if the specified text cannot be parsed as a number + * @return {@code null} if the specified text cannot be parsed as a number */ public static Double parseDouble(String pText) { @@ -301,7 +298,7 @@ public final class OperandResolver { else { return null; } - + } public static Double parseDateTime(String pText) { @@ -315,8 +312,8 @@ public final class OperandResolver { } /** - * @param ve must be a <tt>NumberEval</tt>, <tt>StringEval</tt>, <tt>BoolEval</tt>, or <tt>BlankEval</tt> - * @return the converted string value. never <code>null</code> + * @param ve must be a {@code NumberEval}, {@code StringEval}, {@code BoolEval}, or {@code BlankEval} + * @return the converted string value. never {@code null} */ public static String coerceValueToString(ValueEval ve) { if (ve instanceof StringValueEval) { @@ -330,7 +327,7 @@ public final class OperandResolver { } /** - * @return <code>null</code> to represent blank values + * @return {@code null} to represent blank values * @throws EvaluationException if ve is an ErrorEval, or if a string value cannot be converted */ public static Boolean coerceValueToBoolean(ValueEval ve, boolean stringsAreBlanks) throws EvaluationException { @@ -340,7 +337,7 @@ public final class OperandResolver { return null; } if (ve instanceof BoolEval) { - return Boolean.valueOf(((BoolEval) ve).getBooleanValue()); + return ((BoolEval) ve).getBooleanValue(); } if (ve instanceof StringEval) { @@ -364,7 +361,7 @@ public final class OperandResolver { if (Double.isNaN(d)) { throw new EvaluationException(ErrorEval.VALUE_INVALID); } - return Boolean.valueOf(d != 0); + return d != 0; } if (ve instanceof ErrorEval) { throw new EvaluationException((ErrorEval) ve); diff --git a/poi/src/main/java/org/apache/poi/ss/formula/eval/PercentEval.java b/poi/src/main/java/org/apache/poi/ss/formula/eval/PercentEval.java index d6162e54c0..dcaaf9802e 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/eval/PercentEval.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/eval/PercentEval.java @@ -23,7 +23,6 @@ import org.apache.poi.ss.formula.functions.Function; /** * Implementation of Excel formula token '%'. <p> - * @author Josh Micich */ public final class PercentEval extends Fixed1ArgFunction { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/eval/RangeEval.java b/poi/src/main/java/org/apache/poi/ss/formula/eval/RangeEval.java index 617d20a765..f11fb72245 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/eval/RangeEval.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/eval/RangeEval.java @@ -21,10 +21,6 @@ import org.apache.poi.ss.formula.functions.Fixed2ArgFunction; import org.apache.poi.ss.formula.functions.Function; -/** - * - * @author Josh Micich - */ public final class RangeEval extends Fixed2ArgFunction { public static final Function instance = new RangeEval(); @@ -33,6 +29,7 @@ public final class RangeEval extends Fixed2ArgFunction { // enforces singleton } + @Override public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1) { try { @@ -46,7 +43,7 @@ public final class RangeEval extends Fixed2ArgFunction { /** * @return simple rectangular {@link AreaEval} which fully encloses both areas - * <tt>aeA</tt> and <tt>aeB</tt> + * {@code aeA} and {@code aeB} */ private static AreaEval resolveRange(AreaEval aeA, AreaEval aeB) { int aeAfr = aeA.getFirstRow(); diff --git a/poi/src/main/java/org/apache/poi/ss/formula/eval/RelationalOperationEval.java b/poi/src/main/java/org/apache/poi/ss/formula/eval/RelationalOperationEval.java index a9684c95d9..0c808ea843 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/eval/RelationalOperationEval.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/eval/RelationalOperationEval.java @@ -24,8 +24,6 @@ import org.apache.poi.ss.util.NumberComparer; /** * Base class for all comparison operator evaluators - * - * @author Amol S. Deshmukh < amolweb at ya hoo dot com > */ public abstract class RelationalOperationEval extends Fixed2ArgFunction implements ArrayFunction { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/eval/StringEval.java b/poi/src/main/java/org/apache/poi/ss/formula/eval/StringEval.java index 61515e438f..cad32e0050 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/eval/StringEval.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/eval/StringEval.java @@ -22,9 +22,6 @@ package org.apache.poi.ss.formula.eval; import org.apache.poi.ss.formula.ptg.Ptg; import org.apache.poi.ss.formula.ptg.StringPtg; -/** - * @author Amol S. Deshmukh < amolweb at ya hoo dot com > - */ public final class StringEval implements StringValueEval { public static final StringEval EMPTY_INSTANCE = new StringEval(""); diff --git a/poi/src/main/java/org/apache/poi/ss/formula/eval/StringValueEval.java b/poi/src/main/java/org/apache/poi/ss/formula/eval/StringValueEval.java index 4e1b712fbc..2741079cd2 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/eval/StringValueEval.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/eval/StringValueEval.java @@ -17,10 +17,6 @@ package org.apache.poi.ss.formula.eval; -/** - * @author Amol S. Deshmukh < amolweb at ya hoo dot com > - * - */ public interface StringValueEval extends ValueEval { /** diff --git a/poi/src/main/java/org/apache/poi/ss/formula/eval/TwoOperandNumericOperation.java b/poi/src/main/java/org/apache/poi/ss/formula/eval/TwoOperandNumericOperation.java index 8d15ebea93..f60c7855ff 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/eval/TwoOperandNumericOperation.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/eval/TwoOperandNumericOperation.java @@ -23,16 +23,13 @@ import org.apache.poi.ss.formula.functions.Function; import org.apache.poi.ss.formula.functions.MatrixFunction.MutableValueCollector; import org.apache.poi.ss.formula.functions.MatrixFunction.TwoArrayArg; -/** - * @author Josh Micich - */ public abstract class TwoOperandNumericOperation extends Fixed2ArgFunction implements ArrayFunction { protected final double singleOperandEvaluate(ValueEval arg, int srcCellRow, int srcCellCol) throws EvaluationException { ValueEval ve = OperandResolver.getSingleValue(arg, srcCellRow, srcCellCol); return OperandResolver.coerceValueToDouble(ve); } - + public ValueEval evaluateArray(ValueEval[] args, int srcRowIndex, int srcColumnIndex) { if (args.length != 2) { return ErrorEval.VALUE_INVALID; @@ -52,7 +49,7 @@ public abstract class TwoOperandNumericOperation extends Fixed2ArgFunction imple }); } - + public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1) { double result; try { @@ -78,27 +75,27 @@ public abstract class TwoOperandNumericOperation extends Fixed2ArgFunction imple private final class ArrayEval extends TwoArrayArg { private final MutableValueCollector instance = new MutableValueCollector(true, true); - + protected double[] collectValues(ValueEval arg) throws EvaluationException { return instance.collectValues(arg); } - + protected double[][] evaluate(double[][] d1, double[][] d2) throws IllegalArgumentException, EvaluationException { int width = (d1[0].length < d2[0].length) ? d1[0].length : d2[0].length; int height = (d1.length < d2.length) ? d1.length : d2.length; double[][] result = new double[height][width]; - + for (int j = 0; j < height; j++) { for (int i = 0; i < width; i++) { result[j][i] = TwoOperandNumericOperation.this.evaluate(d1[j][i], d2[j][i]); } } - + return result; } } - + public static final Function AddEval = new TwoOperandNumericOperation() { protected double evaluate(double d0, double d1) { return d0+d1; diff --git a/poi/src/main/java/org/apache/poi/ss/formula/eval/UnaryMinusEval.java b/poi/src/main/java/org/apache/poi/ss/formula/eval/UnaryMinusEval.java index 8107c48544..922c5cc90a 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/eval/UnaryMinusEval.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/eval/UnaryMinusEval.java @@ -21,9 +21,6 @@ import org.apache.poi.ss.formula.functions.ArrayFunction; import org.apache.poi.ss.formula.functions.Fixed1ArgFunction; import org.apache.poi.ss.formula.functions.Function; -/** - * @author Amol S. Deshmukh < amolweb at ya hoo dot com > - */ public final class UnaryMinusEval extends Fixed1ArgFunction implements ArrayFunction { public static final Function instance = new UnaryMinusEval(); diff --git a/poi/src/main/java/org/apache/poi/ss/formula/eval/UnaryPlusEval.java b/poi/src/main/java/org/apache/poi/ss/formula/eval/UnaryPlusEval.java index 81b36aad40..f8d73dfd15 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/eval/UnaryPlusEval.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/eval/UnaryPlusEval.java @@ -22,9 +22,6 @@ import org.apache.poi.ss.formula.functions.Fixed1ArgFunction; import org.apache.poi.ss.formula.functions.Function; -/** - * @author Amol S. Deshmukh < amolweb at ya hoo dot com > - */ public final class UnaryPlusEval extends Fixed1ArgFunction implements ArrayFunction { public static final Function instance = new UnaryPlusEval(); diff --git a/poi/src/main/java/org/apache/poi/ss/formula/eval/ValueEval.java b/poi/src/main/java/org/apache/poi/ss/formula/eval/ValueEval.java index c1309a7df6..a9db4cac58 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/eval/ValueEval.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/eval/ValueEval.java @@ -17,9 +17,6 @@ package org.apache.poi.ss.formula.eval; -/** - * @author Amol S. Deshmukh < amolweb at ya hoo dot com > - */ public interface ValueEval { // no methods } diff --git a/poi/src/main/java/org/apache/poi/ss/formula/eval/forked/ForkedEvaluationCell.java b/poi/src/main/java/org/apache/poi/ss/formula/eval/forked/ForkedEvaluationCell.java index 7a25291325..7f7f137c98 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/eval/forked/ForkedEvaluationCell.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/eval/forked/ForkedEvaluationCell.java @@ -32,8 +32,6 @@ import org.apache.poi.ss.util.CellRangeAddress; /** * Represents a cell being used for forked evaluation that has had a value set different from the * corresponding cell in the shared master workbook. - * - * @author Josh Micich */ final class ForkedEvaluationCell implements EvaluationCell { @@ -140,12 +138,12 @@ final class ForkedEvaluationCell implements EvaluationCell { public int getColumnIndex() { return _masterCell.getColumnIndex(); } - + @Override public CellRangeAddress getArrayFormulaRange() { return _masterCell.getArrayFormulaRange(); } - + @Override public boolean isPartOfArrayFormulaGroup() { return _masterCell.isPartOfArrayFormulaGroup(); diff --git a/poi/src/main/java/org/apache/poi/ss/formula/eval/forked/ForkedEvaluator.java b/poi/src/main/java/org/apache/poi/ss/formula/eval/forked/ForkedEvaluator.java index b85cc15ea9..8231653cea 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/eval/forked/ForkedEvaluator.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/eval/forked/ForkedEvaluator.java @@ -52,14 +52,14 @@ public final class ForkedEvaluator { } /** - * @param udfFinder pass <code>null</code> for default (AnalysisToolPak only) + * @param udfFinder pass {@code null} for default (AnalysisToolPak only) */ public static ForkedEvaluator create(Workbook wb, IStabilityClassifier stabilityClassifier, UDFFinder udfFinder) { return new ForkedEvaluator(wb.createEvaluationWorkbook(), stabilityClassifier, udfFinder); } /** - * Sets the specified cell to the supplied <tt>value</tt> + * Sets the specified cell to the supplied {@code value} * @param sheetName the name of the sheet containing the cell * @param rowIndex zero based * @param columnIndex zero based @@ -72,8 +72,8 @@ public final class ForkedEvaluator { } /** * Copies the values of all updated cells (modified by calls to {@link - * #updateCell(String, int, int, ValueEval)}) to the supplied <tt>workbook</tt>.<br> - * Typically, the supplied <tt>workbook</tt> is a writable copy of the 'master workbook', + * #updateCell(String, int, int, ValueEval)}) to the supplied {@code workbook}.<br> + * Typically, the supplied {@code workbook} is a writable copy of the 'master workbook', * but at the very least it must contain sheets with the same names. */ public void copyUpdatedCells(Workbook workbook) { @@ -90,7 +90,7 @@ public final class ForkedEvaluator { * @param sheetName the name of the sheet containing the cell * @param rowIndex zero based * @param columnIndex zero based - * @return <code>null</code> if the supplied cell is <code>null</code> or blank + * @return {@code null} if the supplied cell is {@code null} or blank */ public ValueEval evaluate(String sheetName, int rowIndex, int columnIndex) { EvaluationCell cell = _sewb.getEvaluationCell(sheetName, rowIndex, columnIndex); diff --git a/poi/src/main/java/org/apache/poi/ss/formula/function/FunctionDataBuilder.java b/poi/src/main/java/org/apache/poi/ss/formula/function/FunctionDataBuilder.java index 0be53f555e..fefc4d0987 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/function/FunctionDataBuilder.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/function/FunctionDataBuilder.java @@ -23,10 +23,8 @@ import java.util.Map; import java.util.Set; /** - * Temporarily collects <tt>FunctionMetadata</tt> instances for creation of a - * <tt>FunctionMetadataRegistry</tt>. - * - * @author Josh Micich + * Temporarily collects {@code FunctionMetadata} instances for creation of a + * {@code FunctionMetadataRegistry}. */ final class FunctionDataBuilder { private int _maxFunctionIndex; @@ -47,7 +45,7 @@ final class FunctionDataBuilder { FunctionMetadata fm = new FunctionMetadata(functionIndex, functionName, minParams, maxParams, returnClassCode, parameterClassCodes); - Integer indexKey = Integer.valueOf(functionIndex); + Integer indexKey = functionIndex; if(functionIndex > _maxFunctionIndex) { @@ -60,7 +58,7 @@ final class FunctionDataBuilder { if(!hasFootnote || !_mutatingFunctionIndexes.contains(indexKey)) { throw new RuntimeException("Multiple entries for function name '" + functionName + "'"); } - _functionDataByIndex.remove(Integer.valueOf(prevFM.getIndex())); + _functionDataByIndex.remove(prevFM.getIndex()); } prevFM = _functionDataByIndex.get(indexKey); if(prevFM != null) { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/function/FunctionMetadata.java b/poi/src/main/java/org/apache/poi/ss/formula/function/FunctionMetadata.java index fa8ca34aca..9c80cd4623 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/function/FunctionMetadata.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/function/FunctionMetadata.java @@ -19,8 +19,6 @@ package org.apache.poi.ss.formula.function; /** * Holds information about Excel built-in functions. - * - * @author Josh Micich */ public final class FunctionMetadata { /** @@ -80,7 +78,7 @@ public final class FunctionMetadata { } /** - * Some varags functions (like VLOOKUP) have a specific limit to the number of arguments that + * Some varags functions (like VLOOKUP) have a specific limit to the number of arguments that * can be passed. Other functions (like SUM) don't have such a limit. For those functions, * the spreadsheet version determines the maximum number of arguments that can be passed. * @return <code>true</code> if this function can the maximum number of arguments allowable by diff --git a/poi/src/main/java/org/apache/poi/ss/formula/function/FunctionMetadataReader.java b/poi/src/main/java/org/apache/poi/ss/formula/function/FunctionMetadataReader.java index dc83e9c601..fce0793765 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/function/FunctionMetadataReader.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/function/FunctionMetadataReader.java @@ -31,9 +31,7 @@ import org.apache.poi.ss.formula.ptg.Ptg; import org.apache.poi.util.IOUtils; /** - * Converts the text meta-data file into a <tt>FunctionMetadataRegistry</tt> - * - * @author Josh Micich + * Converts the text meta-data file into a {@code FunctionMetadataRegistry} */ final class FunctionMetadataReader { @@ -150,12 +148,7 @@ final class FunctionMetadataReader { } private static boolean isDash(String codes) { - if(codes.length() == 1) { - if (codes.charAt(0) == '-') { - return true; - } - } - return false; + return codes.length() == 1 && codes.charAt(0) == '-'; } private static byte parseOperandTypeCode(String code) { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/function/FunctionMetadataRegistry.java b/poi/src/main/java/org/apache/poi/ss/formula/function/FunctionMetadataRegistry.java index bb01b41163..2430fa2551 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/function/FunctionMetadataRegistry.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/function/FunctionMetadataRegistry.java @@ -19,10 +19,9 @@ package org.apache.poi.ss.formula.function; import java.util.Map; import java.util.Set; + /** * Allows clients to get {@link FunctionMetadata} instances for any built-in function of Excel. - * - * @author Josh Micich */ public final class FunctionMetadataRegistry { /** diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Address.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Address.java index ea5244c1eb..315d689193 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Address.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Address.java @@ -22,8 +22,6 @@ import org.apache.poi.ss.util.CellReference; /** * Creates a text reference as text, given specified row and column numbers. - * - * @author Aniket Banerjee (banerjee@google.com) */ public class Address implements Function { public static final int REF_ABSOLUTE = 1; diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/AggregateFunction.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/AggregateFunction.java index 5eb90c3417..fc79c814c1 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/AggregateFunction.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/AggregateFunction.java @@ -24,9 +24,6 @@ import org.apache.poi.ss.formula.eval.NumberEval; import org.apache.poi.ss.formula.eval.OperandResolver; import org.apache.poi.ss.formula.eval.ValueEval; -/** - * @author Amol S. Deshmukh < amolweb at ya hoo dot com > - */ public abstract class AggregateFunction extends MultiOperandNumericFunction { private static final class LargeSmall extends Fixed2ArgFunction { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Areas.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Areas.java index 6d06c6375e..f6034ef5a5 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Areas.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Areas.java @@ -25,8 +25,6 @@ import org.apache.poi.ss.formula.ptg.NumberPtg; /** * Returns the number of areas in a reference. An area is a range of contiguous cells or a single cell. - * - * @author Loopbing (loopbing@gmail.com) */ public final class Areas implements Function { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/ArrayFunction.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/ArrayFunction.java index 46b89d5013..aa896ecc32 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/ArrayFunction.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/ArrayFunction.java @@ -24,7 +24,6 @@ import org.apache.poi.ss.formula.eval.*; import java.util.function.BiFunction; /** - * @author Robert Hulbert * Common Interface for any excel built-in function that has implemented array formula functionality. */ diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Bin2Dec.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Bin2Dec.java index 69a01fe69c..e2c5100a97 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Bin2Dec.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Bin2Dec.java @@ -37,8 +37,6 @@ import org.apache.poi.ss.formula.eval.ValueEval; * Remark * If number is not a valid binary number, or if number contains more than 10 characters (10 bits), * BIN2DEC returns the #NUM! error value. - * - * @author cedric dot walter @ gmail dot com */ public class Bin2Dec extends Fixed1ArgFunction implements FreeRefFunction { @@ -80,10 +78,10 @@ public class Bin2Dec extends Fixed1ArgFunction implements FreeRefFunction { String inverted = toggleBits(unsigned); // Calculate decimal number int sum = getDecimalValue(inverted); - + //Add 1 to obtained number sum++; - + value = "-" + sum; } } catch (NumberFormatException e) { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/CalendarFieldFunction.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/CalendarFieldFunction.java index 28af57a2a5..0a93244cc3 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/CalendarFieldFunction.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/CalendarFieldFunction.java @@ -30,9 +30,6 @@ import org.apache.poi.ss.usermodel.DateUtil; * Implementation of Excel functions Date parsing functions: * Date - DAY, MONTH and YEAR * Time - HOUR, MINUTE and SECOND - * - * @author Others (not mentioned in code) - * @author Thies Wellpott */ public final class CalendarFieldFunction extends Fixed1ArgFunction { public static final Function YEAR = new CalendarFieldFunction(Calendar.YEAR); @@ -79,12 +76,12 @@ public final class CalendarFieldFunction extends Fixed1ArgFunction { // rounding issues); use UTC here to prevent daylight saving issues for HOUR Calendar c = DateUtil.getJavaCalendarUTC(serialDate + 0.4995 / DateUtil.SECONDS_PER_DAY, false); int result = c.get(_dateFieldId); - + // Month is a special case due to C semantics if (_dateFieldId == Calendar.MONTH) { result++; } - + return result; } } diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Choose.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Choose.java index 127ffd43d7..6bcb825c3d 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Choose.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Choose.java @@ -24,9 +24,6 @@ import org.apache.poi.ss.formula.eval.MissingArgEval; import org.apache.poi.ss.formula.eval.OperandResolver; import org.apache.poi.ss.formula.eval.ValueEval; -/** - * @author Josh Micich - */ public final class Choose implements Function { public ValueEval evaluate(ValueEval[] args, int srcRowIndex, int srcColumnIndex) { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Code.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Code.java index f285d58580..784500f095 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Code.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Code.java @@ -27,8 +27,6 @@ import org.apache.poi.ss.formula.eval.*; * Returns a numeric code for the first character in a text string. The returned code corresponds to the character set used by your computer. * <p> * text The text for which you want the code of the first character. - * - * @author cedric dot walter @ gmail dot com */ public class Code extends Fixed1ArgFunction { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Columns.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Columns.java index 3c1fdc54a2..b129eb2f80 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Columns.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Columns.java @@ -25,8 +25,6 @@ import org.apache.poi.ss.formula.TwoDEval; /** * Implementation for Excel COLUMNS function. - * - * @author Josh Micich */ public final class Columns extends Fixed1ArgFunction { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Complex.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Complex.java index b616eba7a7..5950260d95 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Complex.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Complex.java @@ -51,8 +51,6 @@ import org.apache.poi.ss.formula.eval.ValueEval; * <li>If omitted, suffix is assumed to be "i".</li> * <li>If suffix is neither "i" nor "j", COMPLEX returns the #VALUE! error value.</li> * </ul> - * - * @author cedric dot walter @ gmail dot com */ public class Complex extends Var2or3ArgFunction implements FreeRefFunction { @@ -96,7 +94,7 @@ public class Complex extends Var2or3ArgFunction implements FreeRefFunction { if (suffixValue.length() == 0) { suffixValue = DEFAULT_SUFFIX; } - if (suffixValue.equals(DEFAULT_SUFFIX.toUpperCase(Locale.ROOT)) || + if (suffixValue.equals(DEFAULT_SUFFIX.toUpperCase(Locale.ROOT)) || suffixValue.equals(SUPPORTED_SUFFIX.toUpperCase(Locale.ROOT))) { return ErrorEval.VALUE_INVALID; } diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/CountUtils.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/CountUtils.java index 5dae60f946..29066c66b5 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/CountUtils.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/CountUtils.java @@ -24,8 +24,6 @@ import org.apache.poi.ss.formula.eval.ValueEval; /** * Common logic for COUNT, COUNTA and COUNTIF - * - * @author Josh Micich */ final class CountUtils { @@ -57,12 +55,12 @@ final class CountUtils { for (int rrIx=0; rrIx<height; rrIx++) { for (int rcIx=0; rcIx<width; rcIx++) { ValueEval ve = areaEval.getValue(sIx, rrIx, rcIx); - + if(criteriaPredicate instanceof I_MatchAreaPredicate){ I_MatchAreaPredicate areaPredicate = (I_MatchAreaPredicate)criteriaPredicate; if(!areaPredicate.matches(areaEval, rrIx, rcIx)) continue; } - + if(criteriaPredicate.matches(ve)) { result++; } @@ -76,7 +74,7 @@ final class CountUtils { */ public static int countMatchingCellsInRef(RefEval refEval, I_MatchPredicate criteriaPredicate) { int result = 0; - + final int firstSheetIndex = refEval.getFirstSheetIndex(); final int lastSheetIndex = refEval.getLastSheetIndex(); for (int sIx = firstSheetIndex; sIx <= lastSheetIndex; sIx++) { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Counta.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Counta.java index c725f012a2..e8d54c9e39 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Counta.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Counta.java @@ -31,8 +31,6 @@ import org.apache.poi.ss.formula.functions.CountUtils.I_MatchAreaPredicate; * Excel Syntax * COUNTA(value1,value2,...) * Value1, value2, ... are 1 to 30 arguments representing the values or ranges to be counted. - * - * @author Josh Micich */ public final class Counta implements Function { private final I_MatchPredicate _predicate; @@ -98,7 +96,7 @@ public final class Counta implements Function { public boolean matches(ValueEval valueEval) { return defaultPredicate.matches(valueEval); } - + /** * don't count cells in rows that are hidden or subtotal cells */ @@ -106,7 +104,7 @@ public final class Counta implements Function { return !areEval.isSubTotal(rowIndex, columnIndex) && ! areEval.isRowHidden(rowIndex); } }; - + public static Counta subtotalInstance(boolean includeHiddenRows) { return new Counta(includeHiddenRows ? subtotalPredicate : subtotalVisibleOnlyPredicate); } diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Countblank.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Countblank.java index af2016f807..560a776b54 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Countblank.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Countblank.java @@ -29,8 +29,6 @@ import org.apache.poi.ss.formula.functions.CountUtils.I_MatchPredicate; * <tr><th>range </th><td>is the range of cells to count blanks</td></tr> * </table> * </p> - * - * @author Mads Mohr Christensen */ public final class Countblank extends Fixed1ArgFunction { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/DateValue.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/DateValue.java index fa241a7389..e4f9aa0d64 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/DateValue.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/DateValue.java @@ -41,8 +41,6 @@ import org.apache.poi.ss.usermodel.DateUtil; * <p> * To view a date serial number as a date, you must apply a date format to the cell. Find links to more * information about displaying numbers as dates in the See Also section. - * - * @author Milosz Rembisz */ public class DateValue extends Fixed1ArgFunction { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Dec2Bin.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Dec2Bin.java index 2ec9ea30c7..c38710f23e 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Dec2Bin.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Dec2Bin.java @@ -45,8 +45,6 @@ import org.apache.poi.ss.formula.eval.ValueEval; * <li>If places is nonnumeric, DEC2BIN returns the #VALUE! error value.</li> * <li>If places is zero or negative, DEC2BIN returns the #NUM! error value.</li> * </ul> - * - * @author cedric dot walter @ gmail dot com */ public class Dec2Bin extends Var1or2ArgFunction implements FreeRefFunction { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Delta.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Delta.java index 4fd112f4b0..b2b24ce69c 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Delta.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Delta.java @@ -37,8 +37,6 @@ import org.apache.poi.ss.formula.eval.ValueEval; * <li>If number1 is nonnumeric, DELTA returns the #VALUE! error value.</li> * <li>If number2 is nonnumeric, DELTA returns the #VALUE! error value.</li> * </ul> - * - * @author cedric dot walter @ gmail dot com */ public final class Delta extends Fixed2ArgFunction implements FreeRefFunction { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Errortype.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Errortype.java index 71565fdef0..486465a7b1 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Errortype.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Errortype.java @@ -30,8 +30,7 @@ import org.apache.poi.ss.usermodel.FormulaError; * <b>Syntax:</b><br> * <b>ERROR.TYPE</b>(<b>errorValue</b>)</p> * <p> - * Returns a number corresponding to the error type of the supplied argument.<p> - * <p> + * Returns a number corresponding to the error type of the supplied argument. * <table border="1" cellpadding="1" cellspacing="1" summary="Return values for ERROR.TYPE()"> * <tr><td>errorValue</td><td>Return Value</td></tr> * <tr><td>#NULL!</td><td>1</td></tr> @@ -45,13 +44,11 @@ import org.apache.poi.ss.usermodel.FormulaError; * </table> * * Note - the results of ERROR.TYPE() are different to the constants defined in - * <tt>ErrorConstants</tt>. - * </p> - * - * @author Josh Micich + * {@code ErrorConstants}. */ public final class Errortype extends Fixed1ArgFunction { + @Override public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0) { try { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/FactDouble.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/FactDouble.java index 8c3394854d..70efd0c6a4 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/FactDouble.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/FactDouble.java @@ -38,8 +38,6 @@ import java.util.HashMap; * <li>If number is negative, FACTDOUBLE returns the #NUM! error value.</li> * </ul> * Use a cache for more speed of previously calculated factorial - * - * @author cedric dot walter @ gmail dot com */ public class FactDouble extends Fixed1ArgFunction implements FreeRefFunction { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/FinanceFunction.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/FinanceFunction.java index 988007386b..f7376e2531 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/FinanceFunction.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/FinanceFunction.java @@ -24,9 +24,6 @@ import org.apache.poi.ss.formula.eval.MissingArgEval; import org.apache.poi.ss.formula.eval.NumberEval; import org.apache.poi.ss.formula.eval.ValueEval; -/** - * @author Amol S. Deshmukh < amolweb at ya hoo dot com > - */ public abstract class FinanceFunction implements Function3Arg, Function4Arg { private static final ValueEval DEFAULT_ARG3 = NumberEval.ZERO; private static final ValueEval DEFAULT_ARG4 = BoolEval.FALSE; diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/FinanceLib.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/FinanceLib.java index 9f7aeaebae..c5920cd039 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/FinanceLib.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/FinanceLib.java @@ -18,9 +18,6 @@ package org.apache.poi.ss.formula.functions; /** - * @author Amol S. Deshmukh < amolweb at ya hoo dot com > - * - * * This class is a functon library for common fiscal functions. * <b>Glossary of terms/abbreviations:</b> * <br> diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Fixed1ArgFunction.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Fixed1ArgFunction.java index 0b3317d5be..9987303532 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Fixed1ArgFunction.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Fixed1ArgFunction.java @@ -22,8 +22,6 @@ import org.apache.poi.ss.formula.eval.ValueEval; /** * Convenience base class for functions that must take exactly one argument. - * - * @author Josh Micich */ public abstract class Fixed1ArgFunction implements Function1Arg { public final ValueEval evaluate(ValueEval[] args, int srcRowIndex, int srcColumnIndex) { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Fixed2ArgFunction.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Fixed2ArgFunction.java index 0ba3d40de8..aeef8a6818 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Fixed2ArgFunction.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Fixed2ArgFunction.java @@ -22,8 +22,6 @@ import org.apache.poi.ss.formula.eval.ValueEval; /** * Convenience base class for functions that must take exactly two arguments. - * - * @author Josh Micich */ public abstract class Fixed2ArgFunction implements Function2Arg { public final ValueEval evaluate(ValueEval[] args, int srcRowIndex, int srcColumnIndex) { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Fixed3ArgFunction.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Fixed3ArgFunction.java index 421a398022..05b6a0f64a 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Fixed3ArgFunction.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Fixed3ArgFunction.java @@ -22,8 +22,6 @@ import org.apache.poi.ss.formula.eval.ValueEval; /** * Convenience base class for functions that must take exactly three arguments. - * - * @author Josh Micich */ public abstract class Fixed3ArgFunction implements Function3Arg { public final ValueEval evaluate(ValueEval[] args, int srcRowIndex, int srcColumnIndex) { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Fixed4ArgFunction.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Fixed4ArgFunction.java index e3f8ace412..1cdf449d2f 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Fixed4ArgFunction.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Fixed4ArgFunction.java @@ -22,8 +22,6 @@ import org.apache.poi.ss.formula.eval.ValueEval; /** * Convenience base class for functions that must take exactly four arguments. - * - * @author Josh Micich */ public abstract class Fixed4ArgFunction implements Function4Arg { public final ValueEval evaluate(ValueEval[] args, int srcRowIndex, int srcColumnIndex) { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/FreeRefFunction.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/FreeRefFunction.java index b7affe2a2f..be05953c2a 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/FreeRefFunction.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/FreeRefFunction.java @@ -35,16 +35,14 @@ import org.apache.poi.ss.formula.OperationEvaluationContext; * * For the moment this interface only exists to serve the <b>INDIRECT</b> which can decode * arbitrary text into cell references, and evaluate them.. - * - * @author Josh Micich */ public interface FreeRefFunction { /** - * @param args the pre-evaluated arguments for this function. args is never <code>null</code>, + * @param args the pre-evaluated arguments for this function. args is never {@code null}, * nor are any of its elements. * @param ec primarily used to identify the source cell containing the formula being evaluated. * may also be used to dynamically create reference evals. - * @return never <code>null</code>. Possibly an instance of <tt>ErrorEval</tt> in the case of + * @return never {@code null}. Possibly an instance of {@code ErrorEval} in the case of * a specified Excel error (Exceptions are never thrown to represent Excel errors). */ ValueEval evaluate(ValueEval[] args, OperationEvaluationContext ec); diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Frequency.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Frequency.java index 9df832366d..94fa553521 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Frequency.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Frequency.java @@ -35,8 +35,6 @@ import java.util.Arrays; * If data_array contains no values, FREQUENCY returns an array of zeros.<br> * <b>bins_array</b> Required. An array of or reference to intervals into which you want to group the values in data_array. * If bins_array contains no values, FREQUENCY returns the number of elements in data_array.<br> - * - * @author Yegor Kozlov */ public class Frequency extends Fixed2ArgFunction { public static final Function instance = new Frequency(); diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Function.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Function.java index 5f97b81a24..4ed160ede6 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Function.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Function.java @@ -24,8 +24,6 @@ import org.apache.poi.ss.formula.eval.ValueEval; /** * Common interface for all implementations of Excel built-in functions. - * - * @author Amol S. Deshmukh < amolweb at ya hoo dot com > */ public interface Function { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Function1Arg.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Function1Arg.java index ec214f4f09..81f1432d77 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Function1Arg.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Function1Arg.java @@ -21,8 +21,6 @@ import org.apache.poi.ss.formula.eval.ValueEval; /** * Implemented by all functions that can be called with one argument - * - * @author Josh Micich */ public interface Function1Arg extends Function { /** diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Function2Arg.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Function2Arg.java index bd395cc51e..1099e8ae0c 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Function2Arg.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Function2Arg.java @@ -21,8 +21,6 @@ import org.apache.poi.ss.formula.eval.ValueEval; /** * Implemented by all functions that can be called with two arguments - * - * @author Josh Micich */ public interface Function2Arg extends Function { /** diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Function3Arg.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Function3Arg.java index ad5eee1586..9e27a3945a 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Function3Arg.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Function3Arg.java @@ -21,8 +21,6 @@ import org.apache.poi.ss.formula.eval.ValueEval; /** * Implemented by all functions that can be called with three arguments - * - * @author Josh Micich */ public interface Function3Arg extends Function { /** diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Function4Arg.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Function4Arg.java index f0eee52241..f08af616b9 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Function4Arg.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Function4Arg.java @@ -21,8 +21,6 @@ import org.apache.poi.ss.formula.eval.ValueEval; /** * Implemented by all functions that can be called with four arguments - * - * @author Josh Micich */ public interface Function4Arg extends Function { /** diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Hex2Dec.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Hex2Dec.java index c3b1341d91..d80ce76235 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Hex2Dec.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Hex2Dec.java @@ -32,8 +32,6 @@ import org.apache.poi.ss.formula.eval.*; * The remaining 39 bits are magnitude bits. Negative numbers are represented using two's-complement notation. * Remark * If number is not a valid hexadecimal number, HEX2DEC returns the #NUM! error value. - * - * @author cedric dot walter @ gmail dot com */ public class Hex2Dec extends Fixed1ArgFunction implements FreeRefFunction { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Hlookup.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Hlookup.java index 5658ec49ec..931ca942bf 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Hlookup.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Hlookup.java @@ -36,17 +36,17 @@ import org.apache.poi.ss.formula.TwoDEval; * <b>row_index_num</b> a 1 based index specifying which row value of the lookup data will be returned.<br> * <b>range_lookup</b> If TRUE (default), HLOOKUP finds the largest value less than or equal to * the lookup_value. If FALSE, only exact matches will be considered<br> - * - * @author Josh Micich */ public final class Hlookup extends Var3or4ArgFunction { private static final ValueEval DEFAULT_ARG3 = BoolEval.TRUE; + @Override public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1, ValueEval arg2) { return evaluate(srcRowIndex, srcColumnIndex, arg0, arg1, arg2, DEFAULT_ARG3); } + @Override public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1, ValueEval arg2, ValueEval arg3) { try { @@ -65,7 +65,7 @@ public final class Hlookup extends Var3or4ArgFunction { } /** - * Returns one column from an <tt>AreaEval</tt> + * Returns one column from an {@code AreaEval} * * @param rowIndex assumed to be non-negative * diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Hyperlink.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Hyperlink.java index c69c0b47cb..8bb04e0d81 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Hyperlink.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Hyperlink.java @@ -32,8 +32,6 @@ import org.apache.poi.ss.formula.eval.ValueEval; * <b>friendly_name</b> (optional) the value to display<p> * * Returns last argument. Leaves type unchanged (does not convert to {@link org.apache.poi.ss.formula.eval.StringEval}). - * - * @author Wayne Clingingsmith */ public final class Hyperlink extends Var1or2ArgFunction { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/ImReal.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/ImReal.java index c5a6e15a51..6c4a4d7f2e 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/ImReal.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/ImReal.java @@ -40,8 +40,6 @@ import org.apache.poi.ss.formula.eval.ValueEval; * <li>If inumber is not in the form x + yi or x + yj, this function returns the #NUM! error value.</li> * <li>Use COMPLEX to convert real and imaginary coefficients into a complex number.</li> * </ul> - * - * @author cedric dot walter @ gmail dot com */ public class ImReal extends Fixed1ArgFunction implements FreeRefFunction { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Imaginary.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Imaginary.java index a030107207..3a22097f0d 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Imaginary.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Imaginary.java @@ -36,8 +36,6 @@ import java.util.regex.Pattern; * <ul> * <li>Use COMPLEX to convert real and imaginary coefficients into a complex number.</li> * </ul> - * - * @author cedric dot walter @ gmail dot com */ public class Imaginary extends Fixed1ArgFunction implements FreeRefFunction { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Index.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Index.java index 2dc6622d05..1238f03125 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Index.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Index.java @@ -30,8 +30,8 @@ import org.apache.poi.ss.formula.TwoDEval; * Implementation for the Excel function INDEX * <p> * - * Syntax : <br> - * INDEX ( reference, row_num[, column_num [, area_num]])</br> + * Syntax : <p> + * INDEX ( reference, row_num[, column_num [, area_num]])<p> * INDEX ( array, row_num[, column_num]) * <table border="0" cellpadding="1" cellspacing="0" summary="Parameter descriptions"> * <tr><th>reference</th><td>typically an area reference, possibly a union of areas</td></tr> @@ -40,9 +40,6 @@ import org.apache.poi.ss.formula.TwoDEval; * <tr><th>column_num</th><td>selects column within the array or area reference. default is 1</td></tr> * <tr><th>area_num</th><td>used when reference is a union of areas</td></tr> * </table> - * </p> - * - * @author Josh Micich */ public final class Index implements Function2Arg, Function3Arg, Function4Arg, ArrayMode { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Indirect.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Indirect.java index ee44b9435d..0eb2c04afc 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Indirect.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Indirect.java @@ -42,8 +42,6 @@ import org.apache.poi.ss.usermodel.Table; * normally be written in a cell formula.<br> * <b>isA1Style</b> (default TRUE) specifies whether the ref_text should be * interpreted as A1-style or R1C1-style. - * - * @author Josh Micich */ public final class Indirect implements FreeRefFunction { @@ -95,7 +93,7 @@ public final class Indirect implements FreeRefFunction { private static ValueEval evaluateIndirect(final OperationEvaluationContext ec, String text, boolean isA1style) { - + // Search backwards for '!' because sheet names can contain '!' int plingPos = text.lastIndexOf('!'); @@ -132,7 +130,7 @@ public final class Indirect implements FreeRefFunction { int colonPos = refText.indexOf(':'); if (colonPos < 0) { refStrPart1 = refText.trim(); - refStrPart2 = null; + refStrPart2 = null; } else { refStrPart1 = refText.substring(0, colonPos).trim(); refStrPart2 = refText.substring(colonPos + 1).trim(); diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Intercept.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Intercept.java index 89542e2dab..706d777596 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Intercept.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Intercept.java @@ -29,9 +29,6 @@ import org.apache.poi.ss.formula.functions.LinearRegressionFunction.FUNCTION; * (http://introcs.cs.princeton.edu/java/97data/LinearRegression.java.html) * <b>Syntax</b>:<br> * <b>INTERCEPT</b>(<b>arrayX</b>, <b>arrayY</b>)<p> - * - * - * @author Johan Karlsteen */ public final class Intercept extends Fixed2ArgFunction { @@ -39,7 +36,7 @@ public final class Intercept extends Fixed2ArgFunction { public Intercept() { func = new LinearRegressionFunction(FUNCTION.INTERCEPT); } - + public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1) { return func.evaluate(srcRowIndex, srcColumnIndex, arg0, arg1); diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/LinearRegressionFunction.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/LinearRegressionFunction.java index 513daa3a1b..5ecd7c2053 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/LinearRegressionFunction.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/LinearRegressionFunction.java @@ -35,10 +35,7 @@ import org.apache.poi.ss.formula.functions.LookupUtils.ValueVector; * <b>Syntax</b>:<br> * <b>INTERCEPT</b>(<b>arrayX</b>, <b>arrayY</b>)<p> * or - * <b>SLOPE</b>(<b>arrayX</b>, <b>arrayY</b>)<p> - * - * - * @author Johan Karlsteen + * <b>SLOPE</b>(<b>arrayX</b>, <b>arrayY</b>) */ public final class LinearRegressionFunction extends Fixed2ArgFunction { @@ -48,7 +45,8 @@ public final class LinearRegressionFunction extends Fixed2ArgFunction { _size = size; } - public ValueEval getItem(int index) { + @Override + public ValueEval getItem(int index) { if (index < 0 || index > _size) { throw new IllegalArgumentException("Specified index " + index + " is outside range (0.." + (_size - 1) + ")"); diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/LogicalFunction.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/LogicalFunction.java index 9df2803c3c..69d456872e 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/LogicalFunction.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/LogicalFunction.java @@ -25,7 +25,8 @@ import org.apache.poi.ss.formula.eval.*; */ public abstract class LogicalFunction extends Fixed1ArgFunction implements ArrayFunction{ - @SuppressWarnings("unused") + @Override + @SuppressWarnings("unused") public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0) { ValueEval ve; try { @@ -58,21 +59,25 @@ public abstract class LogicalFunction extends Fixed1ArgFunction implements Array protected abstract boolean evaluate(ValueEval arg); public static final Function ISLOGICAL = new LogicalFunction() { + @Override protected boolean evaluate(ValueEval arg) { return arg instanceof BoolEval; } }; public static final Function ISNONTEXT = new LogicalFunction() { + @Override protected boolean evaluate(ValueEval arg) { return !(arg instanceof StringEval); } }; public static final Function ISNUMBER = new LogicalFunction() { + @Override protected boolean evaluate(ValueEval arg) { return arg instanceof NumberEval; } }; public static final Function ISTEXT = new LogicalFunction() { + @Override protected boolean evaluate(ValueEval arg) { return arg instanceof StringEval; } @@ -80,6 +85,7 @@ public abstract class LogicalFunction extends Fixed1ArgFunction implements Array public static final Function ISBLANK = new LogicalFunction() { + @Override protected boolean evaluate(ValueEval arg) { return arg instanceof BlankEval; } @@ -87,21 +93,22 @@ public abstract class LogicalFunction extends Fixed1ArgFunction implements Array public static final Function ISERROR = new LogicalFunction() { + @Override protected boolean evaluate(ValueEval arg) { return arg instanceof ErrorEval; } }; /** - * Implementation of Excel <tt>ISERR()</tt> function.<p> + * Implementation of Excel {@code ISERR()} function.<p> * * <b>Syntax</b>:<br> * <b>ISERR</b>(<b>value</b>)<p> * * <b>value</b> The value to be tested<p> * - * Returns the logical value <tt>TRUE</tt> if value refers to any error value except - * <tt>'#N/A'</tt>; otherwise, it returns <tt>FALSE</tt>. + * Returns the logical value {@code TRUE} if value refers to any error value except + * {@code '#N/A'}; otherwise, it returns {@code FALSE}. */ public static final Function ISERR = new LogicalFunction() { @Override @@ -121,10 +128,11 @@ public abstract class LogicalFunction extends Fixed1ArgFunction implements Array * * <b>value</b> The value to be tested<br> * <br> - * Returns <tt>TRUE</tt> if the specified value is '#N/A', <tt>FALSE</tt> otherwise. + * Returns {@code TRUE} if the specified value is '#N/A', {@code FALSE} otherwise. */ public static final Function ISNA = new LogicalFunction() { + @Override protected boolean evaluate(ValueEval arg) { return arg == ErrorEval.NA; } @@ -132,6 +140,7 @@ public abstract class LogicalFunction extends Fixed1ArgFunction implements Array public static final Function ISREF = new Fixed1ArgFunction() { + @Override public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0) { if (arg0 instanceof RefEval || arg0 instanceof AreaEval || arg0 instanceof RefListEval) { return BoolEval.TRUE; diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/LookupUtils.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/LookupUtils.java index 9af09c301b..135614d3c7 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/LookupUtils.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/LookupUtils.java @@ -39,7 +39,7 @@ import org.apache.poi.ss.formula.eval.ValueEval; final class LookupUtils { /** - * Represents a single row or column within an <tt>AreaEval</tt>. + * Represents a single row or column within an {@code AreaEval}. */ public interface ValueVector { ValueEval getItem(int index); @@ -64,6 +64,7 @@ final class LookupUtils { _size = tableArray.getWidth(); } + @Override public ValueEval getItem(int index) { if(index > _size) { throw new ArrayIndexOutOfBoundsException("Specified index (" + index @@ -71,6 +72,7 @@ final class LookupUtils { } return _tableArray.getValue(_rowIndex, index); } + @Override public int getSize() { return _size; } @@ -93,6 +95,7 @@ final class LookupUtils { _size = _tableArray.getHeight(); } + @Override public ValueEval getItem(int index) { if(index > _size) { throw new ArrayIndexOutOfBoundsException("Specified index (" + index @@ -100,6 +103,7 @@ final class LookupUtils { } return _tableArray.getValue(index, _columnIndex); } + @Override public int getSize() { return _size; } @@ -114,7 +118,8 @@ final class LookupUtils { _re = re; } - public ValueEval getItem(int index) { + @Override + public ValueEval getItem(int index) { if(index >= _size) { throw new ArrayIndexOutOfBoundsException("Specified index (" + index + ") is outside the allowed range (0.." + (_size-1) + ")"); @@ -122,7 +127,8 @@ final class LookupUtils { int sheetIndex = _re.getFirstSheetIndex() + index; return _re.getInnerValueEval(sheetIndex); } - public int getSize() { + @Override + public int getSize() { return _size; } } @@ -134,7 +140,7 @@ final class LookupUtils { return new ColumnVector(tableArray, relativeColumnIndex); } /** - * @return <code>null</code> if the supplied area is neither a single row nor a single column + * @return {@code null} if the supplied area is neither a single row nor a single column */ public static ValueVector createVector(TwoDEval ae) { if (ae.isColumn()) { @@ -158,7 +164,7 @@ final class LookupUtils { * changes behaviour when the evaluated 'mid' value has a different type to the lookup value.<p> * * A simple int might have done the same job, but there is risk in confusion with the well - * known <tt>Comparable.compareTo()</tt> and <tt>Comparator.compare()</tt> which both use + * known {@code Comparable.compareTo()} and {@code Comparator.compare()} which both use * a ubiquitous 3 value result encoding. */ public static final class CompareResult { @@ -241,8 +247,8 @@ final class LookupUtils { public interface LookupValueComparer { /** - * @return one of 4 instances or <tt>CompareResult</tt>: <tt>LESS_THAN</tt>, <tt>EQUAL</tt>, - * <tt>GREATER_THAN</tt> or <tt>TYPE_MISMATCH</tt> + * @return one of 4 instances or {@code CompareResult}: {@code LESS_THAN}, {@code EQUAL}, + * {@code GREATER_THAN} or {@code TYPE_MISMATCH} */ CompareResult compareTo(ValueEval other); } @@ -256,6 +262,7 @@ final class LookupUtils { } _targetClass = targetValue.getClass(); } + @Override public final CompareResult compareTo(ValueEval other) { if (other == null) { throw new RuntimeException("compare to value cannot be null"); @@ -291,6 +298,7 @@ final class LookupUtils { _isMatchFunction = isMatchFunction; } + @Override protected CompareResult compareSameType(ValueEval other) { StringEval se = (StringEval) other; @@ -307,6 +315,7 @@ final class LookupUtils { return CompareResult.valueOf(_value.compareToIgnoreCase(stringValue)); } + @Override protected String getValueAsString() { return _value; } @@ -318,10 +327,12 @@ final class LookupUtils { super(ne); _value = ne.getNumberValue(); } + @Override protected CompareResult compareSameType(ValueEval other) { NumberEval ne = (NumberEval) other; return CompareResult.valueOf(Double.compare(_value, ne.getNumberValue())); } + @Override protected String getValueAsString() { return String.valueOf(_value); } @@ -333,6 +344,7 @@ final class LookupUtils { super(be); _value = be.getBooleanValue(); } + @Override protected CompareResult compareSameType(ValueEval other) { BoolEval be = (BoolEval) other; boolean otherVal = be.getBooleanValue(); @@ -345,6 +357,7 @@ final class LookupUtils { } return CompareResult.LESS_THAN; } + @Override protected String getValueAsString() { return String.valueOf(_value); } @@ -430,7 +443,7 @@ final class LookupUtils { /** * Resolves the last (optional) parameter (<b>range_lookup</b>) to the VLOOKUP and HLOOKUP functions. - * @param rangeLookupArg must not be <code>null</code> + * @param rangeLookupArg must not be {@code null} */ public static boolean resolveRangeLookupArg(ValueEval rangeLookupArg, int srcCellRow, int srcCellCol) throws EvaluationException { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Match.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Match.java index 4a61476657..96dd7a3972 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Match.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Match.java @@ -64,12 +64,14 @@ import org.apache.poi.ss.formula.functions.LookupUtils.ValueVector; */ public final class Match extends Var2or3ArgFunction { + @Override public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1) { // default match_type is 1.0 return eval(srcRowIndex, srcColumnIndex, arg0, arg1, 1.0); } + @Override public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1, ValueEval arg2) { @@ -111,7 +113,8 @@ public final class Match extends Var2or3ArgFunction { _value = value; } - public ValueEval getItem(int index) { + @Override + public ValueEval getItem(int index) { if (index != 0) { throw new RuntimeException("Invalid index (" + index + ") only zero is allowed"); @@ -119,6 +122,7 @@ public final class Match extends Var2or3ArgFunction { return _value; } + @Override public int getSize() { return 1; } diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/MathX.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/MathX.java index 7b33de57ec..387a4e8397 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/MathX.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/MathX.java @@ -20,7 +20,6 @@ package org.apache.poi.ss.formula.functions; import org.apache.poi.ss.util.NumberToTextConverter; /** - * @author Amol S. Deshmukh < amolweb at ya hoo dot com > * This class is an extension to the standard math library * provided by java.lang.Math class. It follows the Math class * in that it has a private constructor and all static methods. diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/MatrixFunction.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/MatrixFunction.java index 4159ddcd98..db7380d9e9 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/MatrixFunction.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/MatrixFunction.java @@ -29,11 +29,8 @@ import org.apache.commons.math3.linear.Array2DRowRealMatrix; import org.apache.commons.math3.linear.LUDecomposition; import org.apache.commons.math3.linear.MatrixUtils; -/** - * @author Robert Hulbert - */ public abstract class MatrixFunction implements Function{ - + public static void checkValues(double[] results) throws EvaluationException { for (double result : results) { if (Double.isNaN(result) || Double.isInfinite(result)) { @@ -41,20 +38,20 @@ public abstract class MatrixFunction implements Function{ } } } - + protected final double singleOperandEvaluate(ValueEval arg, int srcCellRow, int srcCellCol) throws EvaluationException { ValueEval ve = OperandResolver.getSingleValue(arg, srcCellRow, srcCellCol); return OperandResolver.coerceValueToDouble(ve); } - + /* converts 1D array to 2D array for calculations */ private static double[][] fillDoubleArray(double[] vector, int rows, int cols) throws EvaluationException { int i = 0, j = 0; - + if (rows < 1 || cols < 1 || vector.length < 1) { throw new EvaluationException(ErrorEval.VALUE_INVALID); } - + double[][] matrix = new double[rows][cols]; for (double aVector : vector) { @@ -66,18 +63,18 @@ public abstract class MatrixFunction implements Function{ if (j < matrix.length) matrix[j][i++] = aVector; } } - + return matrix; } - + /* retrieves 1D array from 2D array after calculations */ private static double[] extractDoubleArray(double[][] matrix) throws EvaluationException { int idx = 0; - + if (matrix == null || matrix.length < 1 || matrix[0].length < 1) { throw new EvaluationException(ErrorEval.VALUE_INVALID); } - + double[] vector = new double[matrix.length * matrix[0].length]; for (double[] aMatrix : matrix) { @@ -87,19 +84,19 @@ public abstract class MatrixFunction implements Function{ } return vector; } - + public static abstract class OneArrayArg extends Fixed1ArgFunction { protected OneArrayArg() { //no fields to initialize } - + @Override public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0) { if (arg0 instanceof AreaEval) { double[] result; double[][] resultArray; int width, height; - + try { double[] values = collectValues(arg0); double[][] array = fillDoubleArray(values, ((AreaEval) arg0).getHeight(), ((AreaEval) arg0).getWidth()); @@ -107,7 +104,7 @@ public abstract class MatrixFunction implements Function{ width = resultArray[0].length; height = resultArray.length; result = extractDoubleArray(resultArray); - + checkValues(result); } catch(EvaluationException e){ @@ -115,18 +112,18 @@ public abstract class MatrixFunction implements Function{ } ValueEval[] vals = new ValueEval[result.length]; - + for (int idx = 0; idx < result.length; idx++) { vals[idx] = new NumberEval(result[idx]); } - + if (result.length == 1) { return vals[0]; } else { /* find a better solution */ - return new CacheAreaEval(((AreaEval) arg0).getFirstRow(), ((AreaEval) arg0).getFirstColumn(), - ((AreaEval) arg0).getFirstRow() + height - 1, + return new CacheAreaEval(((AreaEval) arg0).getFirstRow(), ((AreaEval) arg0).getFirstColumn(), + ((AreaEval) arg0).getFirstRow() + height - 1, ((AreaEval) arg0).getFirstColumn() + width - 1, vals); } } @@ -141,20 +138,20 @@ public abstract class MatrixFunction implements Function{ catch (EvaluationException e) { return e.getErrorEval(); } - + return new NumberEval(result[0][0]); } } - + protected abstract double[][] evaluate(double[][] d1) throws EvaluationException; protected abstract double[] collectValues(ValueEval arg) throws EvaluationException; } - + public static abstract class TwoArrayArg extends Fixed2ArgFunction { protected TwoArrayArg() { //no fields to initialize } - + @Override public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1) { double[] result; @@ -183,7 +180,7 @@ public abstract class MatrixFunction implements Function{ return e.getErrorEval(); } } - + if (arg1 instanceof AreaEval) { try { double[] values = collectValues(arg1); @@ -202,7 +199,7 @@ public abstract class MatrixFunction implements Function{ return e.getErrorEval(); } } - + resultArray = evaluate(array0, array1); width = resultArray[0].length; height = resultArray.length; @@ -218,26 +215,26 @@ public abstract class MatrixFunction implements Function{ ValueEval[] vals = new ValueEval[result.length]; - + for (int idx = 0; idx < result.length; idx++) { vals[idx] = new NumberEval(result[idx]); } - + if (result.length == 1) return vals[0]; else { - return new CacheAreaEval(((AreaEval) arg0).getFirstRow(), ((AreaEval) arg0).getFirstColumn(), - ((AreaEval) arg0).getFirstRow() + height - 1, + return new CacheAreaEval(((AreaEval) arg0).getFirstRow(), ((AreaEval) arg0).getFirstColumn(), + ((AreaEval) arg0).getFirstRow() + height - 1, ((AreaEval) arg0).getFirstColumn() + width - 1, vals); } - + } - + protected abstract double[][] evaluate(double[][] d1, double[][] d2) throws EvaluationException; protected abstract double[] collectValues(ValueEval arg) throws EvaluationException; } - + public static final class MutableValueCollector extends MultiOperandNumericFunction { public MutableValueCollector(boolean isReferenceBoolCounted, boolean isBlankCounted) { super(isReferenceBoolCounted, isBlankCounted); @@ -249,44 +246,44 @@ public abstract class MatrixFunction implements Function{ throw new IllegalStateException("should not be called"); } } - + public static final Function MINVERSE = new OneArrayArg() { private final MutableValueCollector instance = new MutableValueCollector(false, false); - + protected double[] collectValues(ValueEval arg) throws EvaluationException { double[] values = instance.collectValues(arg); - + /* handle case where MDETERM is operating on an array that that is not completely filled*/ if (arg instanceof AreaEval && values.length == 1) throw new EvaluationException(ErrorEval.VALUE_INVALID); - + return values; } - + protected double[][] evaluate(double[][] d1) throws EvaluationException { if (d1.length != d1[0].length) { throw new EvaluationException(ErrorEval.VALUE_INVALID); } - + Array2DRowRealMatrix temp = new Array2DRowRealMatrix(d1); return MatrixUtils.inverse(temp).getData(); } }; - + public static final Function TRANSPOSE = new OneArrayArg() { private final MutableValueCollector instance = new MutableValueCollector(false, true); - + protected double[] collectValues(ValueEval arg) throws EvaluationException { return instance.collectValues(arg); } - + protected double[][] evaluate(double[][] d1) throws EvaluationException { - + Array2DRowRealMatrix temp = new Array2DRowRealMatrix(d1); return temp.transpose().getData(); } }; - + public static final Function MDETERM = new Mdeterm(); private static class Mdeterm extends OneArrayArg { @@ -299,14 +296,14 @@ public abstract class MatrixFunction implements Function{ protected double[] collectValues(ValueEval arg) throws EvaluationException { double[] values = instance.collectValues(arg); - + /* handle case where MDETERM is operating on an array that that is not completely filled*/ if (arg instanceof AreaEval && values.length == 1) throw new EvaluationException(ErrorEval.VALUE_INVALID); return instance.collectValues(arg); } - + protected double[][] evaluate(double[][] d1) throws EvaluationException { if (d1.length != d1[0].length) { throw new EvaluationException(ErrorEval.VALUE_INVALID); @@ -318,32 +315,32 @@ public abstract class MatrixFunction implements Function{ return result; } } - + public static final Function MMULT = new TwoArrayArg() { private final MutableValueCollector instance = new MutableValueCollector(false, false); - + protected double[] collectValues(ValueEval arg) throws EvaluationException { double[] values = instance.collectValues(arg); - + /* handle case where MMULT is operating on an array that is not completely filled*/ if (arg instanceof AreaEval && values.length == 1) throw new EvaluationException(ErrorEval.VALUE_INVALID); - + return values; } - + protected double[][] evaluate(double[][] d1, double[][] d2) throws EvaluationException{ Array2DRowRealMatrix first = new Array2DRowRealMatrix(d1); Array2DRowRealMatrix second = new Array2DRowRealMatrix(d2); - + try { MatrixUtils.checkMultiplicationCompatible(first, second); } catch (DimensionMismatchException e) { throw new EvaluationException(ErrorEval.VALUE_INVALID); } - - return first.multiply(second).getData(); + + return first.multiply(second).getData(); } }; } diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/MinaMaxa.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/MinaMaxa.java index 247192273c..c7f892a7cf 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/MinaMaxa.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/MinaMaxa.java @@ -17,10 +17,6 @@ package org.apache.poi.ss.formula.functions; -/** - * @author Amol S. Deshmukh < amolweb at ya hoo dot com > - * - */ public abstract class MinaMaxa extends MultiOperandNumericFunction { protected MinaMaxa() { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Mirr.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Mirr.java index 764be8ac5b..d19e2d286f 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Mirr.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Mirr.java @@ -38,9 +38,6 @@ import org.apache.poi.ss.formula.eval.EvaluationException; * Finance_rate is the interest rate you pay on the money used in the cash flows. * Reinvest_rate is the interest rate you receive on the cash flows as you reinvest them. * - * @author Carlos Delgado (carlos dot del dot est at gmail dot com) - * @author Cedric Walter (cedric dot walter at gmail dot com) - * * @see <a href="http://en.wikipedia.org/wiki/MIRR">Wikipedia on MIRR</a> * @see <a href="http://office.microsoft.com/en-001/excel-help/mirr-HP005209180.aspx">Excel MIRR</a> * @see Irr diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Mode.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Mode.java index 978c9cad38..1c123f0d24 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Mode.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Mode.java @@ -31,10 +31,6 @@ import org.apache.poi.ss.formula.eval.RefEval; import org.apache.poi.ss.formula.eval.StringEval; import org.apache.poi.ss.formula.eval.ValueEval; -/** - * @author Amol S. Deshmukh < amolweb at ya hoo dot com > - * - */ public final class Mode implements Function { /** diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Npv.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Npv.java index 1c19b84c1e..774b1d84c8 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Npv.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Npv.java @@ -30,9 +30,6 @@ import org.apache.poi.ss.formula.eval.ValueEval; * values). Minimum 2 arguments, first arg is the rate of discount over the * length of one period others up to 254 arguments representing the payments and * income. - * - * @author SPetrakovsky - * @author Marcel May */ public final class Npv implements Function { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/NumericFunction.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/NumericFunction.java index 74597910b5..40c97c6473 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/NumericFunction.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/NumericFunction.java @@ -40,7 +40,7 @@ public abstract class NumericFunction implements Function { } /** - * @throws EvaluationException (#NUM!) if <tt>result</tt> is {@code NaN} or {@code Infinity} + * @throws EvaluationException (#NUM!) if {@code result} is {@code NaN} or {@code Infinity} */ public static void checkValue(double result) throws EvaluationException { if (Double.isNaN(result) || Double.isInfinite(result)) { @@ -48,6 +48,7 @@ public abstract class NumericFunction implements Function { } } + @Override public final ValueEval evaluate(ValueEval[] args, int srcCellRow, int srcCellCol) { double result; try { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Oct2Dec.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Oct2Dec.java index ae34904e02..260aa3cb1e 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Oct2Dec.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Oct2Dec.java @@ -36,8 +36,6 @@ import org.apache.poi.ss.formula.eval.ValueEval; * Negative numbers are represented using two's-complement notation.. * <p> * If number is not a valid octal number, OCT2DEC returns the #NUM! error value. - * - * @author cedric dot walter @ gmail dot com */ public class Oct2Dec extends Fixed1ArgFunction implements FreeRefFunction { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Offset.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Offset.java index 75aac0e780..25567a108b 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Offset.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Offset.java @@ -37,8 +37,6 @@ import org.apache.poi.ss.formula.eval.ValueEval; * <b>cols</b> is the number of columns left or right from the base reference.<br> * <b>height</b> (default same height as base reference) is the row count for the returned area reference.<br> * <b>width</b> (default same width as base reference) is the column count for the returned area reference.<br> - * - * @author Josh Micich */ public final class Offset implements Function { // These values are specific to BIFF8 @@ -79,7 +77,7 @@ public final class Offset implements Function { * * @param translationAmount may be zero negative or positive * - * @return the equivalent <tt>LinearOffsetRange</tt> with a positive length, moved by the + * @return the equivalent {@code LinearOffsetRange} with a positive length, moved by the * specified translationAmount. */ public LinearOffsetRange normaliseAndTranslate(int translationAmount) { @@ -93,20 +91,10 @@ public final class Offset implements Function { } public boolean isOutOfBounds(int lowValidIx, int highValidIx) { - if(_offset < lowValidIx) { - return true; - } - if(getLastIndex() > highValidIx) { - return true; - } - return false; + return _offset < lowValidIx || getLastIndex() > highValidIx; } public String toString() { - StringBuilder sb = new StringBuilder(64); - sb.append(getClass().getName()).append(" ["); - sb.append(_offset).append("...").append(getLastIndex()); - sb.append("]"); - return sb.toString(); + return getClass().getName() + " [" + _offset + "..." + getLastIndex() + "]"; } } @@ -161,6 +149,7 @@ public final class Offset implements Function { } } + @Override @SuppressWarnings("fallthrough") public ValueEval evaluate(ValueEval[] args, int srcCellRow, int srcCellCol) { if(args.length < 1 || args.length > 5) { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/PPMT.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/PPMT.java index 2df2304db1..d7284d9492 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/PPMT.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/PPMT.java @@ -23,8 +23,6 @@ import org.apache.poi.ss.formula.eval.*; /** * Compute the interest portion of a payment. - * - * @author Mike Argyriou micharg@gmail.com */ public class PPMT extends NumericFunction { @@ -49,10 +47,10 @@ public class PPMT extends NumericFunction { result = Finance.ppmt(interestRate, period, numberPayments, PV) ; checkValue(result); - + return result; } - + } diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Rank.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Rank.java index 97d0700e15..b6fdca0442 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Rank.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Rank.java @@ -40,8 +40,6 @@ import org.apache.poi.ss.formula.eval.ValueEval; * If order is 0 (zero) or omitted, Microsoft Excel ranks number as if ref were a list sorted in descending order. * If order is any nonzero value, Microsoft Excel ranks number as if ref were a list sorted in ascending order. - * - * @author Rubin Wang */ public class Rank extends Var2or3ArgFunction { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Rate.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Rate.java index d0a840f6b7..484be43a96 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Rate.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Rate.java @@ -31,6 +31,7 @@ import org.apache.poi.ss.formula.eval.ValueEval; public class Rate implements Function { private static final Logger LOG = LogManager.getLogger(Rate.class); + @Override public ValueEval evaluate(ValueEval[] args, int srcRowIndex, int srcColumnIndex) { if (args.length < 3) { //First 3 parameters are mandatory return ErrorEval.VALUE_INVALID; @@ -52,7 +53,7 @@ public class Rate implements Function { if (args.length >= 6) v6 = OperandResolver.getSingleValue(args[5], srcRowIndex, srcColumnIndex); - periods = OperandResolver.coerceValueToDouble(v1); + periods = OperandResolver.coerceValueToDouble(v1); payment = OperandResolver.coerceValueToDouble(v2); present_val = OperandResolver.coerceValueToDouble(v3); if (args.length >= 4) @@ -77,7 +78,7 @@ public class Rate implements Function { int FINANCIAL_MAX_ITERATIONS = 20;//Bet accuracy with 128 double FINANCIAL_PRECISION = 0.0000001;//1.0e-8 - double y, y0, y1, x0, x1 = 0, f = 0, i = 0; + double y, y0, y1, x0, x1, f = 0, i; double rate = guess; if (Math.abs(rate) < FINANCIAL_PRECISION) { y = pv * (1 + nper * rate) + pmt * (1 + rate * type) * nper + fv; @@ -112,8 +113,8 @@ public class Rate implements Function { /** * Excel does not support infinities and NaNs, rather, it gives a #NUM! error in these cases - * - * @throws EvaluationException (#NUM!) if <tt>result</tt> is <tt>NaN</> or <tt>Infinity</tt> + * + * @throws EvaluationException (#NUM!) if {@code result} is {@code NaN} or {@code Infinity} */ static void checkValue(double result) throws EvaluationException { if (Double.isNaN(result) || Double.isInfinite(result)) { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Replace.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Replace.java index 5b4eeabef2..b53e56b8ef 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Replace.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Replace.java @@ -34,8 +34,6 @@ import org.apache.poi.ss.formula.eval.ValueEval; * <b>startNum</b> The position of the first character to replace (1-based)<br> * <b>numChars</b> The number of characters to replace<br> * <b>newText</b> The new text value to replace the removed section<br> - * - * @author Manda Wilson < wilson at c bio dot msk cc dot org > */ public final class Replace extends Fixed4ArgFunction { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Rept.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Rept.java index 50dc559fab..952a1bed16 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Rept.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Rept.java @@ -37,8 +37,6 @@ import org.apache.poi.ss.formula.eval.ValueEval; * If this argument contains a decimal value, this function ignores the numbers to the right side of the decimal point. * * The result of the REPT function cannot be longer than 32,767 characters, or REPT returns #VALUE!. - * - * @author cedric dot walter @ gmail dot com */ public class Rept extends Fixed2ArgFunction { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Rows.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Rows.java index 1e363222ab..f5a6650688 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Rows.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Rows.java @@ -25,8 +25,6 @@ import org.apache.poi.ss.formula.TwoDEval; /** * Implementation for Excel ROWS function. - * - * @author Josh Micich */ public final class Rows extends Fixed1ArgFunction { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Slope.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Slope.java index cb8b07aee7..645ae933e7 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Slope.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Slope.java @@ -29,17 +29,14 @@ import org.apache.poi.ss.formula.functions.LinearRegressionFunction.FUNCTION; * (http://introcs.cs.princeton.edu/java/97data/LinearRegression.java.html) * <b>Syntax</b>:<br> * <b>SLOPE</b>(<b>arrayX</b>, <b>arrayY</b>)<p> - * - * - * @author Johan Karlsteen */ public final class Slope extends Fixed2ArgFunction { - + private final LinearRegressionFunction func; public Slope() { func = new LinearRegressionFunction(FUNCTION.SLOPE); } - + public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1) { return func.evaluate(srcRowIndex, srcColumnIndex, arg0, arg1); diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/StatsLib.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/StatsLib.java index 528a14c511..f7d79e0b5d 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/StatsLib.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/StatsLib.java @@ -20,8 +20,6 @@ package org.apache.poi.ss.formula.functions; import java.util.Arrays; /** - * @author Amol S. Deshmukh < amolweb at ya hoo dot com > - * * Library for common statistics functions */ final class StatsLib { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Substitute.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Substitute.java index 69d5cf5ec8..c20a0d1cd1 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Substitute.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Substitute.java @@ -25,7 +25,6 @@ import org.apache.poi.ss.formula.eval.ValueEval; /** * An implementation of the SUBSTITUTE function:<p> * Substitutes text in a text string with new text, some number of times. - * @author Manda Wilson < wilson at c bio dot msk cc dot org > */ public final class Substitute extends Var3or4ArgFunction { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Subtotal.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Subtotal.java index 8d7084be83..bbdb6c96e3 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Subtotal.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Subtotal.java @@ -71,8 +71,6 @@ import java.util.List; * * Not implemented in POI yet. Functions 101-111 are the same as functions 1-11 but with * the option 'ignore hidden values'. * <p> - * - * @author Paul Tomlin < pault at bulk sms dot com > */ public class Subtotal implements Function { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Sumif.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Sumif.java index ceeff9b1d1..5ae3f1cba1 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Sumif.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Sumif.java @@ -35,8 +35,6 @@ import org.apache.poi.ss.formula.functions.CountUtils.I_MatchPredicate; * <tr><th>criteria</th><td>The value or expression used to filter rows from <b>range</b></td></tr> * <tr><th>sum_range</th><td>Locates the top-left corner of the corresponding range of addends - values to be added (after being selected by the criteria)</td></tr> * </table><br> - * </p> - * @author Josh Micich */ public final class Sumif extends Var2or3ArgFunction { @@ -69,7 +67,7 @@ public final class Sumif extends Var2or3ArgFunction { AreaEval aeSum) { // TODO - junit to prove last arg must be srcColumnIndex and not srcRowIndex I_MatchPredicate mp = Countif.createCriteriaPredicate(arg1, srcRowIndex, srcColumnIndex); - + // handle empty cells if(mp == null) { return NumberEval.ZERO; diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Sumproduct.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Sumproduct.java index aea1fdb8ad..481e7f492d 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Sumproduct.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Sumproduct.java @@ -50,8 +50,6 @@ import org.apache.poi.ss.formula.eval.ValueEval; * A<b>n</b><sub>(<b>i</b>,<b>j</b>)</sub> * ) * ) - * </p> - * @author Josh Micich */ public final class Sumproduct implements Function { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Sumx2my2.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Sumx2my2.java index 28887a5bf0..2a091a32bd 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Sumx2my2.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Sumx2my2.java @@ -26,17 +26,17 @@ package org.apache.poi.ss.formula.functions; * <b>SUMX2MY2</b>(<b>arrayX</b>, <b>arrayY</b>)<p> * * result = Σ<sub>i: 0..n</sub>(x<sub>i</sub><sup>2</sup>-y<sub>i</sub><sup>2</sup>) - * - * @author Amol S. Deshmukh < amolweb at ya hoo dot com > */ public final class Sumx2my2 extends XYNumericFunction { private static final Accumulator XSquaredMinusYSquaredAccumulator = new Accumulator() { - public double accumulate(double x, double y) { + @Override + public double accumulate(double x, double y) { return x * x - y * y; } }; + @Override protected Accumulator createAccumulator() { return XSquaredMinusYSquaredAccumulator; } diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Sumx2py2.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Sumx2py2.java index cae17d7e35..c5e894ddd5 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Sumx2py2.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Sumx2py2.java @@ -26,17 +26,17 @@ package org.apache.poi.ss.formula.functions; * <b>SUMX2PY2</b>(<b>arrayX</b>, <b>arrayY</b>)<p> * * result = Σ<sub>i: 0..n</sub>(x<sub>i</sub><sup>2</sup>+y<sub>i</sub><sup>2</sup>) - * - * @author Amol S. Deshmukh < amolweb at ya hoo dot com > */ public final class Sumx2py2 extends XYNumericFunction { private static final Accumulator XSquaredPlusYSquaredAccumulator = new Accumulator() { - public double accumulate(double x, double y) { + @Override + public double accumulate(double x, double y) { return x * x + y * y; } }; + @Override protected Accumulator createAccumulator() { return XSquaredPlusYSquaredAccumulator; } diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Sumxmy2.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Sumxmy2.java index 1d5effa0cc..f8cf7400d4 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Sumxmy2.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Sumxmy2.java @@ -25,18 +25,18 @@ package org.apache.poi.ss.formula.functions; * <b>SUMXMY2</b>(<b>arrayX</b>, <b>arrayY</b>)<p> * * result = Σ<sub>i: 0..n</sub>(x<sub>i</sub>-y<sub>i</sub>)<sup>2</sup> - * - * @author Amol S. Deshmukh < amolweb at ya hoo dot com > */ public final class Sumxmy2 extends XYNumericFunction { private static final Accumulator XMinusYSquaredAccumulator = new Accumulator() { - public double accumulate(double x, double y) { + @Override + public double accumulate(double x, double y) { double xmy = x - y; return xmy * xmy; } }; + @Override protected Accumulator createAccumulator() { return XMinusYSquaredAccumulator; } diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/TextFunction.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/TextFunction.java index f344d57ca5..d934825d54 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/TextFunction.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/TextFunction.java @@ -19,7 +19,6 @@ package org.apache.poi.ss.formula.functions; import java.util.Locale; -import org.apache.poi.ss.formula.OperationEvaluationContext; import org.apache.poi.ss.formula.eval.AreaEval; import org.apache.poi.ss.formula.eval.BoolEval; import org.apache.poi.ss.formula.eval.ErrorEval; @@ -30,11 +29,6 @@ import org.apache.poi.ss.formula.eval.StringEval; import org.apache.poi.ss.formula.eval.ValueEval; import org.apache.poi.ss.usermodel.DataFormatter; -/** - * @author Amol S. Deshmukh < amolweb at ya hoo dot com > - * @author Josh Micich - * @author Stephen Wolke (smwolke at geistig.com) - */ public abstract class TextFunction implements Function { protected static final DataFormatter formatter = new DataFormatter(); @@ -52,6 +46,7 @@ public abstract class TextFunction implements Function { return OperandResolver.coerceValueToDouble(ve); } + @Override public final ValueEval evaluate(ValueEval[] args, int srcCellRow, int srcCellCol) { try { return evaluateFunc(args, srcCellRow, srcCellCol); @@ -69,6 +64,7 @@ public abstract class TextFunction implements Function { protected SingleArgTextFunc() { // no fields to initialise } + @Override public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0) { String arg; try { @@ -85,7 +81,8 @@ public abstract class TextFunction implements Function { * Returns the character specified by a number. */ public static final Function CHAR = new Fixed1ArgFunction() { - public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0) { + @Override + public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0) { int arg; try { arg = evaluateIntArg(arg0, srcRowIndex, srcColumnIndex); @@ -101,16 +98,19 @@ public abstract class TextFunction implements Function { }; public static final Function LEN = new SingleArgTextFunc() { + @Override protected ValueEval evaluate(String arg) { return new NumberEval(arg.length()); } }; public static final Function LOWER = new SingleArgTextFunc() { + @Override protected ValueEval evaluate(String arg) { return new StringEval(arg.toLowerCase(Locale.ROOT)); } }; public static final Function UPPER = new SingleArgTextFunc() { + @Override protected ValueEval evaluate(String arg) { return new StringEval(arg.toUpperCase(Locale.ROOT)); } @@ -124,6 +124,7 @@ public abstract class TextFunction implements Function { * This is nearly equivalent to toTitleCase if the Java language had it */ public static final Function PROPER = new SingleArgTextFunc() { + @Override protected ValueEval evaluate(String text) { StringBuilder sb = new StringBuilder(); boolean shouldMakeUppercase = true; @@ -151,6 +152,7 @@ public abstract class TextFunction implements Function { * Author: Manda Wilson < wilson at c bio dot msk cc dot org > */ public static final Function TRIM = new SingleArgTextFunc() { + @Override protected ValueEval evaluate(String arg) { return new StringEval(arg.trim()); } @@ -163,7 +165,8 @@ public abstract class TextFunction implements Function { * Author: Aniket Banerjee(banerjee@google.com) */ public static final Function CLEAN = new SingleArgTextFunc() { - protected ValueEval evaluate(String arg) { + @Override + protected ValueEval evaluate(String arg) { StringBuilder result = new StringBuilder(); for (final char c : arg.toCharArray()) { if (isPrintable(c)) { @@ -201,6 +204,7 @@ public abstract class TextFunction implements Function { */ public static final Function MID = new Fixed3ArgFunction() { + @Override public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1, ValueEval arg2) { String text; @@ -239,9 +243,11 @@ public abstract class TextFunction implements Function { protected LeftRight(boolean isLeft) { _isLeft = isLeft; } + @Override public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0) { return evaluate(srcRowIndex, srcColumnIndex, arg0, DEFAULT_ARG1); } + @Override public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1) { String arg; @@ -270,45 +276,43 @@ public abstract class TextFunction implements Function { public static final Function LEFT = new LeftRight(true); public static final Function RIGHT = new LeftRight(false); - public static final FreeRefFunction CONCAT = new FreeRefFunction() { - public ValueEval evaluate(ValueEval[] args, OperationEvaluationContext ec) { - StringBuilder sb = new StringBuilder(); - for (ValueEval arg : args) { - try { - if (arg instanceof AreaEval) { - AreaEval area = (AreaEval)arg; - for (int rn=0; rn<area.getHeight(); rn++) { - for (int cn=0; cn<area.getWidth(); cn++) { - ValueEval ve = area.getRelativeValue(rn, cn); - sb.append(evaluateStringArg(ve, ec.getRowIndex(), ec.getColumnIndex())); - } - } - } else { - sb.append(evaluateStringArg(arg, ec.getRowIndex(), ec.getColumnIndex())); - } - } catch (EvaluationException e) { - return e.getErrorEval(); - } - } - return new StringEval(sb.toString()); - } + public static final FreeRefFunction CONCAT = (args, ec) -> { + StringBuilder sb = new StringBuilder(); + for (ValueEval arg : args) { + try { + if (arg instanceof AreaEval) { + AreaEval area = (AreaEval)arg; + for (int rn=0; rn<area.getHeight(); rn++) { + for (int cn=0; cn<area.getWidth(); cn++) { + ValueEval ve = area.getRelativeValue(rn, cn); + sb.append(evaluateStringArg(ve, ec.getRowIndex(), ec.getColumnIndex())); + } + } + } else { + sb.append(evaluateStringArg(arg, ec.getRowIndex(), ec.getColumnIndex())); + } + } catch (EvaluationException e) { + return e.getErrorEval(); + } + } + return new StringEval(sb.toString()); }; - public static final Function CONCATENATE = new Function() { - public ValueEval evaluate(ValueEval[] args, int srcRowIndex, int srcColumnIndex) { - StringBuilder sb = new StringBuilder(); - for (ValueEval arg : args) { - try { - sb.append(evaluateStringArg(arg, srcRowIndex, srcColumnIndex)); - } catch (EvaluationException e) { - return e.getErrorEval(); - } - } - return new StringEval(sb.toString()); - } + + public static final Function CONCATENATE = (args, srcRowIndex, srcColumnIndex) -> { + StringBuilder sb = new StringBuilder(); + for (ValueEval arg : args) { + try { + sb.append(evaluateStringArg(arg, srcRowIndex, srcColumnIndex)); + } catch (EvaluationException e) { + return e.getErrorEval(); + } + } + return new StringEval(sb.toString()); }; public static final Function EXACT = new Fixed2ArgFunction() { + @Override public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1) { String s0; @@ -335,6 +339,7 @@ public abstract class TextFunction implements Function { */ public static final Function TEXT = new Fixed2ArgFunction() { + @Override public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1) { double s0; String s1; @@ -362,6 +367,7 @@ public abstract class TextFunction implements Function { public SearchFind(boolean isCaseSensitive) { _isCaseSensitive = isCaseSensitive; } + @Override public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1) { try { String needle = TextFunction.evaluateStringArg(arg0, srcRowIndex, srcColumnIndex); @@ -371,6 +377,7 @@ public abstract class TextFunction implements Function { return e.getErrorEval(); } } + @Override public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1, ValueEval arg2) { try { @@ -407,8 +414,8 @@ public abstract class TextFunction implements Function { * <b>FIND</b>(<b>find_text</b>, <b>within_text</b>, start_num)<p> * * FIND returns the character position of the first (case sensitive) occurrence of - * <tt>find_text</tt> inside <tt>within_text</tt>. The third parameter, - * <tt>start_num</tt>, is optional (default=1) and specifies where to start searching + * {@code find_text} inside {@code within_text}. The third parameter, + * {@code start_num}, is optional (default=1) and specifies where to start searching * from. Character positions are 1-based.<p> * * Author: Torstein Tauno Svendsen (torstei@officenet.no) diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/TimeFunc.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/TimeFunc.java index 8423919e1a..c9674ea024 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/TimeFunc.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/TimeFunc.java @@ -25,9 +25,7 @@ import org.apache.poi.ss.formula.eval.OperandResolver; import org.apache.poi.ss.formula.eval.ValueEval; /** - * Implementation for the Excel function TIME - * - * @author Steven Butler (sebutler @ gmail dot com) + * Implementation for the Excel function TIME<p> * * Based on POI {@link DateFunc} */ diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Var1or2ArgFunction.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Var1or2ArgFunction.java index 1938b79d3b..af37016e41 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Var1or2ArgFunction.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Var1or2ArgFunction.java @@ -21,10 +21,7 @@ import org.apache.poi.ss.formula.eval.ErrorEval; import org.apache.poi.ss.formula.eval.ValueEval; /** - * Convenience base class for any function which must take two or three - * arguments - * - * @author Josh Micich + * Convenience base class for any function which must take two or three arguments */ abstract class Var1or2ArgFunction implements Function1Arg, Function2Arg { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Var2or3ArgFunction.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Var2or3ArgFunction.java index cf3f350d6e..f11281b021 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Var2or3ArgFunction.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Var2or3ArgFunction.java @@ -21,10 +21,7 @@ import org.apache.poi.ss.formula.eval.ErrorEval; import org.apache.poi.ss.formula.eval.ValueEval; /** - * Convenience base class for any function which must take two or three - * arguments - * - * @author Josh Micich + * Convenience base class for any function which must take two or three arguments */ abstract class Var2or3ArgFunction implements Function2Arg, Function3Arg { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Var3or4ArgFunction.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Var3or4ArgFunction.java index e701b2d9a2..874f338305 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Var3or4ArgFunction.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Var3or4ArgFunction.java @@ -21,10 +21,7 @@ import org.apache.poi.ss.formula.eval.ErrorEval; import org.apache.poi.ss.formula.eval.ValueEval; /** - * Convenience base class for any function which must take three or four - * arguments - * - * @author Josh Micich + * Convenience base class for any function which must take three or four arguments */ abstract class Var3or4ArgFunction implements Function3Arg, Function4Arg { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/Vlookup.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/Vlookup.java index a2daa856e4..12f12dd389 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/Vlookup.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/Vlookup.java @@ -40,11 +40,13 @@ import org.apache.poi.ss.formula.TwoDEval; public final class Vlookup extends Var3or4ArgFunction { private static final ValueEval DEFAULT_ARG3 = BoolEval.TRUE; + @Override public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1, ValueEval arg2) { return evaluate(srcRowIndex, srcColumnIndex, arg0, arg1, arg2, DEFAULT_ARG3); } + @Override public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval lookup_value, ValueEval table_array, ValueEval col_index, ValueEval range_lookup) { try { @@ -69,7 +71,7 @@ public final class Vlookup extends Var3or4ArgFunction { /** - * Returns one column from an <tt>AreaEval</tt> + * Returns one column from an {@code AreaEval} * * @param colIndex assumed to be non-negative * diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/WeekdayFunc.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/WeekdayFunc.java index 184866e7c2..48a858b901 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/WeekdayFunc.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/WeekdayFunc.java @@ -33,8 +33,6 @@ import org.apache.poi.ss.usermodel.DateUtil; /** * Implementation for the Excel function WEEKDAY - * - * @author Thies Wellpott */ public final class WeekdayFunc implements Function { //or: extends Var1or2ArgFunction { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/XYNumericFunction.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/XYNumericFunction.java index da2a0f3127..033ca01009 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/XYNumericFunction.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/XYNumericFunction.java @@ -25,9 +25,6 @@ import org.apache.poi.ss.formula.eval.RefEval; import org.apache.poi.ss.formula.eval.ValueEval; import org.apache.poi.ss.formula.functions.LookupUtils.ValueVector; -/** - * @author Amol S. Deshmukh < amolweb at ya hoo dot com > - */ public abstract class XYNumericFunction extends Fixed2ArgFunction { private static abstract class ValueArray implements ValueVector { @@ -35,7 +32,8 @@ public abstract class XYNumericFunction extends Fixed2ArgFunction { protected ValueArray(int size) { _size = size; } - public ValueEval getItem(int index) { + @Override + public ValueEval getItem(int index) { if (index < 0 || index > _size) { throw new IllegalArgumentException("Specified index " + index + " is outside range (0.." + (_size - 1) + ")"); @@ -43,6 +41,7 @@ public abstract class XYNumericFunction extends Fixed2ArgFunction { return getItemInternal(index); } protected abstract ValueEval getItemInternal(int index); + @Override public final int getSize() { return _size; } @@ -54,6 +53,7 @@ public abstract class XYNumericFunction extends Fixed2ArgFunction { super(1); _value = value; } + @Override protected ValueEval getItemInternal(int index) { return _value; } @@ -62,14 +62,15 @@ public abstract class XYNumericFunction extends Fixed2ArgFunction { private static final class RefValueArray extends ValueArray { private final RefEval _ref; private final int _width; - + public RefValueArray(RefEval ref) { super(ref.getNumberOfSheets()); _ref = ref; _width = ref.getNumberOfSheets(); } + @Override protected ValueEval getItemInternal(int index) { - int sIx = (index % _width) + _ref.getFirstSheetIndex(); + int sIx = (index % _width) + _ref.getFirstSheetIndex(); return _ref.getInnerValueEval(sIx); } } @@ -83,6 +84,7 @@ public abstract class XYNumericFunction extends Fixed2ArgFunction { _ae = ae; _width = ae.getWidth(); } + @Override protected ValueEval getItemInternal(int index) { int rowIx = index / _width; int colIx = index % _width; @@ -90,7 +92,7 @@ public abstract class XYNumericFunction extends Fixed2ArgFunction { } } - protected static interface Accumulator { + protected interface Accumulator { double accumulate(double x, double y); } @@ -99,6 +101,7 @@ public abstract class XYNumericFunction extends Fixed2ArgFunction { */ protected abstract Accumulator createAccumulator(); + @Override public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1) { double result; diff --git a/poi/src/main/java/org/apache/poi/ss/formula/ptg/AbstractFunctionPtg.java b/poi/src/main/java/org/apache/poi/ss/formula/ptg/AbstractFunctionPtg.java index bc77d6049b..5003f20be1 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/ptg/AbstractFunctionPtg.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/ptg/AbstractFunctionPtg.java @@ -55,6 +55,7 @@ public abstract class AbstractFunctionPtg extends OperationPtg { returnClass = (byte) pReturnClass; paramClass = paramTypes; } + @Override public final boolean isBaseToken() { return false; } @@ -62,6 +63,7 @@ public abstract class AbstractFunctionPtg extends OperationPtg { public final short getFunctionIndex() { return _functionIndex; } + @Override public final int getNumberOfOperands() { return _numberOfArgs; } @@ -71,16 +73,18 @@ public abstract class AbstractFunctionPtg extends OperationPtg { } /** * external functions get some special processing - * @return <code>true</code> if this is an external function + * @return {@code true} if this is an external function */ public final boolean isExternalFunction() { return _functionIndex == FUNCTION_INDEX_EXTERNAL; } + @Override public final String toFormulaString() { return getName(); } + @Override public String toFormulaString(String[] operands) { StringBuilder buf = new StringBuilder(); @@ -105,6 +109,7 @@ public abstract class AbstractFunctionPtg extends OperationPtg { buf.append(")"); } + @Override public abstract int getSize(); @@ -112,8 +117,8 @@ public abstract class AbstractFunctionPtg extends OperationPtg { * Used to detect whether a function name found in a formula is one of the standard excel functions * <p> * The name matching is case insensitive. - * @return <code>true</code> if the name specifies a standard worksheet function, - * <code>false</code> if the name should be assumed to be an external function. + * @return {@code true} if the name specifies a standard worksheet function, + * {@code false} if the name should be assumed to be an external function. */ public static boolean isBuiltInFunctionName(String name) { short ix = FunctionMetadataRegistry.lookupIndexByName(name.toUpperCase(Locale.ROOT)); @@ -144,7 +149,7 @@ public abstract class AbstractFunctionPtg extends OperationPtg { * Resolves internal function names into function indexes. * <p> * The name matching is case insensitive. - * @return the standard worksheet function index if found, otherwise <tt>FUNCTION_INDEX_EXTERNAL</tt> + * @return the standard worksheet function index if found, otherwise {@code FUNCTION_INDEX_EXTERNAL} */ protected static short lookupIndex(String name) { short ix = FunctionMetadataRegistry.lookupIndexByName(name.toUpperCase(Locale.ROOT)); @@ -154,6 +159,7 @@ public abstract class AbstractFunctionPtg extends OperationPtg { return ix; } + @Override public byte getDefaultOperandClass() { return returnClass; } diff --git a/poi/src/main/java/org/apache/poi/ss/formula/ptg/AreaErrPtg.java b/poi/src/main/java/org/apache/poi/ss/formula/ptg/AreaErrPtg.java index 911abbf5bc..a9f650e0db 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/ptg/AreaErrPtg.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/ptg/AreaErrPtg.java @@ -54,7 +54,8 @@ public final class AreaErrPtg extends OperandPtg { return FormulaError.REF.getString(); } - public byte getDefaultOperandClass() { + @Override + public byte getDefaultOperandClass() { return Ptg.CLASS_REF; } diff --git a/poi/src/main/java/org/apache/poi/ss/formula/ptg/AreaNPtg.java b/poi/src/main/java/org/apache/poi/ss/formula/ptg/AreaNPtg.java index 0ac7d5e74d..5cdfbd22e7 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/ptg/AreaNPtg.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/ptg/AreaNPtg.java @@ -21,7 +21,6 @@ import org.apache.poi.util.LittleEndianInput; /** * Specifies a rectangular area of cells A1:A4 for instance. - * @author Jason Height (jheight at chariot dot net dot au) */ public final class AreaNPtg extends Area2DPtgBase { public static final short sid = 0x2D; diff --git a/poi/src/main/java/org/apache/poi/ss/formula/ptg/AreaPtgBase.java b/poi/src/main/java/org/apache/poi/ss/formula/ptg/AreaPtgBase.java index 5fbefc365e..496300720b 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/ptg/AreaPtgBase.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/ptg/AreaPtgBase.java @@ -297,6 +297,7 @@ public abstract class AreaPtgBase extends OperandPtg implements AreaI { return formatReferenceAsString(); } + @Override public byte getDefaultOperandClass() { return Ptg.CLASS_REF; } diff --git a/poi/src/main/java/org/apache/poi/ss/formula/ptg/ArrayInitialPtg.java b/poi/src/main/java/org/apache/poi/ss/formula/ptg/ArrayInitialPtg.java index f242fb2b39..2c5a4295f1 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/ptg/ArrayInitialPtg.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/ptg/ArrayInitialPtg.java @@ -44,12 +44,14 @@ final class ArrayInitialPtg extends Ptg { private static RuntimeException invalid() { throw new IllegalStateException("This object is a partially initialised tArray, and cannot be used as a Ptg"); } - public byte getDefaultOperandClass() { + @Override + public byte getDefaultOperandClass() { throw invalid(); } public int getSize() { return ArrayPtg.PLAIN_TOKEN_SIZE; } + @Override public boolean isBaseToken() { return false; } diff --git a/poi/src/main/java/org/apache/poi/ss/formula/ptg/ArrayPtg.java b/poi/src/main/java/org/apache/poi/ss/formula/ptg/ArrayPtg.java index aff4aa3918..e1217b70bf 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/ptg/ArrayPtg.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/ptg/ArrayPtg.java @@ -113,6 +113,7 @@ public final class ArrayPtg extends Ptg { return result; } + @Override public boolean isBaseToken() { return false; } @@ -208,7 +209,8 @@ public final class ArrayPtg extends Ptg { throw new IllegalArgumentException("Unexpected constant class (" + o.getClass().getName() + ")"); } - public byte getDefaultOperandClass() { + @Override + public byte getDefaultOperandClass() { return Ptg.CLASS_ARRAY; } diff --git a/poi/src/main/java/org/apache/poi/ss/formula/ptg/AttrPtg.java b/poi/src/main/java/org/apache/poi/ss/formula/ptg/AttrPtg.java index 99e0ea0c10..bcf9732b2f 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/ptg/AttrPtg.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/ptg/AttrPtg.java @@ -104,7 +104,7 @@ public final class AttrPtg extends ControlPtg { } /** - * @param type a constant from <tt>SpaceType</tt> + * @param type a constant from {@code SpaceType} * @param count the number of space characters */ public static AttrPtg createSpace(int type, int count) { @@ -173,6 +173,7 @@ public final class AttrPtg extends ControlPtg { return _chooseFuncOffset; } + @Override public void write(LittleEndianOutput out) { out.writeByte(sid + getPtgClass()); out.writeByte(_options); @@ -191,6 +192,7 @@ public final class AttrPtg extends ControlPtg { return sid; } + @Override public int getSize() { if (_jumpTable != null) { return SIZE + (_jumpTable.length + 1) * LittleEndianConsts.SHORT_SIZE; @@ -219,6 +221,7 @@ public final class AttrPtg extends ControlPtg { return -1; } + @Override public String toFormulaString() { if (semiVolatile.isSet(_options)) { return "ATTR(semiVolatile)"; diff --git a/poi/src/main/java/org/apache/poi/ss/formula/ptg/ControlPtg.java b/poi/src/main/java/org/apache/poi/ss/formula/ptg/ControlPtg.java index a206b5dbe9..86425a0f6a 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/ptg/ControlPtg.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/ptg/ControlPtg.java @@ -21,10 +21,12 @@ public abstract class ControlPtg extends Ptg { protected ControlPtg() {} + @Override public boolean isBaseToken() { return true; } - public final byte getDefaultOperandClass() { + @Override + public final byte getDefaultOperandClass() { throw new IllegalStateException("Control tokens are not classified"); } } diff --git a/poi/src/main/java/org/apache/poi/ss/formula/ptg/Deleted3DPxg.java b/poi/src/main/java/org/apache/poi/ss/formula/ptg/Deleted3DPxg.java index b58b8e5298..5db3fa838b 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/ptg/Deleted3DPxg.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/ptg/Deleted3DPxg.java @@ -74,6 +74,7 @@ public final class Deleted3DPxg extends OperandPtg implements Pxg { return sb.toString(); } + @Override public byte getDefaultOperandClass() { return Ptg.CLASS_VALUE; } diff --git a/poi/src/main/java/org/apache/poi/ss/formula/ptg/DeletedArea3DPtg.java b/poi/src/main/java/org/apache/poi/ss/formula/ptg/DeletedArea3DPtg.java index 1143dc5e7b..71dfd66f16 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/ptg/DeletedArea3DPtg.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/ptg/DeletedArea3DPtg.java @@ -56,7 +56,8 @@ public final class DeletedArea3DPtg extends OperandPtg implements WorkbookDepend public String toFormulaString() { throw new RuntimeException("3D references need a workbook to determine formula text"); } - public byte getDefaultOperandClass() { + @Override + public byte getDefaultOperandClass() { return Ptg.CLASS_REF; } diff --git a/poi/src/main/java/org/apache/poi/ss/formula/ptg/DeletedRef3DPtg.java b/poi/src/main/java/org/apache/poi/ss/formula/ptg/DeletedRef3DPtg.java index 04908988d1..d43e3ced93 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/ptg/DeletedRef3DPtg.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/ptg/DeletedRef3DPtg.java @@ -56,7 +56,8 @@ public final class DeletedRef3DPtg extends OperandPtg implements WorkbookDepende public String toFormulaString() { throw new RuntimeException("3D references need a workbook to determine formula text"); } - public byte getDefaultOperandClass() { + @Override + public byte getDefaultOperandClass() { return Ptg.CLASS_REF; } diff --git a/poi/src/main/java/org/apache/poi/ss/formula/ptg/EqualPtg.java b/poi/src/main/java/org/apache/poi/ss/formula/ptg/EqualPtg.java index b95a4b4262..e2492aa840 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/ptg/EqualPtg.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/ptg/EqualPtg.java @@ -17,10 +17,6 @@ package org.apache.poi.ss.formula.ptg; -/** - * - * @author andy - */ public final class EqualPtg extends ValueOperatorPtg { public static final byte sid = 0x0b; diff --git a/poi/src/main/java/org/apache/poi/ss/formula/ptg/ExternSheetNameResolver.java b/poi/src/main/java/org/apache/poi/ss/formula/ptg/ExternSheetNameResolver.java index 2717662d2b..3a35909cc2 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/ptg/ExternSheetNameResolver.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/ptg/ExternSheetNameResolver.java @@ -22,9 +22,6 @@ import org.apache.poi.ss.formula.EvaluationWorkbook.ExternalSheetRange; import org.apache.poi.ss.formula.FormulaRenderingWorkbook; import org.apache.poi.ss.formula.SheetNameFormatter; -/** - * @author Josh Micich - */ final class ExternSheetNameResolver { private ExternSheetNameResolver() { // no instances of this class diff --git a/poi/src/main/java/org/apache/poi/ss/formula/ptg/IntPtg.java b/poi/src/main/java/org/apache/poi/ss/formula/ptg/IntPtg.java index 977c8b6bc4..642201a422 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/ptg/IntPtg.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/ptg/IntPtg.java @@ -35,8 +35,8 @@ public final class IntPtg extends ScalarConstantPtg { /** * Excel represents integers 0..65535 with the tInt token. * - * @return <code>true</code> if the specified value is within the range of values - * <tt>IntPtg</tt> can represent. + * @return {@code true} if the specified value is within the range of values + * {@code IntPtg} can represent. */ public static boolean isInRange(int i) { return i >= MIN_VALUE && i <= MAX_VALUE; @@ -61,6 +61,7 @@ public final class IntPtg extends ScalarConstantPtg { return field_1_value; } + @Override public void write(LittleEndianOutput out) { out.writeByte(sid + getPtgClass()); out.writeShort(getValue()); @@ -71,10 +72,12 @@ public final class IntPtg extends ScalarConstantPtg { return sid; } + @Override public int getSize() { return SIZE; } + @Override public String toFormulaString() { return String.valueOf(getValue()); } diff --git a/poi/src/main/java/org/apache/poi/ss/formula/ptg/IntersectionPtg.java b/poi/src/main/java/org/apache/poi/ss/formula/ptg/IntersectionPtg.java index 963564ad71..a8871bfd62 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/ptg/IntersectionPtg.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/ptg/IntersectionPtg.java @@ -28,7 +28,8 @@ public final class IntersectionPtg extends OperationPtg { // enforce singleton } - public final boolean isBaseToken() { + @Override + public final boolean isBaseToken() { return true; } diff --git a/poi/src/main/java/org/apache/poi/ss/formula/ptg/MemAreaPtg.java b/poi/src/main/java/org/apache/poi/ss/formula/ptg/MemAreaPtg.java index 18a00eed8b..37f6dd265a 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/ptg/MemAreaPtg.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/ptg/MemAreaPtg.java @@ -65,7 +65,8 @@ public final class MemAreaPtg extends OperandPtg { return ""; // TODO: Not sure how to format this. -- DN } - public byte getDefaultOperandClass() { + @Override + public byte getDefaultOperandClass() { return Ptg.CLASS_VALUE; } diff --git a/poi/src/main/java/org/apache/poi/ss/formula/ptg/MemErrPtg.java b/poi/src/main/java/org/apache/poi/ss/formula/ptg/MemErrPtg.java index 41adefcaff..cac2e38fbe 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/ptg/MemErrPtg.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/ptg/MemErrPtg.java @@ -60,7 +60,8 @@ public final class MemErrPtg extends OperandPtg { return "ERR#"; } - public byte getDefaultOperandClass() { + @Override + public byte getDefaultOperandClass() { return Ptg.CLASS_VALUE; } diff --git a/poi/src/main/java/org/apache/poi/ss/formula/ptg/MemFuncPtg.java b/poi/src/main/java/org/apache/poi/ss/formula/ptg/MemFuncPtg.java index 548f15f1b4..5ba8d950f7 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/ptg/MemFuncPtg.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/ptg/MemFuncPtg.java @@ -59,7 +59,8 @@ public final class MemFuncPtg extends OperandPtg { return ""; } - public byte getDefaultOperandClass() { + @Override + public byte getDefaultOperandClass() { return Ptg.CLASS_REF; } diff --git a/poi/src/main/java/org/apache/poi/ss/formula/ptg/NameXPtg.java b/poi/src/main/java/org/apache/poi/ss/formula/ptg/NameXPtg.java index 5ca85df72f..4f8835ed80 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/ptg/NameXPtg.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/ptg/NameXPtg.java @@ -87,7 +87,8 @@ public final class NameXPtg extends OperandPtg implements WorkbookDependentFormu throw new RuntimeException("3D references need a workbook to determine formula text"); } - public byte getDefaultOperandClass() { + @Override + public byte getDefaultOperandClass() { return Ptg.CLASS_VALUE; } diff --git a/poi/src/main/java/org/apache/poi/ss/formula/ptg/NameXPxg.java b/poi/src/main/java/org/apache/poi/ss/formula/ptg/NameXPxg.java index 8ed4c9c43f..2b357b7166 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/ptg/NameXPxg.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/ptg/NameXPxg.java @@ -90,6 +90,7 @@ public final class NameXPxg extends OperandPtg implements Pxg { return sb.toString(); } + @Override public byte getDefaultOperandClass() { return Ptg.CLASS_VALUE; } diff --git a/poi/src/main/java/org/apache/poi/ss/formula/ptg/NumberPtg.java b/poi/src/main/java/org/apache/poi/ss/formula/ptg/NumberPtg.java index ed6f15f1ee..996e7bed17 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/ptg/NumberPtg.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/ptg/NumberPtg.java @@ -57,6 +57,7 @@ public final class NumberPtg extends ScalarConstantPtg { return field_1_value; } + @Override public void write(LittleEndianOutput out) { out.writeByte(sid + getPtgClass()); out.writeDouble(getValue()); @@ -67,10 +68,12 @@ public final class NumberPtg extends ScalarConstantPtg { return sid; } + @Override public int getSize() { return SIZE; } + @Override public String toFormulaString() { return NumberToTextConverter.toText(field_1_value); } diff --git a/poi/src/main/java/org/apache/poi/ss/formula/ptg/OperandPtg.java b/poi/src/main/java/org/apache/poi/ss/formula/ptg/OperandPtg.java index 1f1ab3c761..f216e17c97 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/ptg/OperandPtg.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/ptg/OperandPtg.java @@ -28,7 +28,8 @@ public abstract class OperandPtg extends Ptg { /** * All Operand {@link Ptg}s are classified ('relative', 'value', 'array') */ - public final boolean isBaseToken() { + @Override + public final boolean isBaseToken() { return false; } diff --git a/poi/src/main/java/org/apache/poi/ss/formula/ptg/OperationPtg.java b/poi/src/main/java/org/apache/poi/ss/formula/ptg/OperationPtg.java index 111f58b4e6..795c1e37b6 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/ptg/OperationPtg.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/ptg/OperationPtg.java @@ -22,7 +22,6 @@ import java.util.function.Supplier; /** * defines a Ptg that is an operation instead of an operand - * @author andy */ public abstract class OperationPtg extends Ptg { public static final int TYPE_UNARY = 0; @@ -44,6 +43,7 @@ public abstract class OperationPtg extends Ptg { */ public abstract int getNumberOfOperands(); + @Override public byte getDefaultOperandClass() { return Ptg.CLASS_VALUE; } diff --git a/poi/src/main/java/org/apache/poi/ss/formula/ptg/Ptg.java b/poi/src/main/java/org/apache/poi/ss/formula/ptg/Ptg.java index 3651ab93b2..1263540f74 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/ptg/Ptg.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/ptg/Ptg.java @@ -28,16 +28,16 @@ import org.apache.poi.util.LittleEndianInput; import org.apache.poi.util.LittleEndianOutput; /** - * <tt>Ptg</tt> represents a syntactic token in a formula. 'PTG' is an acronym for + * {@code Ptg} represents a syntactic token in a formula. 'PTG' is an acronym for * '<b>p</b>arse <b>t</b>hin<b>g</b>'. Originally, the name referred to the single - * byte identifier at the start of the token, but in POI, <tt>Ptg</tt> encapsulates + * byte identifier at the start of the token, but in POI, {@code Ptg} encapsulates * the whole formula token (initial byte + value data). * <p> * - * <tt>Ptg</tt>s are logically arranged in a tree representing the structure of the - * parsed formula. However, in BIFF files <tt>Ptg</tt>s are written/read in + * {@code Ptg}s are logically arranged in a tree representing the structure of the + * parsed formula. However, in BIFF files {@code Ptg}s are written/read in * <em>Reverse-Polish Notation</em> order. The RPN ordering also simplifies formula - * evaluation logic, so POI mostly accesses <tt>Ptg</tt>s in the same way. + * evaluation logic, so POI mostly accesses {@code Ptg}s in the same way. */ public abstract class Ptg implements Duplicatable, GenericRecord { public static final Ptg[] EMPTY_PTG_ARRAY = { }; @@ -55,8 +55,8 @@ public abstract class Ptg implements Duplicatable, GenericRecord { } /** - * Reads <tt>size</tt> bytes of the input stream, to create an array of <tt>Ptg</tt>s. - * Extra data (beyond <tt>size</tt>) may be read if and <tt>ArrayPtg</tt>s are present. + * Reads {@code size} bytes of the input stream, to create an array of {@code Ptg}s. + * Extra data (beyond {@code size}) may be read if and {@code ArrayPtg}s are present. */ public static Ptg[] readTokens(int size, LittleEndianInput in) { List<Ptg> temp = new ArrayList<>(4 + size / 2); @@ -181,7 +181,7 @@ public abstract class Ptg implements Duplicatable, GenericRecord { /** * This method will return the same result as {@link #getEncodedSizeWithoutArrayData(Ptg[])} * if there are no array tokens present. - * @return the full size taken to encode the specified <tt>Ptg</tt>s + * @return the full size taken to encode the specified {@code Ptg}s */ public static int getEncodedSize(Ptg[] ptgs) { int result = 0; @@ -285,7 +285,7 @@ public abstract class Ptg implements Duplicatable, GenericRecord { public abstract byte getDefaultOperandClass(); /** - * @return <code>false</code> if this token is classified as 'reference', 'value', or 'array' + * @return {@code false} if this token is classified as 'reference', 'value', or 'array' */ public abstract boolean isBaseToken(); @@ -311,10 +311,7 @@ public abstract class Ptg implements Duplicatable, GenericRecord { if (ptg instanceof AreaErrPtg) { return true; } - if (ptg instanceof RefErrorPtg) { - return true; - } - return false; + return ptg instanceof RefErrorPtg; } @Override diff --git a/poi/src/main/java/org/apache/poi/ss/formula/ptg/RangePtg.java b/poi/src/main/java/org/apache/poi/ss/formula/ptg/RangePtg.java index 25b145a3cb..9a4cb4a819 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/ptg/RangePtg.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/ptg/RangePtg.java @@ -30,6 +30,7 @@ public final class RangePtg extends OperationPtg { // enforce singleton } + @Override public final boolean isBaseToken() { return true; } @@ -39,14 +40,17 @@ public final class RangePtg extends OperationPtg { return sid; } + @Override public int getSize() { return SIZE; } + @Override public void write(LittleEndianOutput out) { out.writeByte(sid + getPtgClass()); } + @Override public String toFormulaString() { return ":"; @@ -54,10 +58,12 @@ public final class RangePtg extends OperationPtg { /** implementation of method from OperationsPtg*/ + @Override public String toFormulaString(String[] operands) { return operands[0] + ":" + operands[1]; } + @Override public int getNumberOfOperands() { return 2; diff --git a/poi/src/main/java/org/apache/poi/ss/formula/ptg/RefErrorPtg.java b/poi/src/main/java/org/apache/poi/ss/formula/ptg/RefErrorPtg.java index 06c8489276..9a16b3a77e 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/ptg/RefErrorPtg.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/ptg/RefErrorPtg.java @@ -32,7 +32,7 @@ public final class RefErrorPtg extends OperandPtg { private static final int SIZE = 5; public static final byte sid = 0x2A; - private int field_1_reserved; + private final int field_1_reserved; public RefErrorPtg() { field_1_reserved = 0; @@ -47,6 +47,7 @@ public final class RefErrorPtg extends OperandPtg { field_1_reserved = in.readInt(); } + @Override public void write(LittleEndianOutput out) { out.writeByte(sid + getPtgClass()); out.writeInt(field_1_reserved); @@ -57,14 +58,17 @@ public final class RefErrorPtg extends OperandPtg { return sid; } + @Override public int getSize() { return SIZE; } + @Override public String toFormulaString() { return FormulaError.REF.getString(); } + @Override public byte getDefaultOperandClass() { return Ptg.CLASS_REF; } diff --git a/poi/src/main/java/org/apache/poi/ss/formula/ptg/ScalarConstantPtg.java b/poi/src/main/java/org/apache/poi/ss/formula/ptg/ScalarConstantPtg.java index 310ffb2b1d..9f4bbb2fd2 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/ptg/ScalarConstantPtg.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/ptg/ScalarConstantPtg.java @@ -22,11 +22,13 @@ package org.apache.poi.ss.formula.ptg; * Common superclass of all {@link Ptg Ptgs} that represent simple constant values. */ public abstract class ScalarConstantPtg extends Ptg { + @Override public final boolean isBaseToken() { return true; } - public final byte getDefaultOperandClass() { + @Override + public final byte getDefaultOperandClass() { return Ptg.CLASS_VALUE; } } diff --git a/poi/src/main/java/org/apache/poi/ss/formula/ptg/UnionPtg.java b/poi/src/main/java/org/apache/poi/ss/formula/ptg/UnionPtg.java index da3175f56f..dbd530304a 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/ptg/UnionPtg.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/ptg/UnionPtg.java @@ -20,9 +20,6 @@ package org.apache.poi.ss.formula.ptg; import org.apache.poi.util.LittleEndianOutput; -/** - * @author Glen Stampoultzis (glens at apache.org) - */ public final class UnionPtg extends OperationPtg { public static final byte sid = 0x10; @@ -32,6 +29,7 @@ public final class UnionPtg extends OperationPtg { // enforce singleton } + @Override public final boolean isBaseToken() { return true; } @@ -41,14 +39,17 @@ public final class UnionPtg extends OperationPtg { return sid; } + @Override public int getSize() { return 1; } + @Override public void write(LittleEndianOutput out) { out.writeByte(sid + getPtgClass()); } + @Override public String toFormulaString() { return ","; @@ -56,10 +57,12 @@ public final class UnionPtg extends OperationPtg { /** implementation of method from OperationsPtg*/ + @Override public String toFormulaString(String[] operands) { return operands[0] + "," + operands[1]; } + @Override public int getNumberOfOperands() { return 2; diff --git a/poi/src/main/java/org/apache/poi/ss/formula/ptg/UnknownPtg.java b/poi/src/main/java/org/apache/poi/ss/formula/ptg/UnknownPtg.java index bd92b9b56e..5e71320064 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/ptg/UnknownPtg.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/ptg/UnknownPtg.java @@ -29,9 +29,11 @@ public class UnknownPtg extends Ptg { _sid = sid; } + @Override public boolean isBaseToken() { return true; } + @Override public void write(LittleEndianOutput out) { out.writeByte(_sid); } @@ -41,13 +43,16 @@ public class UnknownPtg extends Ptg { return (byte)_sid; } + @Override public int getSize() { return size; } + @Override public String toFormulaString() { return "UNKNOWN"; } + @Override public byte getDefaultOperandClass() { return Ptg.CLASS_VALUE; } diff --git a/poi/src/main/java/org/apache/poi/ss/formula/ptg/ValueOperatorPtg.java b/poi/src/main/java/org/apache/poi/ss/formula/ptg/ValueOperatorPtg.java index 1eff73a826..72922967b3 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/ptg/ValueOperatorPtg.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/ptg/ValueOperatorPtg.java @@ -29,24 +29,29 @@ public abstract class ValueOperatorPtg extends OperationPtg { protected ValueOperatorPtg() {} /** - * All Operator <tt>Ptg</tt>s are base tokens (i.e. are not RVA classified) + * All Operator {@code Ptg}s are base tokens (i.e. are not RVA classified) */ + @Override public final boolean isBaseToken() { return true; } - public final byte getDefaultOperandClass() { + @Override + public final byte getDefaultOperandClass() { return Ptg.CLASS_VALUE; } + @Override public void write(LittleEndianOutput out) { out.writeByte(getSid()); } + @Override public final int getSize() { return 1; } + @Override public final String toFormulaString() { // TODO - prune this method out of the hierarchy throw new RuntimeException("toFormulaString(String[] operands) should be used for subclasses of OperationPtgs"); diff --git a/poi/src/main/java/org/apache/poi/ss/formula/udf/AggregatingUDFFinder.java b/poi/src/main/java/org/apache/poi/ss/formula/udf/AggregatingUDFFinder.java index 593a0ee1b5..8a435b77fd 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/udf/AggregatingUDFFinder.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/udf/AggregatingUDFFinder.java @@ -26,14 +26,12 @@ import java.util.Collection; /** * Collects add-in libraries and VB macro functions together into one UDF finder - * - * @author PUdalau */ public class AggregatingUDFFinder implements UDFFinder { - + /** * Default UDFFinder implementation - */ + */ public static final UDFFinder DEFAULT = new AggregatingUDFFinder(AnalysisToolPak.instance); private final Collection<UDFFinder> _usedToolPacks; diff --git a/poi/src/main/java/org/apache/poi/ss/formula/udf/DefaultUDFFinder.java b/poi/src/main/java/org/apache/poi/ss/formula/udf/DefaultUDFFinder.java index 4234054583..18f53f6790 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/udf/DefaultUDFFinder.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/udf/DefaultUDFFinder.java @@ -25,8 +25,6 @@ import org.apache.poi.ss.formula.functions.FreeRefFunction; /** * Default UDF finder - for adding your own user defined functions. - * - * @author PUdalau */ public final class DefaultUDFFinder implements UDFFinder { private final Map<String, FreeRefFunction> _functionsByName; diff --git a/poi/src/main/java/org/apache/poi/ss/formula/udf/IndexedUDFFinder.java b/poi/src/main/java/org/apache/poi/ss/formula/udf/IndexedUDFFinder.java index c5af8d5254..29490c910b 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/udf/IndexedUDFFinder.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/udf/IndexedUDFFinder.java @@ -23,8 +23,6 @@ import java.util.HashMap; /** * A UDFFinder that can retrieve functions both by name and by fake index. - * - * @author Yegor Kozlov */ @Internal public class IndexedUDFFinder extends AggregatingUDFFinder { diff --git a/poi/src/main/java/org/apache/poi/ss/usermodel/CellBase.java b/poi/src/main/java/org/apache/poi/ss/usermodel/CellBase.java index 726c9bd82b..e892a4f7d0 100644 --- a/poi/src/main/java/org/apache/poi/ss/usermodel/CellBase.java +++ b/poi/src/main/java/org/apache/poi/ss/usermodel/CellBase.java @@ -31,7 +31,6 @@ import java.util.Locale; /** * Common implementation-independent logic shared by all implementations of {@link Cell}. - * @author Vladislav "gallon" Galas gallon at apache dot org */ public abstract class CellBase implements Cell { /** diff --git a/poi/src/main/java/org/apache/poi/ss/usermodel/CellRange.java b/poi/src/main/java/org/apache/poi/ss/usermodel/CellRange.java index 4868dd8e81..0c52cf0193 100644 --- a/poi/src/main/java/org/apache/poi/ss/usermodel/CellRange.java +++ b/poi/src/main/java/org/apache/poi/ss/usermodel/CellRange.java @@ -29,7 +29,7 @@ public interface CellRange<C extends Cell> extends Iterable<C> { /** * Gets the number of cells in this range. - * @return <tt>height * width </tt> + * @return {@code height * width } */ int size(); @@ -40,24 +40,24 @@ public interface CellRange<C extends Cell> extends Iterable<C> { String getReferenceText(); /** - * @return the cell at relative coordinates (0,0). Never <code>null</code>. + * @return the cell at relative coordinates (0,0). Never {@code null}. */ C getTopLeftCell(); /** - * @param relativeRowIndex must be between <tt>0</tt> and <tt>height-1</tt> - * @param relativeColumnIndex must be between <tt>0</tt> and <tt>width-1</tt> - * @return the cell at the specified coordinates. Never <code>null</code>. + * @param relativeRowIndex must be between {@code 0} and {@code height-1} + * @param relativeColumnIndex must be between {@code 0} and {@code width-1} + * @return the cell at the specified coordinates. Never {@code null}. */ C getCell(int relativeRowIndex, int relativeColumnIndex); /** - * @return a flattened array of all the cells in this {@link CellRange} + * @return a flattened array of all the cells in this CellRange */ C[] getFlattenedCells(); /** - * @return a 2-D array of all the cells in this {@link CellRange}. The first - * array dimension is the row index (values <tt>0...height-1</tt>) - * and the second dimension is the column index (values <tt>0...width-1</tt>) + * @return a 2-D array of all the cells in this CellRange. The first + * array dimension is the row index (values {@code 0...height-1}) + * and the second dimension is the column index (values {@code 0...width-1}) */ C[][] getCells(); @@ -65,5 +65,6 @@ public interface CellRange<C extends Cell> extends Iterable<C> { * @return an {@link Iterator} over all cells in this range. Iteration starts * with all cells in the first row followed by all cells in the next row, etc. */ + @Override Iterator<C> iterator(); } diff --git a/poi/src/main/java/org/apache/poi/ss/usermodel/ConditionalFormatting.java b/poi/src/main/java/org/apache/poi/ss/usermodel/ConditionalFormatting.java index d7789e14ea..da6889bf79 100644 --- a/poi/src/main/java/org/apache/poi/ss/usermodel/ConditionalFormatting.java +++ b/poi/src/main/java/org/apache/poi/ss/usermodel/ConditionalFormatting.java @@ -24,31 +24,22 @@ import org.apache.poi.ss.util.CellRangeAddress; /** * The ConditionalFormatting class encapsulates all settings of Conditional Formatting. * - * The class can be used - * - * <UL> - * <LI> - * to make a copy ConditionalFormatting settings. - * </LI> - * - * + * The class can be used to make a copy ConditionalFormatting settings. + * <p> * For example: - * <PRE> + * <pre>{@code * ConditionalFormatting cf = sheet.getConditionalFormattingAt(index); * newSheet.addConditionalFormatting(cf); - * </PRE> + * }</pre> * - * <LI> - * or to modify existing Conditional Formatting settings (formatting regions and/or rules). - * </LI> - * </UL> + * or to modify existing Conditional Formatting settings (formatting regions and/or rules).<p> * * Use {@link org.apache.poi.ss.usermodel.Sheet#getSheetConditionalFormatting()} * to get access to an instance of this class. - * <P> + * <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 @@ -71,18 +62,18 @@ import org.apache.poi.ss.util.CellRangeAddress; * * // Apply Conditional Formatting rule defined above to the regions * sheet.addConditionalFormatting(regions, rule); - * </PRE> + * }</pre> */ public interface ConditionalFormatting { /** - * @return array of <tt>CellRangeAddress</tt>s. Never <code>null</code> + * @return array of {@code CellRangeAddress}s. Never {@code null} */ CellRangeAddress[] getFormattingRanges(); /** * Sets the cell ranges the rule conditional formatting must be applied to. - * @param ranges non-null array of <tt>CellRangeAddress</tt>s + * @param ranges non-null array of {@code CellRangeAddress}s */ void setFormattingRanges(CellRangeAddress[] ranges); diff --git a/poi/src/main/java/org/apache/poi/ss/usermodel/DataFormatter.java b/poi/src/main/java/org/apache/poi/ss/usermodel/DataFormatter.java index 78bbd79b55..634d2d54b7 100644 --- a/poi/src/main/java/org/apache/poi/ss/usermodel/DataFormatter.java +++ b/poi/src/main/java/org/apache/poi/ss/usermodel/DataFormatter.java @@ -66,26 +66,25 @@ import org.apache.poi.util.LocaleUtil; * prefix or suffix. * </p> * <p> - * For example the Excel pattern <code>"$#,##0.00 "USD"_);($#,##0.00 "USD")" - * </code> will be correctly formatted as "$1,000.00 USD" or "($1,000.00 USD)". - * However the pattern <code>"00-00-00"</code> is incorrectly formatted by + * For example the Excel pattern {@code "$#,##0.00 "USD"_);($#,##0.00 "USD")" + * } will be correctly formatted as "$1,000.00 USD" or "($1,000.00 USD)". + * However the pattern {@code "00-00-00"} is incorrectly formatted by * DecimalFormat as "000000--". For Excel formats that are not compatible with * DecimalFormat, you can provide your own custom {@link Format} implementation - * via <code>DataFormatter.addFormat(String,Format)</code>. The following + * via {@code DataFormatter.addFormat(String,Format)}. The following * custom formats are already provided by this class: * </p> - * <pre> - * <ul><li>SSN "000-00-0000"</li> - * <li>Phone Number "(###) ###-####"</li> - * <li>Zip plus 4 "00000-0000"</li> - * </ul> - * </pre> + * <pre>{@code + * SSN "000-00-0000" + * Phone Number "(###) ###-####" + * Zip plus 4 "00000-0000" + * }</pre> * <p> * If the Excel format pattern cannot be parsed successfully, then a default * format will be used. The default number format will mimic the Excel General * format: "#" for whole numbers and "#.##########" for decimal numbers. You - * can override the default format pattern with <code> - * DataFormatter.setDefaultNumberFormat(Format)</code>. <b>Note:</b> the + * can override the default format pattern with {@code + * DataFormatter.setDefaultNumberFormat(Format)}. <b>Note:</b> the * default format will only be used when a Format cannot be created from the * cell's data format string. * @@ -95,24 +94,24 @@ import org.apache.poi.util.LocaleUtil; * </p> * <p>Example:</p> * <p> - * Consider a numeric cell with a value <code>12.343</code> and format <code>"##.##_ "</code>. - * The trailing underscore and space ("_ ") in the format adds a space to the end and Excel formats this cell as <code>"12.34 "</code>, - * but <code>DataFormatter</code> trims the formatted value and returns <code>"12.34"</code>. + * Consider a numeric cell with a value {@code 12.343} and format {@code "##.##_ "}. + * The trailing underscore and space ("_ ") in the format adds a space to the end and Excel formats this cell as {@code "12.34 "}, + * but {@code DataFormatter} trims the formatted value and returns {@code "12.34"}. * </p> - * You can enable spaces by passing the <code>emulateCSV=true</code> flag in the <code>DateFormatter</code> cosntructor. + * You can enable spaces by passing the {@code emulateCSV=true} flag in the {@code DateFormatter} cosntructor. * If set to true, then the output tries to conform to what you get when you take an xls or xlsx in Excel and Save As CSV file: * <ul> * <li>returned values are not trimmed</li> * <li>Invalid dates are formatted as 255 pound signs ("#")</li> * <li>simulate Excel's handling of a format string of all # when the value is 0. - * Excel will output "", <code>DataFormatter</code> will output "0". + * Excel will output "", {@code DataFormatter} will output "0". * </ul> * <p> * Some formats are automatically "localized" by Excel, eg show as mm/dd/yyyy when * loaded in Excel in some Locales but as dd/mm/yyyy in others. These are always * returned in the "default" (US) format, as stored in the file. * Some format strings request an alternate locale, eg - * <code>[$-809]d/m/yy h:mm AM/PM</code> which explicitly requests UK locale. + * {@code [$-809]d/m/yy h:mm AM/PM} which explicitly requests UK locale. * These locale directives are (currently) ignored. * You can use {@link DateFormatConverter} to do some of this localisation if * you need it. @@ -269,7 +268,7 @@ public class DataFormatter { /** * Return a Format for the given cell if one exists, otherwise try to - * create one. This method will return <code>null</code> if any of the + * create one. This method will return {@code null} if any of the * following is true: * <ul> * <li>the cell's style is null</li> @@ -685,7 +684,7 @@ public class DataFormatter { private static class InternalDecimalFormatWithScale extends Format { private static final Pattern endsWithCommas = Pattern.compile("(,+)$"); - private BigDecimal divider; + private final BigDecimal divider; private static final BigDecimal ONE_THOUSAND = new BigDecimal(1000); private final DecimalFormat df; private static String trimTrailingCommas(String s) { @@ -798,8 +797,8 @@ public class DataFormatter { } /** - * Returns the formatted value of an Excel date as a <tt>String</tt> based - * on the cell's <code>DataFormat</code>. i.e. "Thursday, January 02, 2003" + * Returns the formatted value of an Excel date as a {@code String} based + * on the cell's {@code DataFormat}. i.e. "Thursday, January 02, 2003" * , "01/02/2003" , "02-Jan" , etc. * <p> * If any conditional format rules apply, the highest priority with a number format is used. @@ -839,8 +838,8 @@ public class DataFormatter { } /** - * Returns the formatted value of an Excel number as a <tt>String</tt> - * based on the cell's <code>DataFormat</code>. Supported formats include + * Returns the formatted value of an Excel number as a {@code String} + * based on the cell's {@code DataFormat}. Supported formats include * currency, percents, decimals, phone number, SSN, etc.: * "61.54%", "$100.00", "(800) 555-1234". * <p> @@ -929,7 +928,7 @@ public class DataFormatter { /** * <p> - * Returns the formatted value of a cell as a <tt>String</tt> regardless + * Returns the formatted value of a cell as a {@code String} regardless * of the cell type. If the Excel format pattern cannot be parsed then the * cell value will be formatted using a default format. * </p> @@ -946,7 +945,7 @@ public class DataFormatter { /** * <p> - * Returns the formatted value of a cell as a <tt>String</tt> regardless + * Returns the formatted value of a cell as a {@code String} regardless * of the cell type. If the Excel number format pattern cannot be parsed then the * cell value will be formatted using a default format. * </p> @@ -967,7 +966,7 @@ public class DataFormatter { /** * <p> - * Returns the formatted value of a cell as a <tt>String</tt> regardless + * Returns the formatted value of a cell as a {@code String} regardless * of the cell type. If the Excel number format pattern cannot be parsed then the * cell value will be formatted using a default format. * </p> @@ -1038,9 +1037,9 @@ public class DataFormatter { * </p> * <p> * The value that will be passed to the Format's format method (specified - * by <code>java.text.Format#format</code>) will be a double value from a + * by {@code java.text.Format#format}) will be a double value from a * numeric cell. Therefore the code in the format method should expect a - * <code>Number</code> value. + * {@code Number} value. * </p> * * @param format A Format instance to be used as a default @@ -1059,9 +1058,9 @@ public class DataFormatter { * Adds a new format to the available formats. * <p> * The value that will be passed to the Format's format method (specified - * by <code>java.text.Format#format</code>) will be a double value from a + * by {@code java.text.Format#format}) will be a double value from a * numeric cell. Therefore the code in the format method should expect a - * <code>Number</code> value. + * {@code Number} value. * </p> * @param excelFormatStr The data format string * @param format A Format instance @@ -1073,7 +1072,7 @@ public class DataFormatter { // Some custom formats /** - * @return a <tt>DecimalFormat</tt> with parseIntegerOnly set <code>true</code> + * @return a {@code DecimalFormat} with parseIntegerOnly set {@code true} */ private static DecimalFormat createIntegerOnlyFormat(String fmt) { DecimalFormatSymbols dsf = DecimalFormatSymbols.getInstance(Locale.ROOT); @@ -1164,8 +1163,6 @@ public class DataFormatter { /** * Format class for Excel's SSN format. This class mimics Excel's built-in * SSN formatting. - * - * @author James May */ @SuppressWarnings("serial") private static final class SSNFormat extends Format { @@ -1197,7 +1194,6 @@ public class DataFormatter { /** * Format class for Excel Zip + 4 format. This class mimics Excel's * built-in formatting for Zip + 4. - * @author James May */ @SuppressWarnings("serial") private static final class ZipPlusFourFormat extends Format { @@ -1228,7 +1224,6 @@ public class DataFormatter { /** * Format class for Excel phone number format. This class mimics Excel's * built-in phone number formatting. - * @author James May */ @SuppressWarnings("serial") private static final class PhoneFormat extends Format { @@ -1312,6 +1307,7 @@ public class DataFormatter { private CellFormatResultWrapper(CellFormatResult result) { this.result = result; } + @Override public StringBuffer format(Object obj, StringBuffer toAppendTo, FieldPosition pos) { if (emulateCSV) { return toAppendTo.append(result.text); @@ -1319,6 +1315,7 @@ public class DataFormatter { return toAppendTo.append(result.text.trim()); } } + @Override public Object parseObject(String source, ParsePosition pos) { return null; // Not supported } diff --git a/poi/src/main/java/org/apache/poi/ss/usermodel/DataValidationHelper.java b/poi/src/main/java/org/apache/poi/ss/usermodel/DataValidationHelper.java index 2e749467e4..6a73a8c504 100644 --- a/poi/src/main/java/org/apache/poi/ss/usermodel/DataValidationHelper.java +++ b/poi/src/main/java/org/apache/poi/ss/usermodel/DataValidationHelper.java @@ -18,29 +18,25 @@ package org.apache.poi.ss.usermodel; import org.apache.poi.ss.util.CellRangeAddressList; -/** - * @author <a href="rjankiraman@emptoris.com">Radhakrishnan J</a> - * - */ public interface DataValidationHelper { - + DataValidationConstraint createFormulaListConstraint(String listFormula); DataValidationConstraint createExplicitListConstraint(String[] listOfValues); DataValidationConstraint createNumericConstraint(int validationType,int operatorType, String formula1, String formula2); - + DataValidationConstraint createTextLengthConstraint(int operatorType, String formula1, String formula2); - + DataValidationConstraint createDecimalConstraint(int operatorType, String formula1, String formula2); - + DataValidationConstraint createIntegerConstraint(int operatorType, String formula1, String formula2); - + DataValidationConstraint createDateConstraint(int operatorType, String formula1, String formula2,String dateFormat); - + DataValidationConstraint createTimeConstraint(int operatorType, String formula1, String formula2); - + DataValidationConstraint createCustomConstraint(String formula); - + DataValidation createValidation(DataValidationConstraint constraint,CellRangeAddressList cellRangeAddressList); } diff --git a/poi/src/main/java/org/apache/poi/ss/usermodel/FontFamily.java b/poi/src/main/java/org/apache/poi/ss/usermodel/FontFamily.java index 829246678e..614789fb35 100644 --- a/poi/src/main/java/org/apache/poi/ss/usermodel/FontFamily.java +++ b/poi/src/main/java/org/apache/poi/ss/usermodel/FontFamily.java @@ -21,8 +21,6 @@ package org.apache.poi.ss.usermodel; /** * The font family this font belongs to. A font family is a set of fonts having common stroke width and serif * characteristics. The font name overrides when there are conflicting values. - * - * @author Gisella Bronzetti */ public enum FontFamily { diff --git a/poi/src/main/java/org/apache/poi/ss/usermodel/FontScheme.java b/poi/src/main/java/org/apache/poi/ss/usermodel/FontScheme.java index 1bf2318362..d786bd7977 100644 --- a/poi/src/main/java/org/apache/poi/ss/usermodel/FontScheme.java +++ b/poi/src/main/java/org/apache/poi/ss/usermodel/FontScheme.java @@ -24,8 +24,6 @@ package org.apache.poi.ss.usermodel; * When a new theme is chosen, every font that is part of a theme definition is updated to use the new major or minor font definition for that * theme. * Usually major fonts are used for styles like headings, and minor fonts are used for body & paragraph text. - * - * @author Gisella Bronzetti */ public enum FontScheme { diff --git a/poi/src/main/java/org/apache/poi/ss/usermodel/FontUnderline.java b/poi/src/main/java/org/apache/poi/ss/usermodel/FontUnderline.java index a78062b92b..5089d4ed0c 100644 --- a/poi/src/main/java/org/apache/poi/ss/usermodel/FontUnderline.java +++ b/poi/src/main/java/org/apache/poi/ss/usermodel/FontUnderline.java @@ -19,8 +19,6 @@ package org.apache.poi.ss.usermodel; /** * the different types of possible underline formatting - * - * @author Gisella Bronzetti */ public enum FontUnderline { diff --git a/poi/src/main/java/org/apache/poi/ss/usermodel/FormulaEvaluator.java b/poi/src/main/java/org/apache/poi/ss/usermodel/FormulaEvaluator.java index 776c022d14..3138f6d9a3 100644 --- a/poi/src/main/java/org/apache/poi/ss/usermodel/FormulaEvaluator.java +++ b/poi/src/main/java/org/apache/poi/ss/usermodel/FormulaEvaluator.java @@ -23,13 +23,10 @@ import java.util.Map; /** * Evaluates formula cells.<p> - * + * * For performance reasons, this class keeps a cache of all previously calculated intermediate * cell values. Be sure to call {@link #clearAllCachedResultValues()} if any workbook cells are changed between * calls to evaluate~ methods on this class. - * - * @author Amol S. Deshmukh < amolweb at ya hoo dot com > - * @author Josh Micich */ public interface FormulaEvaluator { @@ -40,7 +37,7 @@ public interface FormulaEvaluator { */ void clearAllCachedResultValues(); /** - * Should be called to tell the cell value cache that the specified (value or formula) cell + * Should be called to tell the cell value cache that the specified (value or formula) cell * has changed. * Failure to call this method after changing cell values will cause incorrect behaviour * of the evaluate~ methods of this class @@ -48,7 +45,7 @@ public interface FormulaEvaluator { void notifySetFormula(Cell cell); /** * Should be called to tell the cell value cache that the specified cell has just become a - * formula cell, or the formula text has changed + * formula cell, or the formula text has changed */ void notifyDeleteCell(Cell cell); @@ -62,14 +59,14 @@ public interface FormulaEvaluator { /** * Loops over all cells in all sheets of the associated workbook. - * For cells that contain formulas, their formulas are evaluated, + * For cells that contain formulas, their formulas are evaluated, * and the results are saved. These cells remain as formula cells. * For cells that do not contain formulas, no changes are made. - * This is a helpful wrapper around looping over all cells, and + * This is a helpful wrapper around looping over all cells, and * calling evaluateFormulaCell on each one. */ void evaluateAll(); - + /** * If cell contains a formula, the formula is evaluated and returned, * else the CellValue simply copies the appropriate cell value from @@ -97,7 +94,7 @@ public interface FormulaEvaluator { * and the result. If you want the cell replaced with * the result of the formula, use {@link #evaluateInCell(Cell)} * @param cell The cell to evaluate - * @return The type of the formula result, i.e. -1 if the cell is not a formula, + * @return The type of the formula result, i.e. -1 if the cell is not a formula, * or one of {@link CellType#NUMERIC}, {@link CellType#STRING}, * {@link CellType#BOOLEAN}, {@link CellType#ERROR} * Note: the cell's type remains as CellType.FORMULA however. @@ -121,7 +118,7 @@ public interface FormulaEvaluator { * @param cell The {@link Cell} to evaluate and modify. */ Cell evaluateInCell(Cell cell); - + /** * Sets up the Formula Evaluator to be able to reference and resolve * links to other workbooks, eg [Test.xls]Sheet1!A1. @@ -139,7 +136,7 @@ public interface FormulaEvaluator { * In some cases external workbooks referenced by formulas in the main workbook are not available. * With this method you can control how POI handles such missing references: * <ul> - * <li>by default ignoreMissingWorkbooks=false and POI throws + * <li>by default ignoreMissingWorkbooks=false and POI throws * {@link org.apache.poi.ss.formula.CollaboratingWorkbooksEnvironment.WorkbookNotFoundException} * if an external reference cannot be resolved</li> * <li>if ignoreMissingWorkbooks=true then POI uses cached formula result @@ -149,13 +146,13 @@ public interface FormulaEvaluator { * @param ignore whether to ignore missing references to external workbooks */ void setIgnoreMissingWorkbooks(boolean ignore); - + /** * Perform detailed output of formula evaluation for next evaluation only? * Is for developer use only (also developers using POI for their XLS files). * Log-Level WARN is for basic info, INFO for detailed information. These quite * high levels are used because you have to explicitly enable this specific logging. - + * @param value whether to perform detailed output */ void setDebugEvaluationOutputForNextEval(boolean value); diff --git a/poi/src/main/java/org/apache/poi/ss/usermodel/IndexedColors.java b/poi/src/main/java/org/apache/poi/ss/usermodel/IndexedColors.java index 19053f1cc1..4bf7daf354 100644 --- a/poi/src/main/java/org/apache/poi/ss/usermodel/IndexedColors.java +++ b/poi/src/main/java/org/apache/poi/ss/usermodel/IndexedColors.java @@ -25,9 +25,6 @@ package org.apache.poi.ss.usermodel; * Each element corresponds to a color index (zero-based). When using the default indexed color palette, * the values are not written out, but instead are implied. When the color palette has been modified from default, * then the entire color palette is used. - * </p> - * - * @author Yegor Kozlov */ public enum IndexedColors { @@ -96,7 +93,7 @@ public enum IndexedColors { _values[color.index] = color; } } - + public final short index; IndexedColors(int idx){ @@ -111,9 +108,9 @@ public enum IndexedColors { public short getIndex(){ return index; } - + /** - * + * * * @param index the index of the color * @return the corresponding IndexedColors enum diff --git a/poi/src/main/java/org/apache/poi/ss/usermodel/PageOrder.java b/poi/src/main/java/org/apache/poi/ss/usermodel/PageOrder.java index c3faf36b3e..0e966c53b8 100644 --- a/poi/src/main/java/org/apache/poi/ss/usermodel/PageOrder.java +++ b/poi/src/main/java/org/apache/poi/ss/usermodel/PageOrder.java @@ -19,8 +19,6 @@ package org.apache.poi.ss.usermodel; /** * Specifies printed page order. - * - * @author Gisella Bronzetti */ public enum PageOrder { diff --git a/poi/src/main/java/org/apache/poi/ss/usermodel/PaperSize.java b/poi/src/main/java/org/apache/poi/ss/usermodel/PaperSize.java index abd65f3eaa..3ccb916b1e 100644 --- a/poi/src/main/java/org/apache/poi/ss/usermodel/PaperSize.java +++ b/poi/src/main/java/org/apache/poi/ss/usermodel/PaperSize.java @@ -19,8 +19,6 @@ package org.apache.poi.ss.usermodel; /** * The enumeration value indicating the possible paper size for a sheet - * - * @author Daniele Montagni */ public enum PaperSize { LETTER_PAPER, diff --git a/poi/src/main/java/org/apache/poi/ss/usermodel/PatternFormatting.java b/poi/src/main/java/org/apache/poi/ss/usermodel/PatternFormatting.java index 0eb0c589c7..6d1be84e16 100644 --- a/poi/src/main/java/org/apache/poi/ss/usermodel/PatternFormatting.java +++ b/poi/src/main/java/org/apache/poi/ss/usermodel/PatternFormatting.java @@ -19,9 +19,6 @@ package org.apache.poi.ss.usermodel; -/** - * @author Yegor Kozlov - */ public interface PatternFormatting { /** No background */ public static final short NO_FILL = 0 ; diff --git a/poi/src/main/java/org/apache/poi/ss/usermodel/PrintCellComments.java b/poi/src/main/java/org/apache/poi/ss/usermodel/PrintCellComments.java index ecbea6dafe..35c97f7dab 100644 --- a/poi/src/main/java/org/apache/poi/ss/usermodel/PrintCellComments.java +++ b/poi/src/main/java/org/apache/poi/ss/usermodel/PrintCellComments.java @@ -19,8 +19,6 @@ package org.apache.poi.ss.usermodel; /** * These enumerations specify how cell comments shall be displayed for paper printing purposes. - * - * @author Gisella Bronzetti */ public enum PrintCellComments { diff --git a/poi/src/main/java/org/apache/poi/ss/usermodel/PrintOrientation.java b/poi/src/main/java/org/apache/poi/ss/usermodel/PrintOrientation.java index 8d5716f31e..0cf07fc460 100644 --- a/poi/src/main/java/org/apache/poi/ss/usermodel/PrintOrientation.java +++ b/poi/src/main/java/org/apache/poi/ss/usermodel/PrintOrientation.java @@ -19,8 +19,6 @@ package org.apache.poi.ss.usermodel; /** * The enumeration value indicating the print orientation for a sheet. - * - * @author Gisella Bronzetti */ public enum PrintOrientation { diff --git a/poi/src/main/java/org/apache/poi/ss/usermodel/RichTextString.java b/poi/src/main/java/org/apache/poi/ss/usermodel/RichTextString.java index 551fede973..e38f12355c 100644 --- a/poi/src/main/java/org/apache/poi/ss/usermodel/RichTextString.java +++ b/poi/src/main/java/org/apache/poi/ss/usermodel/RichTextString.java @@ -18,14 +18,11 @@ package org.apache.poi.ss.usermodel; /** - * Rich text unicode string. These strings can have fonts + * Rich text unicode string. These strings can have fonts * applied to arbitary parts of the string. - * - * @author Glen Stampoultzis (glens at apache.org) - * @author Jason Height (jheight at apache.org) */ public interface RichTextString { - + /** * Applies a font to the specified characters of a string. * diff --git a/poi/src/main/java/org/apache/poi/ss/usermodel/ShapeTypes.java b/poi/src/main/java/org/apache/poi/ss/usermodel/ShapeTypes.java index 3c5747ee5a..8ff30b24ea 100644 --- a/poi/src/main/java/org/apache/poi/ss/usermodel/ShapeTypes.java +++ b/poi/src/main/java/org/apache/poi/ss/usermodel/ShapeTypes.java @@ -18,8 +18,6 @@ package org.apache.poi.ss.usermodel; /** * All known types of automatic shapes in DrawingML - * - * @author Yegor Kozlov */ public class ShapeTypes { public static final int LINE = 1; diff --git a/poi/src/main/java/org/apache/poi/ss/usermodel/Sheet.java b/poi/src/main/java/org/apache/poi/ss/usermodel/Sheet.java index bc93818a5c..1186207bba 100644 --- a/poi/src/main/java/org/apache/poi/ss/usermodel/Sheet.java +++ b/poi/src/main/java/org/apache/poi/ss/usermodel/Sheet.java @@ -127,7 +127,7 @@ public interface Sheet extends Iterable<Row> { * Get the hidden state for a given column * * @param columnIndex - the column to set (0-based) - * @return hidden - <code>false</code> if the column is visible + * @return hidden - {@code false} if the column is visible */ boolean isColumnHidden(int columnIndex); @@ -153,7 +153,7 @@ public interface Sheet extends Iterable<Row> { * in a cell that is formatted with the standard font (first font in the workbook).<p> * * Character width is defined as the maximum digit width - * of the numbers <code>0, 1, 2, ... 9</code> as rendered + * of the numbers {@code 0, 1, 2, ... 9} as rendered * using the default font (first font in the workbook).<p> * * Unless you are using a very special font, the default character is '0' (zero), @@ -166,19 +166,19 @@ public interface Sheet extends Iterable<Row> { * To compute the actual number of visible characters, * Excel uses the following formula (Section 3.3.1.12 of the OOXML spec):<p> * - * <code> + * {@code * width = Truncate([{Number of Visible Characters} * * {Maximum Digit Width} + {5 pixel padding}]/{Maximum Digit Width}*256)/256 - * </code> + * } * * Using the Calibri font as an example, the maximum digit width of 11 point font size is 7 pixels (at 96 dpi). - * If you set a column width to be eight characters wide, e.g. <code>setColumnWidth(columnIndex, 8*256)</code>, + * If you set a column width to be eight characters wide, e.g. {@code setColumnWidth(columnIndex, 8*256)}, * then the actual value of visible characters (the value shown in Excel) is derived from the following equation: - * <code> + * {@code * Truncate([numChars*7+5]/7*256)/256 = 8; - * </code> + * } * - * which gives <code>7.29</code>. + * which gives {@code 7.29}. * * @param columnIndex - the column to set (0-based) * @param width - the width in units of 1/256th of a character width @@ -191,7 +191,7 @@ public interface Sheet extends Iterable<Row> { * * <p> * Character width is defined as the maximum digit width - * of the numbers <code>0, 1, 2, ... 9</code> as rendered + * of the numbers {@code 0, 1, 2, ... 9} as rendered * using the default font (first font in the workbook) * </p> * @@ -409,7 +409,7 @@ public interface Sheet extends Iterable<Row> { /** * Flag indicating whether the sheet displays Automatic Page Breaks. * - * @param value <code>true</code> if the sheet displays Automatic Page Breaks. + * @param value {@code true} if the sheet displays Automatic Page Breaks. */ void setAutobreaks(boolean value); @@ -440,7 +440,7 @@ public interface Sheet extends Iterable<Row> { /** * Flag indicating whether the Fit to Page print option is enabled. * - * @param value <code>true</code> if the Fit to Page print option is enabled. + * @param value {@code true} if the Fit to Page print option is enabled. */ void setFitToPage(boolean value); @@ -455,7 +455,7 @@ public interface Sheet extends Iterable<Row> { * When false a summary row is inserted above the detailed data being summarized and a new outline level * is established on that row. * </p> - * @param value <code>true</code> if row summaries appear below detail in the outline + * @param value {@code true} if row summaries appear below detail in the outline */ void setRowSumsBelow(boolean value); @@ -470,14 +470,14 @@ public interface Sheet extends Iterable<Row> { * When false a summary column is inserted to the left of the detailed data being * summarized and a new outline level is established on that column. * </p> - * @param value <code>true</code> if col summaries appear right of the detail in the outline + * @param value {@code true} if col summaries appear right of the detail in the outline */ void setRowSumsRight(boolean value); /** * Flag indicating whether the sheet displays Automatic Page Breaks. * - * @return <code>true</code> if the sheet displays Automatic Page Breaks. + * @return {@code true} if the sheet displays Automatic Page Breaks. */ boolean getAutobreaks(); @@ -492,7 +492,7 @@ public interface Sheet extends Iterable<Row> { /** * Flag indicating whether the Fit to Page print option is enabled. * - * @return <code>true</code> if the Fit to Page print option is enabled. + * @return {@code true} if the Fit to Page print option is enabled. */ boolean getFitToPage(); @@ -507,7 +507,7 @@ public interface Sheet extends Iterable<Row> { * When false a summary row is inserted above the detailed data being summarized and a new outline level * is established on that row. * </p> - * @return <code>true</code> if row summaries appear below detail in the outline + * @return {@code true} if row summaries appear below detail in the outline */ boolean getRowSumsBelow(); @@ -522,7 +522,7 @@ public interface Sheet extends Iterable<Row> { * When false a summary column is inserted to the left of the detailed data being * summarized and a new outline level is established on that column. * </p> - * @return <code>true</code> if col summaries appear right of the detail in the outline + * @return {@code true} if col summaries appear right of the detail in the outline */ boolean getRowSumsRight(); @@ -530,7 +530,7 @@ public interface Sheet extends Iterable<Row> { * Gets the flag indicating whether this sheet displays the lines * between rows and columns to make editing and reading easier. * - * @return <code>true</code> if this sheet prints gridlines. + * @return {@code true} if this sheet prints gridlines. * @see #isDisplayGridlines() to check if gridlines are displayed on screen */ boolean isPrintGridlines(); @@ -539,7 +539,7 @@ public interface Sheet extends Iterable<Row> { * Sets the flag indicating whether this sheet should print the lines * between rows and columns to make editing and reading easier. * - * @param show <code>true</code> if this sheet should print gridlines. + * @param show {@code true} if this sheet should print gridlines. * @see #setDisplayGridlines(boolean) to display gridlines on screen */ void setPrintGridlines(boolean show); @@ -548,7 +548,7 @@ public interface Sheet extends Iterable<Row> { * Gets the flag indicating whether this sheet prints the * row and column headings when printing. * - * @return <code>true</code> if this sheet prints row and column headings. + * @return {@code true} if this sheet prints row and column headings. */ boolean isPrintRowAndColumnHeadings(); @@ -556,7 +556,7 @@ public interface Sheet extends Iterable<Row> { * Sets the flag indicating whether this sheet should print * row and columns headings when printing. * - * @param show <code>true</code> if this sheet should print row and column headings. + * @param show {@code true} if this sheet should print row and column headings. */ void setPrintRowAndColumnHeadings(boolean show); @@ -572,7 +572,7 @@ public interface Sheet extends Iterable<Row> { * * Note that XSSF offers more kinds of document headers than HSSF does * - * @return the document header. Never <code>null</code> + * @return the document header. Never {@code null} */ Header getHeader(); @@ -581,7 +581,7 @@ public interface Sheet extends Iterable<Row> { * * Note that XSSF offers more kinds of document footers than HSSF does. * - * @return the document footer. Never <code>null</code> + * @return the document footer. Never {@code null} */ Footer getFooter(); @@ -590,7 +590,7 @@ public interface Sheet extends Iterable<Row> { * * Note: multiple sheets can be selected, but only one sheet can be active at one time. * - * @param value <code>true</code> if this sheet is selected + * @param value {@code true} if this sheet is selected * @see Workbook#setActiveSheet(int) */ void setSelected(boolean value); @@ -620,7 +620,7 @@ public interface Sheet extends Iterable<Row> { /** * Sets the protection enabled as well as the password - * @param password to set for protection. Pass <code>null</code> to remove protection + * @param password to set for protection. Pass {@code null} to remove protection */ void protectSheet(String password); @@ -809,8 +809,8 @@ public interface Sheet extends Iterable<Row> { * Sets a page break at the indicated row * Breaks occur above the specified row and left of the specified column inclusive. * - * For example, <code>sheet.setColumnBreak(2);</code> breaks the sheet into two parts - * with columns A,B,C in the first and D,E,... in the second. Similar, <code>sheet.setRowBreak(2);</code> + * For example, {@code sheet.setColumnBreak(2);} breaks the sheet into two parts + * with columns A,B,C in the first and D,E,... in the second. Similar, {@code sheet.setRowBreak(2);} * breaks the sheet into two parts with first three rows (rownum=1...3) in the first part * and rows starting with rownum=4 in the second. * @@ -847,8 +847,8 @@ public interface Sheet extends Iterable<Row> { * Sets a page break at the indicated column. * Breaks occur above the specified row and left of the specified column inclusive. * - * For example, <code>sheet.setColumnBreak(2);</code> breaks the sheet into two parts - * with columns A,B,C in the first and D,E,... in the second. Similar, <code>sheet.setRowBreak(2);</code> + * For example, {@code sheet.setColumnBreak(2);} breaks the sheet into two parts + * with columns A,B,C in the first and D,E,... in the second. Similar, {@code sheet.setRowBreak(2);} * breaks the sheet into two parts with first three rows (rownum=1...3) in the first part * and rows starting with rownum=4 in the second. * @@ -958,7 +958,7 @@ public interface Sheet extends Iterable<Row> { /** * Returns cell comment for the specified location * - * @return cell comment or <code>null</code> if not found + * @return cell comment or {@code null} if not found */ Comment getCellComment(CellAddress ref); @@ -1005,7 +1005,7 @@ public interface Sheet extends Iterable<Row> { /** * Note - this is not the same as whether the sheet is focused (isActive) - * @return <code>true</code> if this sheet is currently selected + * @return {@code true} if this sheet is currently selected */ boolean isSelected(); @@ -1052,7 +1052,7 @@ public interface Sheet extends Iterable<Row> { AutoFilter setAutoFilter(CellRangeAddress range); /** - * The 'Conditional Formatting' facet for this <tt>Sheet</tt> + * The 'Conditional Formatting' facet for this {@code Sheet} * * @return conditional formatting rule for this sheet */ @@ -1182,7 +1182,7 @@ public interface Sheet extends Iterable<Row> { List<? extends Hyperlink> getHyperlinkList(); /** - * Return location of the active cell, e.g. <code>A1</code>. + * Return location of the active cell, e.g. {@code A1}. * * @return the location of the active cell. * @since 3.14beta1 @@ -1192,7 +1192,7 @@ public interface Sheet extends Iterable<Row> { /** * Sets location of the active cell * - * @param address the location of the active cell, e.g. <code>A1</code>. + * @param address the location of the active cell, e.g. {@code A1}. * @since 3.14beta1 */ void setActiveCell(CellAddress address); diff --git a/poi/src/main/java/org/apache/poi/ss/usermodel/SheetConditionalFormatting.java b/poi/src/main/java/org/apache/poi/ss/usermodel/SheetConditionalFormatting.java index 98e2aa7846..755fbd7986 100644 --- a/poi/src/main/java/org/apache/poi/ss/usermodel/SheetConditionalFormatting.java +++ b/poi/src/main/java/org/apache/poi/ss/usermodel/SheetConditionalFormatting.java @@ -23,7 +23,7 @@ import org.apache.poi.ss.usermodel.IconMultiStateFormatting.IconSet; import org.apache.poi.ss.util.CellRangeAddress; /** - * The 'Conditional Formatting' facet of <tt>Sheet</tt> + * The 'Conditional Formatting' facet of {@code Sheet} * * @since 3.8 */ @@ -88,7 +88,7 @@ public interface SheetConditionalFormatting { * </p> * * @param comparisonOperation - MUST be a constant value from - * <tt>{@link ComparisonOperator}</tt>: <p> + * {@link ComparisonOperator}: * <ul> * <li>BETWEEN</li> * <li>NOT_BETWEEN</li> @@ -99,7 +99,6 @@ public interface SheetConditionalFormatting { * <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 ComparisonOperator#BETWEEN}) and {@link ComparisonOperator#NOT_BETWEEN} operations) @@ -117,7 +116,7 @@ public interface SheetConditionalFormatting { * </p> * * @param comparisonOperation MUST be a constant value from - * <tt>{@link ComparisonOperator}</tt> except BETWEEN and NOT_BETWEEN + * {@link ComparisonOperator} except BETWEEN and NOT_BETWEEN * * @param formula the formula to determine if the conditional formatting is applied */ @@ -138,20 +137,20 @@ public interface SheetConditionalFormatting { /** * Create a Databar conditional formatting rule. - * <p>The thresholds and colour for it will be created, but will be - * empty and require configuring with + * <p>The thresholds and colour for it will be created, but will be + * empty and require configuring with * {@link ConditionalFormattingRule#getDataBarFormatting()} * then * {@link DataBarFormatting#getMinThreshold()} - * and + * and * {@link DataBarFormatting#getMaxThreshold()} */ ConditionalFormattingRule createConditionalFormattingRule(ExtendedColor color); - + /** * Create an Icon Set / Multi-State conditional formatting rule. * <p>The thresholds for it will be created, but will be empty - * and require configuring with + * and require configuring with * {@link ConditionalFormattingRule#getMultiStateFormatting()} * then * {@link IconMultiStateFormatting#getThresholds()} @@ -160,8 +159,8 @@ public interface SheetConditionalFormatting { /** * Create a Color Scale / Color Gradient conditional formatting rule. - * <p>The thresholds and colours for it will be created, but will be - * empty and require configuring with + * <p>The thresholds and colours for it will be created, but will be + * empty and require configuring with * {@link ConditionalFormattingRule#getColorScaleFormatting()} * then * {@link ColorScaleFormatting#getThresholds()} @@ -169,12 +168,12 @@ public interface SheetConditionalFormatting { * {@link ColorScaleFormatting#getColors()} */ ConditionalFormattingRule createConditionalFormattingColorScaleRule(); - + /** * Gets Conditional Formatting object at a particular index * * @param index 0-based index of the Conditional Formatting object to fetch - * @return Conditional Formatting object or <code>null</code> if not found + * @return Conditional Formatting object or {@code null} if not found * @throws IllegalArgumentException if the index is outside of the allowable range (0 ... numberOfFormats-1) */ ConditionalFormatting getConditionalFormattingAt(int index); diff --git a/poi/src/main/java/org/apache/poi/ss/util/AreaReference.java b/poi/src/main/java/org/apache/poi/ss/util/AreaReference.java index ffe672f7ee..6312673b57 100644 --- a/poi/src/main/java/org/apache/poi/ss/util/AreaReference.java +++ b/poi/src/main/java/org/apache/poi/ss/util/AreaReference.java @@ -26,22 +26,22 @@ import org.apache.poi.util.StringUtil; public class AreaReference { - /** The character (!) that separates sheet names from cell references */ + /** The character (!) that separates sheet names from cell references */ private static final char SHEET_NAME_DELIMITER = '!'; /** The character (:) that separates the two cell references in a multi-cell area reference */ private static final char CELL_DELIMITER = ':'; /** The character (') used to quote sheet names when they contain special characters */ private static final char SPECIAL_NAME_DELIMITER = '\''; private static final SpreadsheetVersion DEFAULT_SPREADSHEET_VERSION = SpreadsheetVersion.EXCEL97; - + private final CellReference _firstCell; private final CellReference _lastCell; private final boolean _isSingleCell; private final SpreadsheetVersion _version; // never null - + /** * Create an area ref from a string representation. Sheet names containing special characters should be - * delimited and escaped as per normal syntax rules for formulas.<br> + * delimited and escaped as per normal syntax rules for formulas.<br> * The area reference must be contiguous (i.e. represent a single rectangle, not a union of rectangles) */ public AreaReference(String reference, SpreadsheetVersion version) { @@ -58,7 +58,7 @@ public class AreaReference { // TODO - probably shouldn't initialize area ref when text is really a cell ref // Need to fix some named range stuff to get rid of this _firstCell = new CellReference(part0); - + _lastCell = _firstCell; _isSingleCell = true; return; @@ -66,7 +66,7 @@ public class AreaReference { if (parts.length != 2) { throw new IllegalArgumentException("Bad area ref '" + reference + "'"); } - + String part1 = parts[1]; if (isPlainColumn(part0)) { if (!isPlainColumn(part1)) { @@ -78,10 +78,10 @@ public class AreaReference { boolean firstIsAbs = CellReference.isPartAbsolute(part0); boolean lastIsAbs = CellReference.isPartAbsolute(part1); - + int col0 = CellReference.convertColStringToIndex(part0); int col1 = CellReference.convertColStringToIndex(part1); - + _firstCell = new CellReference(0, col0, true, firstIsAbs); _lastCell = new CellReference(0xFFFF, col1, true, lastIsAbs); _isSingleCell = false; @@ -92,7 +92,7 @@ public class AreaReference { _isSingleCell = part0.equals(part1); } } - + /** * Creates an area ref from a pair of Cell References. */ @@ -145,7 +145,7 @@ public class AreaReference { } _isSingleCell = false; } - + private static boolean isPlainColumn(String refPart) { for(int i=refPart.length()-1; i>=0; i--) { int ch = refPart.charAt(i); @@ -190,9 +190,9 @@ public class AreaReference { */ public static boolean isWholeColumnReference(SpreadsheetVersion version, CellReference topLeft, CellReference botRight) { if (null == version) { - version = DEFAULT_SPREADSHEET_VERSION; // how the code used to behave. + version = DEFAULT_SPREADSHEET_VERSION; // how the code used to behave. } - + // These are represented as something like // C$1:C$65535 or D$1:F$0 // i.e. absolute from 1st row to 0th one @@ -222,7 +222,7 @@ public class AreaReference { * Separates Area refs in two parts and returns them as separate elements in a String array, * each qualified with the sheet name (if present) * - * @return array with one or two elements. never <code>null</code> + * @return array with one or two elements. never {@code null} */ private static String[] separateAreaRefs(String reference) { // TODO - refactor cell reference parsing logic to one place. @@ -322,13 +322,13 @@ public class AreaReference { } return results.toArray(new String[0]); } - + public boolean isWholeColumnReference() { return isWholeColumnReference(_version, _firstCell, _lastCell); } - + /** - * @return <code>false</code> if this area reference involves more than one cell + * @return {@code false} if this area reference involves more than one cell */ public boolean isSingleCell() { return _isSingleCell; @@ -344,7 +344,7 @@ public class AreaReference { /** * Note - if this area reference refers to a single cell, the return value of this method will - * be identical to that of <tt>getFirstCell()</tt> + * be identical to that of {@code getFirstCell()} * @return the second cell reference which defines this area. For multi-cell areas, this is * cell diagonally opposite the 'first cell'. Usually this cell is in the lower right corner * of the area (but this is not a requirement). diff --git a/poi/src/main/java/org/apache/poi/ss/util/CellAddress.java b/poi/src/main/java/org/apache/poi/ss/util/CellAddress.java index f9129647d9..197cc0e5c2 100644 --- a/poi/src/main/java/org/apache/poi/ss/util/CellAddress.java +++ b/poi/src/main/java/org/apache/poi/ss/util/CellAddress.java @@ -26,11 +26,11 @@ import org.apache.poi.ss.usermodel.Cell; * It is barely a container for these two coordinates. The implementation * of the Comparable interface sorts by "natural" order top left to bottom right.</p> * - * <p>Use <tt>CellAddress</tt> when you want to refer to the location of a cell in a sheet + * <p>Use {@code CellAddress} when you want to refer to the location of a cell in a sheet * when the concept of relative/absolute does not apply (such as the anchor location * of a cell comment). Use {@link CellReference} when the concept of * relative/absolute does apply (such as a cell reference in a formula). - * <tt>CellAddress</tt>es do not have a concept of "sheet", while <tt>CellReference</tt>s do.</p> + * {@code CellAddress}es do not have a concept of "sheet", while {@code CellReference}s do.</p> */ public class CellAddress implements Comparable<CellAddress> { /** A constant for references to the first cell in a sheet. */ @@ -127,7 +127,6 @@ public class CellAddress implements Comparable<CellAddress> { * Compare this CellAddress using the "natural" row-major, column-minor ordering. * That is, top-left to bottom-right ordering. * - * @param other * @return <ul> * <li>-1 if this CellAddress is before (above/left) of other</li> * <li>0 if addresses are the same</li> @@ -137,16 +136,8 @@ public class CellAddress implements Comparable<CellAddress> { @Override public int compareTo(CellAddress other) { int r = this._row-other._row; - if (r!=0) { - return r; - } - - r = this._col-other._col; - if (r!=0) { - return r; - } + return r != 0 ? r : this._col - other._col; - return 0; } @Override diff --git a/poi/src/main/java/org/apache/poi/ss/util/CellRangeAddress.java b/poi/src/main/java/org/apache/poi/ss/util/CellRangeAddress.java index 1a3bc11746..328148d3c4 100644 --- a/poi/src/main/java/org/apache/poi/ss/util/CellRangeAddress.java +++ b/poi/src/main/java/org/apache/poi/ss/util/CellRangeAddress.java @@ -29,7 +29,6 @@ import org.apache.poi.util.LittleEndianOutput; * Ref8U - see page 831 of version 1.0 of the documentation. * * Note - {@link SelectionRecord} uses the BIFF5 version of this structure - * @author Dragos Buleandra (dragos.buleandra@trade2b.ro) */ public class CellRangeAddress extends CellRangeAddressBase { public static final int ENCODED_SIZE = 8; diff --git a/poi/src/main/java/org/apache/poi/ss/util/CellRangeAddressList.java b/poi/src/main/java/org/apache/poi/ss/util/CellRangeAddressList.java index c4ac6289b7..fe48e19ddc 100644 --- a/poi/src/main/java/org/apache/poi/ss/util/CellRangeAddressList.java +++ b/poi/src/main/java/org/apache/poi/ss/util/CellRangeAddressList.java @@ -37,20 +37,19 @@ import org.apache.poi.util.LittleEndianOutput; * several records (not formulas). A cell range address list consists of a field * with the number of ranges and the list of the range addresses. Each cell * range address (called an ADDR structure) contains 4 16-bit-values. - * </p> */ public class CellRangeAddressList implements GenericRecord { /** - * List of <tt>CellRangeAddress</tt>es. Each structure represents a cell range + * List of {@code CellRangeAddress}es. Each structure represents a cell range */ protected final List<CellRangeAddress> _list = new ArrayList<>(); public CellRangeAddressList() { } /** - * Convenience constructor for creating a <tt>CellRangeAddressList</tt> with a single - * <tt>CellRangeAddress</tt>. Other <tt>CellRangeAddress</tt>es may be added later. + * Convenience constructor for creating a {@code CellRangeAddressList} with a single + * {@code CellRangeAddress}. Other {@code CellRangeAddress}es may be added later. */ public CellRangeAddressList(int firstRow, int lastRow, int firstCol, int lastCol) { addCellRangeAddress(firstRow, firstCol, lastRow, lastCol); @@ -104,7 +103,7 @@ public class CellRangeAddressList implements GenericRecord { } /** - * @return <tt>CellRangeAddress</tt> at the given index + * @return {@code CellRangeAddress} at the given index */ public CellRangeAddress getCellRangeAddress(int index) { return _list.get(index); diff --git a/poi/src/main/java/org/apache/poi/ss/util/CellReference.java b/poi/src/main/java/org/apache/poi/ss/util/CellReference.java index 6ba8c566de..f1132285ac 100644 --- a/poi/src/main/java/org/apache/poi/ss/util/CellReference.java +++ b/poi/src/main/java/org/apache/poi/ss/util/CellReference.java @@ -38,12 +38,12 @@ import org.apache.poi.util.GenericRecordUtil; * style references. Handles sheet-based and sheet-free references * as well, eg "Sheet1!A1" and "$B$72"</p> * - * <p>Use <tt>CellReference</tt> when the concept of + * <p>Use {@code CellReference} when the concept of * relative/absolute does apply (such as a cell reference in a formula). * Use {@link CellAddress} when you want to refer to the location of a cell in a sheet * when the concept of relative/absolute does not apply (such as the anchor location * of a cell comment). - * <tt>CellReference</tt>s have a concept of "sheet", while <tt>CellAddress</tt>es do not.</p> + * {@code CellReference}s have a concept of "sheet", while {@code CellAddress}es do not.</p> */ public class CellReference implements GenericRecord { /** @@ -177,7 +177,7 @@ public class CellReference implements GenericRecord { public boolean isRowAbsolute(){return _isRowAbs;} public boolean isColAbsolute(){return _isColAbs;} /** - * @return possibly <code>null</code> if this is a 2D reference. Special characters are not + * @return possibly {@code null} if this is a 2D reference. Special characters are not * escaped or delimited */ public String getSheetName(){ @@ -216,7 +216,7 @@ public class CellReference implements GenericRecord { /** * Classifies an identifier as either a simple (2D) cell reference or a named range name - * @return one of the values from <tt>NameType</tt> + * @return one of the values from {@code NameType} */ public static NameType classifyCellReference(String str, SpreadsheetVersion ssVersion) { int len = str.length(); @@ -290,7 +290,6 @@ public class CellReference implements GenericRecord { * reference is valid (in range) becomes important. * <p> * Note - that the maximum sheet size varies across Excel versions: - * <p> * <blockquote><table border="0" cellpadding="1" cellspacing="0" * summary="Notable cases."> * <tr><th>Version </th><th>File Format </th> @@ -317,7 +316,7 @@ public class CellReference implements GenericRecord { * * @param colStr a string of only letter characters * @param rowStr a string of only digit characters - * @return <code>true</code> if the row and col parameters are within range of a BIFF8 spreadsheet. + * @return {@code true} if the row and col parameters are within range of a BIFF8 spreadsheet. */ public static boolean cellReferenceIsWithinRange(String colStr, String rowStr, SpreadsheetVersion ssVersion) { if (!isColumnWithinRange(colStr, ssVersion)) { diff --git a/poi/src/main/java/org/apache/poi/ss/util/CellUtil.java b/poi/src/main/java/org/apache/poi/ss/util/CellUtil.java index 4d5e3e01c7..1a7c4aaf65 100644 --- a/poi/src/main/java/org/apache/poi/ss/util/CellUtil.java +++ b/poi/src/main/java/org/apache/poi/ss/util/CellUtil.java @@ -44,12 +44,9 @@ import org.apache.poi.ss.usermodel.Workbook; * style change to a cell, the code will attempt to see if a style already exists that meets your * needs. If not, then it will create a new style. This is to prevent creating too many styles. * there is an upper limit in Excel on the number of styles that can be supported. - * - *@author Eric Pugh epugh@upstate.com - *@author (secondary) Avinash Kewalramani akewalramani@accelrys.com */ public final class CellUtil { - + private static final Logger LOGGER = LogManager.getLogger(CellUtil.class); // FIXME: Move these constants into an enum @@ -73,7 +70,7 @@ public final class CellUtil { public static final String ROTATION = "rotation"; public static final String VERTICAL_ALIGNMENT = "verticalAlignment"; public static final String WRAP_TEXT = "wrapText"; - + private static final Set<String> shortValues = Collections.unmodifiableSet( new HashSet<>(Arrays.asList( BOTTOM_BORDER_COLOR, @@ -87,8 +84,8 @@ public final class CellUtil { ROTATION ))); private static final Set<String> intValues = Collections.unmodifiableSet( - new HashSet<>(Arrays.asList( - FONT + new HashSet<>(Collections.singletonList( + FONT ))); private static final Set<String> booleanValues = Collections.unmodifiableSet( new HashSet<>(Arrays.asList( @@ -105,7 +102,7 @@ public final class CellUtil { ))); - private static UnicodeMapping[] unicodeMappings; + private static final UnicodeMapping[] unicodeMappings; private static final class UnicodeMapping { @@ -190,7 +187,7 @@ public final class CellUtil { /** * Take a cell, and align it. - * + * * This is superior to cell.getCellStyle().setAlignment(align) because * this method will not modify the CellStyle object that may be referenced * by multiple cells. Instead, this method will search for existing CellStyles @@ -206,10 +203,10 @@ public final class CellUtil { public static void setAlignment(Cell cell, HorizontalAlignment align) { setCellStyleProperty(cell, ALIGNMENT, align); } - + /** * Take a cell, and vertically align it. - * + * * This is superior to cell.getCellStyle().setVerticalAlignment(align) because * this method will not modify the CellStyle object that may be referenced * by multiple cells. Instead, this method will search for existing CellStyles @@ -225,13 +222,13 @@ public final class CellUtil { public static void setVerticalAlignment(Cell cell, VerticalAlignment align) { setCellStyleProperty(cell, VERTICAL_ALIGNMENT, align); } - + /** * Take a cell, and apply a font to it * * @param cell the cell to set the alignment for * @param font The Font that you want to set. - * @throws IllegalArgumentException if <tt>font</tt> and <tt>cell</tt> do not belong to the same workbook + * @throws IllegalArgumentException if {@code font} and {@code cell} do not belong to the same workbook */ public static void setFont(Cell cell, Font font) { // Check if font belongs to workbook @@ -248,19 +245,19 @@ public final class CellUtil { } /** - * <p>This method attempts to find an existing CellStyle that matches the <code>cell</code>'s - * current style plus styles properties in <code>properties</code>. A new style is created if the + * <p>This method attempts to find an existing CellStyle that matches the {@code cell}'s + * current style plus styles properties in {@code properties}. A new style is created if the * workbook does not contain a matching style.</p> - * - * <p>Modifies the cell style of <code>cell</code> without affecting other cells that use the + * + * <p>Modifies the cell style of {@code cell} without affecting other cells that use the * same style.</p> - * + * * <p>This is necessary because Excel has an upper limit on the number of styles that it supports.</p> - * + * * <p>This function is more efficient than multiple calls to * {@link #setCellStyleProperty(Cell, String, Object)} * if adding multiple cell styles.</p> - * + * * <p>For performance reasons, if this is the only cell in a workbook that uses a cell style, * this method does NOT remove the old style from the workbook. * <!-- NOT IMPLEMENTED: Unused styles should be @@ -304,18 +301,18 @@ public final class CellUtil { } /** - * <p>This method attempts to find an existing CellStyle that matches the <code>cell</code>'s - * current style plus a single style property <code>propertyName</code> with value - * <code>propertyValue</code>. + * <p>This method attempts to find an existing CellStyle that matches the {@code cell}'s + * current style plus a single style property {@code propertyName} with value + * {@code propertyValue}. * A new style is created if the workbook does not contain a matching style.</p> - * - * <p>Modifies the cell style of <code>cell</code> without affecting other cells that use the + * + * <p>Modifies the cell style of {@code cell} without affecting other cells that use the * same style.</p> - * + * * <p>If setting more than one cell style property on a cell, use * {@link #setCellStyleProperties(Cell, Map)}, * which is faster and does not add unnecessary intermediate CellStyles to the workbook.</p> - * + * * @param cell The cell that is to be changed. * @param propertyName The name of the property that is to be changed. * @param propertyValue The value of the property that is to be changed. @@ -327,8 +324,8 @@ public final class CellUtil { /** * Returns a map containing the format properties of the given cell style. - * The returned map is not tied to <code>style</code>, so subsequent changes - * to <code>style</code> will not modify the map, and changes to the returned + * The returned map is not tied to {@code style}, so subsequent changes + * to {@code style} will not modify the map, and changes to the returned * map will not modify the cell style. The returned map is mutable. * * @param style cell style @@ -359,7 +356,7 @@ public final class CellUtil { put(properties, WRAP_TEXT, style.getWrapText()); return properties; } - + /** * Copies the entries in src to dest, using the preferential data type * so that maps can be compared for equality @@ -452,7 +449,7 @@ public final class CellUtil { } return 0; } - + /** * Utility method that returns the named BorderStyle value from the given map. * @@ -469,7 +466,7 @@ public final class CellUtil { // @deprecated 3.15 beta 2. getBorderStyle will only work on BorderStyle enums instead of codes in the future. else if (value instanceof Short) { LOGGER.atWarn().log("Deprecation warning: CellUtil properties map uses Short values for {}. Should use BorderStyle enums instead.", name); - short code = ((Short) value).shortValue(); + short code = (Short) value; border = BorderStyle.valueOf(code); } else if (value == null) { @@ -480,7 +477,7 @@ public final class CellUtil { } return border; } - + /** * Utility method that returns the named FillPatternType value from the given map. * @@ -498,7 +495,7 @@ public final class CellUtil { // @deprecated 3.15 beta 2. getFillPattern will only work on FillPatternType enums instead of codes in the future. else if (value instanceof Short) { LOGGER.atWarn().log("Deprecation warning: CellUtil properties map uses Short values for {}. Should use FillPatternType enums instead.", name); - short code = ((Short) value).shortValue(); + short code = (Short) value; pattern = FillPatternType.forInt(code); } else if (value == null) { @@ -509,7 +506,7 @@ public final class CellUtil { } return pattern; } - + /** * Utility method that returns the named HorizontalAlignment value from the given map. * @@ -527,7 +524,7 @@ public final class CellUtil { // @deprecated 3.15 beta 2. getHorizontalAlignment will only work on HorizontalAlignment enums instead of codes in the future. else if (value instanceof Short) { LOGGER.atWarn().log("Deprecation warning: CellUtil properties map used a Short value for {}. Should use HorizontalAlignment enums instead.", name); - short code = ((Short) value).shortValue(); + short code = (Short) value; align = HorizontalAlignment.forInt(code); } else if (value == null) { @@ -538,7 +535,7 @@ public final class CellUtil { } return align; } - + /** * Utility method that returns the named VerticalAlignment value from the given map. * @@ -556,7 +553,7 @@ public final class CellUtil { // @deprecated 3.15 beta 2. getVerticalAlignment will only work on VerticalAlignment enums instead of codes in the future. else if (value instanceof Short) { LOGGER.atWarn().log("Deprecation warning: CellUtil properties map used a Short value for {}. Should use VerticalAlignment enums instead.", name); - short code = ((Short) value).shortValue(); + short code = (Short) value; align = VerticalAlignment.forInt(code); } else if (value == null) { @@ -580,7 +577,7 @@ public final class CellUtil { Object value = properties.get(name); //noinspection SimplifiableIfStatement if (value instanceof Boolean) { - return ((Boolean) value).booleanValue(); + return (Boolean) value; } return false; } diff --git a/poi/src/main/java/org/apache/poi/ss/util/ExpandedDouble.java b/poi/src/main/java/org/apache/poi/ss/util/ExpandedDouble.java index 40d4066af8..fd0c3d39d8 100644 --- a/poi/src/main/java/org/apache/poi/ss/util/ExpandedDouble.java +++ b/poi/src/main/java/org/apache/poi/ss/util/ExpandedDouble.java @@ -29,10 +29,8 @@ import static org.apache.poi.ss.util.IEEEDouble.*; * <br> * where:<br> * - * <tt>a</tt> = <i>significand</i><br> - * <tt>b</tt> = <i>binaryExponent</i> - bitLength(significand) + 1<br> - * - * @author Josh Micich + * {@code a} = <i>significand</i><br> + * {@code b} = <i>binaryExponent</i> - bitLength(significand) + 1<br> */ final class ExpandedDouble { private static final BigInteger BI_FRAC_MASK = BigInteger.valueOf(FRAC_MASK); @@ -60,7 +58,7 @@ final class ExpandedDouble { BigInteger frac = BigInteger.valueOf(rawBits).and(BI_FRAC_MASK); int expAdj = 64 - frac.bitLength(); _significand = frac.shiftLeft(expAdj); - _binaryExponent = (biasedExp & 0x07FF) - 1023 - expAdj; + _binaryExponent = -1023 - expAdj; } else { _significand = getFrac(rawBits); _binaryExponent = (biasedExp & 0x07FF) - 1023; diff --git a/poi/src/main/java/org/apache/poi/ss/util/IEEEDouble.java b/poi/src/main/java/org/apache/poi/ss/util/IEEEDouble.java index 91d8fea434..bb1fca7769 100644 --- a/poi/src/main/java/org/apache/poi/ss/util/IEEEDouble.java +++ b/poi/src/main/java/org/apache/poi/ss/util/IEEEDouble.java @@ -20,8 +20,6 @@ package org.apache.poi.ss.util; /** * For working with the internals of IEEE 754-2008 'binary64' (double precision) floating point numbers - * - * @author Josh Micich */ final class IEEEDouble { private static final long EXPONENT_MASK = 0x7FF0000000000000L; diff --git a/poi/src/main/java/org/apache/poi/ss/util/NormalisedDecimal.java b/poi/src/main/java/org/apache/poi/ss/util/NormalisedDecimal.java index 6c945f26b5..633dc49acd 100644 --- a/poi/src/main/java/org/apache/poi/ss/util/NormalisedDecimal.java +++ b/poi/src/main/java/org/apache/poi/ss/util/NormalisedDecimal.java @@ -38,9 +38,7 @@ import java.math.BigInteger; * <br> * where:<br> * - * <tt>significand</tt> = wholePart + fractionalPart / 2<sup>24</sup><br> - * - * @author Josh Micich + * {@code significand} = wholePart + fractionalPart / 2<sup>24</sup><br> */ final class NormalisedDecimal { /** @@ -168,10 +166,10 @@ final class NormalisedDecimal { * The resulting transformed object is easily converted to a 64 bit IEEE double: * <ul> * <li>bits 2-53 of the {@link #composeFrac()} become the 52 bit 'fraction'.</li> - * <li>{@link #getBinaryExponent()} is biased by 1023 to give the 'exponent'.</li> + * <li>{@link #getDecimalExponent()} is biased by 1023 to give the 'exponent'.</li> * </ul> * The sign bit must be obtained from somewhere else. - * @return a new {@link NormalisedDecimal} normalised to base 2 representation. + * @return a new NormalisedDecimal normalised to base 2 representation. */ public ExpandedDouble normaliseBaseTwo() { MutableFPNumber cc = new MutableFPNumber(composeFrac(), 39); diff --git a/poi/src/main/java/org/apache/poi/ss/util/NumberComparer.java b/poi/src/main/java/org/apache/poi/ss/util/NumberComparer.java index 31be44e834..0a6b35de44 100644 --- a/poi/src/main/java/org/apache/poi/ss/util/NumberComparer.java +++ b/poi/src/main/java/org/apache/poi/ss/util/NumberComparer.java @@ -24,9 +24,6 @@ import static org.apache.poi.ss.util.IEEEDouble.*; /** * Excel compares numbers using different rules to those of java, so * {@link Double#compare(double, double)} won't do. - * - * - * @author Josh Micich */ public final class NumberComparer { @@ -37,10 +34,9 @@ public final class NumberComparer { * decimal digits of precision and a decimal exponent, before completing the comparison. * <p> * In Excel formula evaluation, expressions like "(0.06-0.01)=0.05" evaluate to "TRUE" even - * though the equivalent java expression is <code>false</code>. In examples like this, + * though the equivalent java expression is {@code false}. In examples like this, * Excel achieves the effect by having additional logic for comparison operations. * <p> - * <p> * Note - Excel also gives special treatment to expressions like "0.06-0.01-0.05" which * evaluates to "0" (in java, rounding anomalies give a result of 6.9E-18). The special * behaviour here is for different reasons to the example above: If the last operator in a @@ -55,8 +51,8 @@ public final class NumberComparer { * This rule (for rounding the result of a final addition or subtraction), has not been * implemented in POI (as of Jul-2009). * - * @return <code>negative, 0, or positive</code> according to the standard Excel comparison - * of values <tt>a</tt> and <tt>b</tt>. + * @return {@code negative, 0, or positive} according to the standard Excel comparison + * of values {@code a} and {@code b}. */ public static int compare(double a, double b) { long rawBitsA = Double.doubleToLongBits(a); @@ -142,7 +138,7 @@ public final class NumberComparer { * Usually any normal number is greater (in magnitude) than any subnormal number. * However there are some anomalous cases around the threshold where Excel produces screwy results * @param isNegative both values are either negative or positive. This parameter affects the sign of the comparison result - * @return usually <code>isNegative ? -1 : +1</code> + * @return usually {@code isNegative ? -1 : +1} */ private static int compareAcrossSubnormalThreshold(long normalRawBitsA, long subnormalRawBitsB, boolean isNegative) { long fracB = subnormalRawBitsB & FRAC_MASK; diff --git a/poi/src/main/java/org/apache/poi/ss/util/NumberToTextConverter.java b/poi/src/main/java/org/apache/poi/ss/util/NumberToTextConverter.java index 7023063de2..c41cc96f67 100644 --- a/poi/src/main/java/org/apache/poi/ss/util/NumberToTextConverter.java +++ b/poi/src/main/java/org/apache/poi/ss/util/NumberToTextConverter.java @@ -20,14 +20,14 @@ package org.apache.poi.ss.util; /** * Excel converts numbers to text with different rules to those of java, so - * <code>Double.toString(value)</tt> won't do. + * {@code Double.toString(value)} won't do. * <ul> * <li>No more than 15 significant figures are output (java does 18).</li> * <li>The sign char for the exponent is included even if positive</li> - * <li>Special values (<tt>NaN</tt> and <tt>Infinity</tt>) get rendered like the ordinary + * <li>Special values ({@code NaN} and {@code Infinity}) get rendered like the ordinary * number that the bit pattern represents.</li> * <li>Denormalised values (between ±2<sup>-1074</sup> and ±2<sup>-1022</sup> - * are displayed as "0"</sup> + * are displayed as "0"</li> * </ul> * IEEE 64-bit Double Rendering Comparison * @@ -106,8 +106,6 @@ package org.apache.poi.ss.util; * Excel's text to number conversion is not a true <i>inverse</i> of this operation. The * allowable ranges are different. Some numbers that don't correctly convert to text actually * <b>do</b> get handled properly when used in arithmetic evaluations. - * - * @author Josh Micich */ public final class NumberToTextConverter { @@ -119,9 +117,9 @@ public final class NumberToTextConverter { } /** - * Converts the supplied <tt>value</tt> to the text representation that Excel would give if + * Converts the supplied {@code value} to the text representation that Excel would give if * the value were to appear in an unformatted cell, or as a literal number in a formula.<br> - * Note - the results from this method differ slightly from those of <tt>Double.toString()</tt> + * Note - the results from this method differ slightly from those of {@code Double.toString()} * In some special cases Excel behaves quite differently. This function attempts to reproduce * those results. */ diff --git a/poi/src/main/java/org/apache/poi/ss/util/SSCellRange.java b/poi/src/main/java/org/apache/poi/ss/util/SSCellRange.java index 766e2e3564..776d00f5d1 100644 --- a/poi/src/main/java/org/apache/poi/ss/util/SSCellRange.java +++ b/poi/src/main/java/org/apache/poi/ss/util/SSCellRange.java @@ -58,25 +58,31 @@ public final class SSCellRange<K extends Cell> implements CellRange<K> { return new SSCellRange<>(firstRow, firstColumn, height, width, flattenedArray); } - public int getHeight() { + @Override + public int getHeight() { return _height; } + @Override public int getWidth() { return _width; } + @Override public int size() { return _height*_width; } + @Override public String getReferenceText() { CellRangeAddress cra = new CellRangeAddress(_firstRow, _firstRow+_height-1, _firstColumn, _firstColumn+_width-1); return cra.formatAsString(); } + @Override public K getTopLeftCell() { return _flattenedArray[0]; } + @Override public K getCell(int relativeRowIndex, int relativeColumnIndex) { if (relativeRowIndex < 0 || relativeRowIndex >= _height) { throw new ArrayIndexOutOfBoundsException("Specified row " + relativeRowIndex @@ -89,10 +95,12 @@ public final class SSCellRange<K extends Cell> implements CellRange<K> { int flatIndex = _width * relativeRowIndex + relativeColumnIndex; return _flattenedArray[flatIndex]; } + @Override public K[] getFlattenedCells() { return _flattenedArray.clone(); } + @Override public K[][] getCells() { Class<?> itemCls = _flattenedArray.getClass(); @SuppressWarnings("unchecked") @@ -107,6 +115,7 @@ public final class SSCellRange<K extends Cell> implements CellRange<K> { return result; } + @Override public Iterator<K> iterator() { return Stream.of(_flattenedArray).iterator(); } diff --git a/poi/src/main/java/org/apache/poi/ss/util/SheetBuilder.java b/poi/src/main/java/org/apache/poi/ss/util/SheetBuilder.java index 32fdb134a3..cff608a0a9 100644 --- a/poi/src/main/java/org/apache/poi/ss/util/SheetBuilder.java +++ b/poi/src/main/java/org/apache/poi/ss/util/SheetBuilder.java @@ -5,9 +5,9 @@ The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - + http://www.apache.org/licenses/LICENSE-2.0 - + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -28,8 +28,6 @@ import org.apache.poi.ss.usermodel.Cell; * Class {@code SheetBuilder} provides an easy way of building workbook sheets * from 2D array of Objects. It can be used in test cases to improve code * readability or in Swing applications with tables. - * - * @author Roman Kashitsyn */ public class SheetBuilder { diff --git a/poi/src/main/java/org/apache/poi/ss/util/SheetUtil.java b/poi/src/main/java/org/apache/poi/ss/util/SheetUtil.java index 5033e8ec85..cda7674c83 100644 --- a/poi/src/main/java/org/apache/poi/ss/util/SheetUtil.java +++ b/poi/src/main/java/org/apache/poi/ss/util/SheetUtil.java @@ -43,8 +43,6 @@ import org.apache.poi.util.Internal; /** * Helper methods for when working with Usermodel sheets - * - * @author Yegor Kozlov */ public class SheetUtil { diff --git a/poi/src/main/java/org/apache/poi/ss/util/WorkbookUtil.java b/poi/src/main/java/org/apache/poi/ss/util/WorkbookUtil.java index 8475a0d53c..9153113e70 100644 --- a/poi/src/main/java/org/apache/poi/ss/util/WorkbookUtil.java +++ b/poi/src/main/java/org/apache/poi/ss/util/WorkbookUtil.java @@ -21,10 +21,10 @@ package org.apache.poi.ss.util; * Helper methods for when working with Usermodel Workbooks */ public class WorkbookUtil { - + /** * Creates a valid sheet name, which is conform to the rules. - * In any case, the result safely can be used for + * In any case, the result safely can be used for * {@link org.apache.poi.ss.usermodel.Workbook#setSheetName(int, String)}. * <br> * Rules: @@ -36,10 +36,10 @@ public class WorkbookUtil { * <li>Sheet names must not begin or end with ' (apostrophe)</li> * </ul> * Invalid characters are replaced by one space character ' '. - * + * * @param nameProposal can be any string, will be truncated if necessary, * allowed to be null - * @return a valid string, "empty" if to short, "null" if null + * @return a valid string, "empty" if to short, "null" if null */ public static String createSafeSheetName(final String nameProposal) { return createSafeSheetName(nameProposal, ' '); @@ -104,7 +104,7 @@ public class WorkbookUtil { * Validates sheet name. * * <p> - * The character count <tt>MUST</tt> be greater than or equal to 1 and less than or equal to 31. + * The character count {@code MUST} be greater than or equal to 1 and less than or equal to 31. * The string MUST NOT contain the any of the following characters: * <ul> * <li> 0x0000 </li> @@ -118,7 +118,6 @@ public class WorkbookUtil { * <li> closing square bracket (]) </li> * </ul> * The string MUST NOT begin or end with the single quote (') character. - * </p> * * @param sheetName the name to validate * @throws IllegalArgumentException if validation fails diff --git a/poi/src/main/java/org/apache/poi/ss/util/cellwalk/CellHandler.java b/poi/src/main/java/org/apache/poi/ss/util/cellwalk/CellHandler.java index 9fb4542c7d..25e8830434 100644 --- a/poi/src/main/java/org/apache/poi/ss/util/cellwalk/CellHandler.java +++ b/poi/src/main/java/org/apache/poi/ss/util/cellwalk/CellHandler.java @@ -5,9 +5,9 @@ The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - + http://www.apache.org/licenses/LICENSE-2.0 - + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -20,8 +20,7 @@ package org.apache.poi.ss.util.cellwalk; import org.apache.poi.ss.usermodel.Cell; /** - * Represents callback for CellWalk traverse method. - * @author Roman Kashitsyn + * Represents callback for CellWalk traverse method. */ public interface CellHandler { diff --git a/poi/src/main/java/org/apache/poi/ss/util/cellwalk/CellWalkContext.java b/poi/src/main/java/org/apache/poi/ss/util/cellwalk/CellWalkContext.java index f22bd6f584..ecf80895f2 100644 --- a/poi/src/main/java/org/apache/poi/ss/util/cellwalk/CellWalkContext.java +++ b/poi/src/main/java/org/apache/poi/ss/util/cellwalk/CellWalkContext.java @@ -5,9 +5,9 @@ The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - + http://www.apache.org/licenses/LICENSE-2.0 - + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -17,9 +17,6 @@ package org.apache.poi.ss.util.cellwalk; -/** - * @author Roman Kashitsyn - */ public interface CellWalkContext { /** diff --git a/poi/src/main/java/org/apache/poi/util/BitField.java b/poi/src/main/java/org/apache/poi/util/BitField.java index c9d669d92f..92e5180a65 100644 --- a/poi/src/main/java/org/apache/poi/util/BitField.java +++ b/poi/src/main/java/org/apache/poi/util/BitField.java @@ -21,9 +21,6 @@ package org.apache.poi.util; /** * Manage operations dealing with bit-mapped fields. - * - * @author Marc Johnson (mjohnson at apache dot org) - * @author Andrew C. Oliver (acoliver at apache dot org) */ @Internal(since="POI 3.15 beta 3") public class BitField diff --git a/poi/src/main/java/org/apache/poi/util/ByteField.java b/poi/src/main/java/org/apache/poi/util/ByteField.java index ca62277918..a28b32c6dd 100644 --- a/poi/src/main/java/org/apache/poi/util/ByteField.java +++ b/poi/src/main/java/org/apache/poi/util/ByteField.java @@ -15,7 +15,7 @@ See the License for the specific language governing permissions and limitations under the License. ==================================================================== */ - + package org.apache.poi.util; @@ -27,8 +27,6 @@ import java.nio.BufferUnderflowException; /** * representation of a byte (8-bit) field at a fixed location within a * byte array - * - * @author Marc Johnson (mjohnson at apache dot org */ public class ByteField diff --git a/poi/src/main/java/org/apache/poi/util/DelayableLittleEndianOutput.java b/poi/src/main/java/org/apache/poi/util/DelayableLittleEndianOutput.java index 6dd4930b9a..bcdc43ed3d 100644 --- a/poi/src/main/java/org/apache/poi/util/DelayableLittleEndianOutput.java +++ b/poi/src/main/java/org/apache/poi/util/DelayableLittleEndianOutput.java @@ -23,12 +23,10 @@ package org.apache.poi.util; * the header has been written. The client code can call {@link #createDelayedOutput(int)} * to reserve two bytes of the output for the 'ushort size' header field. The delayed output can * be written at any stage. - * - * @author Josh Micich */ public interface DelayableLittleEndianOutput extends LittleEndianOutput { /** - * Creates an output stream intended for outputting a sequence of <tt>size</tt> bytes. + * Creates an output stream intended for outputting a sequence of {@code size} bytes. */ LittleEndianOutput createDelayedOutput(int size); } diff --git a/poi/src/main/java/org/apache/poi/util/FixedField.java b/poi/src/main/java/org/apache/poi/util/FixedField.java index 45d6c6f714..f1334dfb09 100644 --- a/poi/src/main/java/org/apache/poi/util/FixedField.java +++ b/poi/src/main/java/org/apache/poi/util/FixedField.java @@ -15,7 +15,7 @@ See the License for the specific language governing permissions and limitations under the License. ==================================================================== */ - + package org.apache.poi.util; @@ -25,8 +25,6 @@ import java.io.*; /** * behavior of a field at a fixed location within a byte array - * - * @author Marc Johnson (mjohnson at apache dot org */ public interface FixedField diff --git a/poi/src/main/java/org/apache/poi/util/IOUtils.java b/poi/src/main/java/org/apache/poi/util/IOUtils.java index 115e05734d..7853f68ac1 100644 --- a/poi/src/main/java/org/apache/poi/util/IOUtils.java +++ b/poi/src/main/java/org/apache/poi/util/IOUtils.java @@ -231,7 +231,7 @@ public final class IOUtils { } /** - * Helper method, just calls <tt>readFully(in, b, 0, b.length)</tt> + * Helper method, just calls {@code readFully(in, b, 0, b.length)} * * @param in the stream from which the data is read. * @param b the buffer into which the data is read. @@ -248,14 +248,14 @@ public final class IOUtils { * <p>Same as the normal {@link InputStream#read(byte[], int, int)}, but tries to ensure * that the entire len number of bytes is read.</p> * - * <p>If the end of file is reached before any bytes are read, returns <tt>-1</tt>. If + * <p>If the end of file is reached before any bytes are read, returns {@code -1}. If * the end of the file is reached after some bytes are read, returns the - * number of bytes read. If the end of the file isn't reached before <tt>len</tt> - * bytes have been read, will return <tt>len</tt> bytes.</p> + * number of bytes read. If the end of the file isn't reached before {@code len} + * bytes have been read, will return {@code len} bytes.</p> * * @param in the stream from which the data is read. * @param b the buffer into which the data is read. - * @param off the start offset in array <tt>b</tt> at which the data is written. + * @param off the start offset in array {@code b} at which the data is written. * @param len the maximum number of bytes to read. * * @return the number of bytes read or -1 if no bytes were read @@ -277,7 +277,7 @@ public final class IOUtils { } /** - * Same as the normal <tt>channel.read(b)</tt>, but tries to ensure + * Same as the normal {@code channel.read(b)}, but tries to ensure * that the buffer is filled completely if possible, i.e. b.remaining() * returns 0. * <p> @@ -401,7 +401,7 @@ public final class IOUtils { /** * Quietly (no exceptions) close Closable resource. In case of error it will - * be printed to {@link IOUtils} class logger. + * be printed to IOUtils class logger. * * @param closeable * resource to close @@ -430,18 +430,15 @@ public final class IOUtils { * than delegating to {@link InputStream#skip(long)}. * This means that the method may be considerably less efficient than using the actual skip implementation, * this is done to guarantee that the correct number of bytes are skipped. - * </p> * <p> * This mimics POI's {@link #readFully(InputStream, byte[])}. - * If the end of file is reached before any bytes are read, returns <tt>-1</tt>. If + * If the end of file is reached before any bytes are read, returns {@code -1}. If * the end of the file is reached after some bytes are read, returns the - * number of bytes read. If the end of the file isn't reached before <tt>len</tt> - * bytes have been read, will return <tt>len</tt> bytes.</p> + * number of bytes read. If the end of the file isn't reached before {@code len} + * bytes have been read, will return {@code len} bytes. - * </p> * <p> * Copied nearly verbatim from commons-io 41a3e9c - * </p> * * @param input byte stream to skip * @param toSkip number of bytes to skip. diff --git a/poi/src/main/java/org/apache/poi/util/IntList.java b/poi/src/main/java/org/apache/poi/util/IntList.java index 4bfe8caffe..acb2ddda2f 100644 --- a/poi/src/main/java/org/apache/poi/util/IntList.java +++ b/poi/src/main/java/org/apache/poi/util/IntList.java @@ -40,8 +40,6 @@ package org.apache.poi.util; * remove(int index) * <li> subList is not supported * </ul> - * - * @author Marc Johnson */ public class IntList { diff --git a/poi/src/main/java/org/apache/poi/util/IntegerField.java b/poi/src/main/java/org/apache/poi/util/IntegerField.java index c86a008b77..63554dae33 100644 --- a/poi/src/main/java/org/apache/poi/util/IntegerField.java +++ b/poi/src/main/java/org/apache/poi/util/IntegerField.java @@ -15,7 +15,7 @@ See the License for the specific language governing permissions and limitations under the License. ==================================================================== */ - + package org.apache.poi.util; @@ -26,8 +26,6 @@ import java.io.*; /** * representation of an integer (32-bit) field at a fixed location * within a byte array - * - * @author Marc Johnson (mjohnson at apache dot org */ public class IntegerField diff --git a/poi/src/main/java/org/apache/poi/util/Internal.java b/poi/src/main/java/org/apache/poi/util/Internal.java index 565a908d7b..76c93b8e61 100644 --- a/poi/src/main/java/org/apache/poi/util/Internal.java +++ b/poi/src/main/java/org/apache/poi/util/Internal.java @@ -34,7 +34,6 @@ import java.lang.annotation.Documented; * not subject to the POI project policy of deprecating an element for 2 major * releases before removing. * - * @author Yegor Kozlov * @since POI-3.6 */ @Documented diff --git a/poi/src/main/java/org/apache/poi/util/LittleEndian.java b/poi/src/main/java/org/apache/poi/util/LittleEndian.java index 0ef687298f..09e9fd3ecb 100644 --- a/poi/src/main/java/org/apache/poi/util/LittleEndian.java +++ b/poi/src/main/java/org/apache/poi/util/LittleEndian.java @@ -32,8 +32,6 @@ public final class LittleEndian implements LittleEndianConsts { /** * Exception to handle buffer underruns - * - * @author Marc Johnson (mjohnson at apache dot org) */ public static final class BufferUnderrunException extends IOException { /** diff --git a/poi/src/main/java/org/apache/poi/util/LittleEndianConsts.java b/poi/src/main/java/org/apache/poi/util/LittleEndianConsts.java index 9f7e4a21a5..09ea2b186f 100644 --- a/poi/src/main/java/org/apache/poi/util/LittleEndianConsts.java +++ b/poi/src/main/java/org/apache/poi/util/LittleEndianConsts.java @@ -15,15 +15,12 @@ See the License for the specific language governing permissions and limitations under the License. ==================================================================== */ - + package org.apache.poi.util; /** * a repository for constants shared by classes within this package - * - * @author Marc Johnson - * @author Andrew C. Oliver (acoliver at apache dot org) */ public interface LittleEndianConsts { diff --git a/poi/src/main/java/org/apache/poi/util/LittleEndianOutput.java b/poi/src/main/java/org/apache/poi/util/LittleEndianOutput.java index 708d97bf4a..365899ec53 100644 --- a/poi/src/main/java/org/apache/poi/util/LittleEndianOutput.java +++ b/poi/src/main/java/org/apache/poi/util/LittleEndianOutput.java @@ -16,10 +16,7 @@ ==================================================================== */ package org.apache.poi.util; -/** - * - * @author Josh Micich - */ + public interface LittleEndianOutput { void writeByte(int v); void writeShort(int v); diff --git a/poi/src/main/java/org/apache/poi/util/LongField.java b/poi/src/main/java/org/apache/poi/util/LongField.java index 9aeffb36ea..6d1ecc678d 100644 --- a/poi/src/main/java/org/apache/poi/util/LongField.java +++ b/poi/src/main/java/org/apache/poi/util/LongField.java @@ -15,7 +15,7 @@ See the License for the specific language governing permissions and limitations under the License. ==================================================================== */ - + package org.apache.poi.util; @@ -26,8 +26,6 @@ import java.io.*; /** * representation of a long (16-bit) field at a fixed location within * a byte array - * - * @author Marc Johnson (mjohnson at apache dot org */ public class LongField diff --git a/poi/src/main/java/org/apache/poi/util/ShortField.java b/poi/src/main/java/org/apache/poi/util/ShortField.java index 29d91df7f4..424af8a858 100644 --- a/poi/src/main/java/org/apache/poi/util/ShortField.java +++ b/poi/src/main/java/org/apache/poi/util/ShortField.java @@ -15,7 +15,7 @@ See the License for the specific language governing permissions and limitations under the License. ==================================================================== */ - + package org.apache.poi.util; @@ -26,8 +26,6 @@ import java.io.*; /** * representation of a short (16-bit) field at a fixed location within * a byte array - * - * @author Marc Johnson (mjohnson at apache dot org */ public class ShortField diff --git a/poi/src/main/java/org/apache/poi/util/StringUtil.java b/poi/src/main/java/org/apache/poi/util/StringUtil.java index d281c63386..c635a536cd 100644 --- a/poi/src/main/java/org/apache/poi/util/StringUtil.java +++ b/poi/src/main/java/org/apache/poi/util/StringUtil.java @@ -51,7 +51,7 @@ public final class StringUtil { * byte array. it is assumed that string[ offset ] and string[ offset + * 1 ] contain the first 16-bit unicode character * @param len the length of the final string - * @return the converted string, never <code>null</code>. + * @return the converted string, never {@code null}. * @throws ArrayIndexOutOfBoundsException if offset is out of bounds for * the byte array (i.e., is negative or is greater than or equal to * string.length) @@ -85,7 +85,7 @@ public final class StringUtil { * { 0x16, 0x00 } -0x16 * * @param string the byte array to be converted - * @return the converted string, never <code>null</code> + * @return the converted string, never {@code null} */ public static String getFromUnicodeLE(byte[] string) { if (string.length == 0) { @@ -129,7 +129,7 @@ public final class StringUtil { } /** - * InputStream <tt>in</tt> is expected to contain: + * InputStream {@code in} is expected to contain: * <ol> * <li>ushort nChars</li> * <li>byte is16BitFlag</li> @@ -150,7 +150,7 @@ public final class StringUtil { } /** - * InputStream <tt>in</tt> is expected to contain: + * InputStream {@code in} is expected to contain: * <ol> * <li>byte is16BitFlag</li> * <li>byte[]/char[] characterData</li> @@ -170,7 +170,7 @@ public final class StringUtil { } /** - * OutputStream <tt>out</tt> will get: + * OutputStream {@code out} will get: * <ol> * <li>ushort nChars</li> * <li>byte is16BitFlag</li> @@ -191,7 +191,7 @@ public final class StringUtil { } /** - * OutputStream <tt>out</tt> will get: + * OutputStream {@code out} will get: * <ol> * <li>byte is16BitFlag</li> * <li>byte[]/char[] characterData</li> @@ -622,7 +622,7 @@ public final class StringUtil { * byte array. it is assumed that string[ offset ] and string[ offset + * 1 ] contain the first 16-bit unicode character * @param len the max. length of the final string - * @return the converted string, never <code>null</code>. + * @return the converted string, never {@code null}. * @throws ArrayIndexOutOfBoundsException if offset is out of bounds for * the byte array (i.e., is negative or is greater than or equal to * string.length) diff --git a/poi/src/test/java/org/apache/poi/POIDataSamples.java b/poi/src/test/java/org/apache/poi/POIDataSamples.java index d74839e3a7..0772017d0a 100644 --- a/poi/src/test/java/org/apache/poi/POIDataSamples.java +++ b/poi/src/test/java/org/apache/poi/POIDataSamples.java @@ -47,7 +47,7 @@ public final class POIDataSamples { private static POIDataSamples _instXmlDSign; private File _resolvedDataDir; - /** <code>true</code> if standard system propery is not set, + /** {@code true} if standard system propery is not set, * but the data is available on the test runtime classpath */ private boolean _sampleDataIsAvaliableOnClassPath; private final String _moduleDir; @@ -125,7 +125,7 @@ public final class POIDataSamples { * Opens a sample file from the test data directory * * @param sampleFileName the file to open - * @return an open <tt>InputStream</tt> for the specified sample file + * @return an open {@code InputStream} for the specified sample file */ public InputStream openResourceAsStream(String sampleFileName) { @@ -223,7 +223,7 @@ public final class POIDataSamples { * Opens a test sample file from the 'data' sub-package of this class's package. * * @param sampleFileName the file to open - * @return <code>null</code> if the sample file is not deployed on the classpath. + * @return {@code null} if the sample file is not deployed on the classpath. */ private InputStream openClasspathResource(String sampleFileName) { return getClass().getResourceAsStream("/" + _moduleDir + "/" + sampleFileName); diff --git a/poi/src/test/java/org/apache/poi/hssf/HSSFITestDataProvider.java b/poi/src/test/java/org/apache/poi/hssf/HSSFITestDataProvider.java index 5d80a26d53..9f073c1fa5 100644 --- a/poi/src/test/java/org/apache/poi/hssf/HSSFITestDataProvider.java +++ b/poi/src/test/java/org/apache/poi/hssf/HSSFITestDataProvider.java @@ -28,25 +28,22 @@ import org.apache.poi.ss.usermodel.FormulaEvaluator; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; -/** - * @author Yegor Kozlov - */ public final class HSSFITestDataProvider implements ITestDataProvider { public static final HSSFITestDataProvider instance = new HSSFITestDataProvider(); private HSSFITestDataProvider(){ // enforce singleton } - + @Override public HSSFWorkbook openSampleWorkbook(String sampleFileName) { return HSSFTestDataSamples.openSampleWorkbook(sampleFileName); } - + public InputStream openWorkbookStream(String sampleFileName) { return HSSFTestDataSamples.openSampleFileStream(sampleFileName); } - + @Override public HSSFWorkbook writeOutAndReadBack(Workbook original) { if(!(original instanceof HSSFWorkbook)) { @@ -54,22 +51,22 @@ public final class HSSFITestDataProvider implements ITestDataProvider { } return HSSFTestDataSamples.writeOutAndReadBack((HSSFWorkbook)original); } - + @Override public HSSFWorkbook createWorkbook(){ return new HSSFWorkbook(); } - + //************ SXSSF-specific methods ***************// @Override public HSSFWorkbook createWorkbook(int rowAccessWindowSize) { return createWorkbook(); } - + @Override public void trackAllColumnsForAutosizing(Sheet sheet) {} //************ End SXSSF-specific methods ***************// - + @Override public FormulaEvaluator createFormulaEvaluator(Workbook wb) { return new HSSFFormulaEvaluator((HSSFWorkbook) wb); @@ -79,12 +76,12 @@ public final class HSSFITestDataProvider implements ITestDataProvider { public byte[] getTestDataFileContent(String fileName) { return POIDataSamples.getSpreadSheetInstance().readFile(fileName); } - + @Override public SpreadsheetVersion getSpreadsheetVersion(){ return SpreadsheetVersion.EXCEL97; } - + @Override public String getStandardFileNameExtension() { return "xls"; diff --git a/poi/src/test/java/org/apache/poi/hssf/HSSFTestDataSamples.java b/poi/src/test/java/org/apache/poi/hssf/HSSFTestDataSamples.java index 2fe3359d4d..3835802725 100644 --- a/poi/src/test/java/org/apache/poi/hssf/HSSFTestDataSamples.java +++ b/poi/src/test/java/org/apache/poi/hssf/HSSFTestDataSamples.java @@ -28,8 +28,6 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook; /** * Centralises logic for finding/opening sample files in the src/testcases/org/apache/poi/hssf/hssf/data folder. - * - * @author Josh Micich */ public final class HSSFTestDataSamples { @@ -53,8 +51,8 @@ public final class HSSFTestDataSamples { } } /** - * Writes a spreadsheet to a <tt>ByteArrayOutputStream</tt> and reads it back - * from a <tt>ByteArrayInputStream</tt>.<p> + * Writes a spreadsheet to a {@code ByteArrayOutputStream} and reads it back + * from a {@code ByteArrayInputStream}.<p> * Useful for verifying that the serialisation round trip */ public static HSSFWorkbook writeOutAndReadBack(HSSFWorkbook original) { diff --git a/poi/src/test/java/org/apache/poi/hssf/model/TestFormulaParserIf.java b/poi/src/test/java/org/apache/poi/hssf/model/TestFormulaParserIf.java index f9c06bbedb..608427bae2 100644 --- a/poi/src/test/java/org/apache/poi/hssf/model/TestFormulaParserIf.java +++ b/poi/src/test/java/org/apache/poi/hssf/model/TestFormulaParserIf.java @@ -36,7 +36,7 @@ import org.apache.poi.ss.formula.ptg.StringPtg; import org.junit.jupiter.api.Test; /** - * Tests <tt>FormulaParser</tt> specifically with respect to IF() functions + * Tests {@code FormulaParser} specifically with respect to IF() functions */ final class TestFormulaParserIf { private static Ptg[] parseFormula(String formula) { diff --git a/poi/src/test/java/org/apache/poi/hssf/model/TestOperandClassTransformer.java b/poi/src/test/java/org/apache/poi/hssf/model/TestOperandClassTransformer.java index f36ee053a8..f7ff69ed66 100644 --- a/poi/src/test/java/org/apache/poi/hssf/model/TestOperandClassTransformer.java +++ b/poi/src/test/java/org/apache/poi/hssf/model/TestOperandClassTransformer.java @@ -35,7 +35,7 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; /** - * Tests specific formula examples in <tt>OperandClassTransformer</tt>. + * Tests specific formula examples in {@code OperandClassTransformer}. */ final class TestOperandClassTransformer { @@ -70,7 +70,7 @@ final class TestOperandClassTransformer { } /** - * In the example: <code>INDEX(PI(),1)</code>, Excel encodes PI() as 'array'. It is not clear + * In the example: {@code INDEX(PI(),1)}, Excel encodes PI() as 'array'. It is not clear * what rule justifies this. POI currently encodes it as 'value' which Excel(2007) seems to * tolerate. Changing the metadata for INDEX to have first parameter as 'array' class breaks * other formulas involving INDEX. It seems like a special case needs to be made. Perhaps an diff --git a/poi/src/test/java/org/apache/poi/hssf/model/TestRVA.java b/poi/src/test/java/org/apache/poi/hssf/model/TestRVA.java index 488a9e6fc5..5bc9583844 100644 --- a/poi/src/test/java/org/apache/poi/hssf/model/TestRVA.java +++ b/poi/src/test/java/org/apache/poi/hssf/model/TestRVA.java @@ -41,7 +41,7 @@ import org.junit.jupiter.params.provider.MethodSource; /** * Tests 'operand class' transformation performed by - * <tt>OperandClassTransformer</tt> by comparing its results with those + * {@code OperandClassTransformer} by comparing its results with those * directly produced by Excel (in a sample spreadsheet). */ final class TestRVA { diff --git a/poi/src/test/java/org/apache/poi/hssf/model/TestRowBlocksReader.java b/poi/src/test/java/org/apache/poi/hssf/model/TestRowBlocksReader.java index fde901216b..472dbba2b5 100644 --- a/poi/src/test/java/org/apache/poi/hssf/model/TestRowBlocksReader.java +++ b/poi/src/test/java/org/apache/poi/hssf/model/TestRowBlocksReader.java @@ -35,8 +35,6 @@ import org.junit.jupiter.api.Test; /** * Tests for {@link RowBlocksReader} - * - * @author Josh Micich */ final class TestRowBlocksReader { @Test diff --git a/poi/src/test/java/org/apache/poi/hssf/model/TestSheet.java b/poi/src/test/java/org/apache/poi/hssf/model/TestSheet.java index aef0c5e40b..8175d43584 100644 --- a/poi/src/test/java/org/apache/poi/hssf/model/TestSheet.java +++ b/poi/src/test/java/org/apache/poi/hssf/model/TestSheet.java @@ -419,7 +419,7 @@ final class TestSheet { /** * Prior to bug 45066, POI would get the estimated sheet size wrong - * when an <tt>UncalcedRecord</tt> was present.<p> + * when an {@code UncalcedRecord} was present. */ @Test void testUncalcSize_bug45066() { @@ -448,7 +448,7 @@ final class TestSheet { } /** - * Prior to bug 45145 <tt>RowRecordsAggregate</tt> and <tt>ValueRecordsAggregate</tt> could + * Prior to bug 45145 {@code RowRecordsAggregate} and {@code ValueRecordsAggregate} could * sometimes occur in reverse order. This test reproduces one of those situations and makes * sure that RRA comes before VRA.<br> * diff --git a/poi/src/test/java/org/apache/poi/hssf/record/TestFeatRecord.java b/poi/src/test/java/org/apache/poi/hssf/record/TestFeatRecord.java index c6a9cd9581..18a1cdc0cc 100644 --- a/poi/src/test/java/org/apache/poi/hssf/record/TestFeatRecord.java +++ b/poi/src/test/java/org/apache/poi/hssf/record/TestFeatRecord.java @@ -35,7 +35,7 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.junit.jupiter.api.Test; /** - * Tests for <tt>FeatRecord</tt> + * Tests for {@code FeatRecord} */ final class TestFeatRecord { @Test diff --git a/poi/src/test/java/org/apache/poi/hssf/record/TestLabelRecord.java b/poi/src/test/java/org/apache/poi/hssf/record/TestLabelRecord.java index 84946bd6b2..bb365e648a 100644 --- a/poi/src/test/java/org/apache/poi/hssf/record/TestLabelRecord.java +++ b/poi/src/test/java/org/apache/poi/hssf/record/TestLabelRecord.java @@ -27,7 +27,7 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.junit.jupiter.api.Test; /** - * Tests for <tt>LabelRecord</tt> + * Tests for {@code LabelRecord} */ final class TestLabelRecord { diff --git a/poi/src/test/java/org/apache/poi/hssf/record/TestRecordFactoryInputStream.java b/poi/src/test/java/org/apache/poi/hssf/record/TestRecordFactoryInputStream.java index 9c7d6be428..0e1bc1589b 100644 --- a/poi/src/test/java/org/apache/poi/hssf/record/TestRecordFactoryInputStream.java +++ b/poi/src/test/java/org/apache/poi/hssf/record/TestRecordFactoryInputStream.java @@ -31,8 +31,6 @@ import org.junit.jupiter.api.Test; /** * Tests for {@link RecordFactoryInputStream} - * - * @author Josh Micich */ final class TestRecordFactoryInputStream { /** diff --git a/poi/src/test/java/org/apache/poi/hssf/record/TestSSTDeserializer.java b/poi/src/test/java/org/apache/poi/hssf/record/TestSSTDeserializer.java index 7bde03cb06..6e120a5276 100644 --- a/poi/src/test/java/org/apache/poi/hssf/record/TestSSTDeserializer.java +++ b/poi/src/test/java/org/apache/poi/hssf/record/TestSSTDeserializer.java @@ -30,8 +30,6 @@ import org.junit.jupiter.api.Test; /** * Exercise the SSTDeserializer class. - * - * @author Glen Stampoultzis (glens at apache.org) */ final class TestSSTDeserializer { private static final int FAKE_SID = -5555; diff --git a/poi/src/test/java/org/apache/poi/hssf/record/TestSharedFormulaRecord.java b/poi/src/test/java/org/apache/poi/hssf/record/TestSharedFormulaRecord.java index 17855c08de..afd8298896 100644 --- a/poi/src/test/java/org/apache/poi/hssf/record/TestSharedFormulaRecord.java +++ b/poi/src/test/java/org/apache/poi/hssf/record/TestSharedFormulaRecord.java @@ -70,7 +70,7 @@ final class TestSharedFormulaRecord { }; /** - * The method <tt>SharedFormulaRecord.convertSharedFormulas()</tt> converts formulas from + * The method {@code SharedFormulaRecord.convertSharedFormulas()} converts formulas from * 'shared formula' to 'single cell formula' format. It is important that token operand * classes are preserved during this transformation, because Excel may not tolerate the * incorrect encoding. The formula here is one such example (Excel displays #VALUE!). diff --git a/poi/src/test/java/org/apache/poi/hssf/record/TestTextObjectRecord.java b/poi/src/test/java/org/apache/poi/hssf/record/TestTextObjectRecord.java index 272b1802e1..83a5144562 100644 --- a/poi/src/test/java/org/apache/poi/hssf/record/TestTextObjectRecord.java +++ b/poi/src/test/java/org/apache/poi/hssf/record/TestTextObjectRecord.java @@ -33,8 +33,6 @@ import org.junit.jupiter.api.Test; /** * Tests that serialization and deserialization of the TextObjectRecord . * Test data taken directly from a real Excel file. - * - * @author Yegor Kozlov */ final class TestTextObjectRecord { diff --git a/poi/src/test/java/org/apache/poi/hssf/record/TestcaseRecordInputStream.java b/poi/src/test/java/org/apache/poi/hssf/record/TestcaseRecordInputStream.java index 93c62912a9..1d38a8e7ac 100644 --- a/poi/src/test/java/org/apache/poi/hssf/record/TestcaseRecordInputStream.java +++ b/poi/src/test/java/org/apache/poi/hssf/record/TestcaseRecordInputStream.java @@ -32,8 +32,6 @@ import org.apache.poi.util.LittleEndianInput; * A Record Input Stream derivative that makes access to byte arrays used in the * test cases work a bit easier. * <p> Creates the stream and moves to the first record. - * - * @author Jason Height (jheight at apache.org) */ public final class TestcaseRecordInputStream { @@ -52,8 +50,8 @@ public final class TestcaseRecordInputStream { return create(mergeDataAndSid(sid, data.length, data)); } /** - * First 4 bytes of <tt>data</tt> are assumed to be record identifier and length. The supplied - * <tt>data</tt> can contain multiple records (sequentially encoded in the same way) + * First 4 bytes of {@code data} are assumed to be record identifier and length. The supplied + * {@code data} can contain multiple records (sequentially encoded in the same way) */ public static RecordInputStream create(byte[] data) { InputStream is = new ByteArrayInputStream(data); diff --git a/poi/src/test/java/org/apache/poi/hssf/record/aggregates/TestValueRecordsAggregate.java b/poi/src/test/java/org/apache/poi/hssf/record/aggregates/TestValueRecordsAggregate.java index 38018f3627..570ec4f5ac 100644 --- a/poi/src/test/java/org/apache/poi/hssf/record/aggregates/TestValueRecordsAggregate.java +++ b/poi/src/test/java/org/apache/poi/hssf/record/aggregates/TestValueRecordsAggregate.java @@ -215,15 +215,15 @@ final class TestValueRecordsAggregate { } /** - * Sometimes the 'shared formula' flag (<tt>FormulaRecord.isSharedFormula()</tt>) is set when + * Sometimes the 'shared formula' flag ({@code FormulaRecord.isSharedFormula()}) is set when * there is no corresponding SharedFormulaRecord available. SharedFormulaRecord definitions do * not span multiple sheets. They are are only defined within a sheet, and thus they do not * have a sheet index field (only row and column range fields).<br> * So it is important that the code which locates the SharedFormulaRecord for each - * FormulaRecord does not allow matches across sheets.</br> + * FormulaRecord does not allow matches across sheets.<p> * - * Prior to bugzilla 44449 (Feb 2008), POI <tt>ValueRecordsAggregate.construct(int, List)</tt> - * allowed <tt>SharedFormulaRecord</tt>s to be erroneously used across sheets. That incorrect + * Prior to bugzilla 44449 (Feb 2008), POI {@code ValueRecordsAggregate.construct(int, List)} + * allowed {@code SharedFormulaRecord}s to be erroneously used across sheets. That incorrect * behaviour is shown by this test.<p> * * <b>Notes on how to produce the test spreadsheet</b>:</p> @@ -237,10 +237,10 @@ final class TestValueRecordsAggregate { * <li>Four rows on Sheet1 "5" through "8" were deleted ('delete rows' alt-E D, not 'clear' Del).</li> * <li>The spreadsheet was saved as AbnormalSharedFormulaFlag.xls.</li> * </ol> - * Prior to the row delete action the spreadsheet has two <tt>SharedFormulaRecord</tt>s. One + * Prior to the row delete action the spreadsheet has two {@code SharedFormulaRecord}s. One * for each sheet. To expose the bug, the shared formulas have been made to overlap.<br> * The row delete action (as described here) seems to to delete the - * <tt>SharedFormulaRecord</tt> from Sheet1 (but not clear the 'shared formula' flags.<br> + * {@code SharedFormulaRecord} from Sheet1 (but not clear the 'shared formula' flags.<br> * There are other variations on this theme to create the same effect. * */ diff --git a/poi/src/test/java/org/apache/poi/hssf/record/cf/TestCellRange.java b/poi/src/test/java/org/apache/poi/hssf/record/cf/TestCellRange.java index cb0a6a548b..52f3d3147d 100644 --- a/poi/src/test/java/org/apache/poi/hssf/record/cf/TestCellRange.java +++ b/poi/src/test/java/org/apache/poi/hssf/record/cf/TestCellRange.java @@ -43,7 +43,7 @@ final class TestCellRange { biggest, tenthColumn, tenthRow, box10x10, box9x9, box10to20c, oneCell, }; - /** cross-reference of <tt>contains()</tt> operations for sampleRanges against itself */ + /** cross-reference of {@code contains()} operations for sampleRanges against itself */ private static final boolean [][] containsExpectedResults = { // biggest, tenthColumn, tenthRow, box10x10, box9x9, box10to20c, oneCell diff --git a/poi/src/test/java/org/apache/poi/hssf/record/common/TestUnicodeString.java b/poi/src/test/java/org/apache/poi/hssf/record/common/TestUnicodeString.java index 45151b90ff..35f84590f7 100644 --- a/poi/src/test/java/org/apache/poi/hssf/record/common/TestUnicodeString.java +++ b/poi/src/test/java/org/apache/poi/hssf/record/common/TestUnicodeString.java @@ -47,8 +47,6 @@ import org.junit.jupiter.api.Test; /** * Tests that {@link UnicodeString} record size calculates correctly. The record size * is used when serializing {@link SSTRecord}s. - * - * @author Jason Height (jheight at apache.org) */ final class TestUnicodeString { private static final int MAX_DATA_SIZE = RecordInputStream.MAX_RECORD_DATA_SIZE; @@ -61,7 +59,7 @@ final class TestUnicodeString { } /** - * Note - a value of zero for <tt>amountUsedInCurrentRecord</tt> would only ever occur just + * Note - a value of zero for {@code amountUsedInCurrentRecord} would only ever occur just * after a {@link ContinueRecord} had been started. In the initial {@link SSTRecord} this * value starts at 8 (for the first {@link UnicodeString} written). In general, it can be * any value between 0 and {@link #MAX_DATA_SIZE} @@ -432,7 +430,7 @@ final class TestUnicodeString { } /** - * @param is16Bit if <code>true</code> the created string will have characters > 0x00FF + * @param is16Bit if {@code true} the created string will have characters > 0x00FF * @return a string of the specified number of characters */ private static UnicodeString makeUnicodeString(int numChars, boolean is16Bit) { diff --git a/poi/src/test/java/org/apache/poi/hssf/usermodel/FormulaExtractor.java b/poi/src/test/java/org/apache/poi/hssf/usermodel/FormulaExtractor.java index c44b3c0c7b..a9db1d5497 100644 --- a/poi/src/test/java/org/apache/poi/hssf/usermodel/FormulaExtractor.java +++ b/poi/src/test/java/org/apache/poi/hssf/usermodel/FormulaExtractor.java @@ -22,16 +22,14 @@ import org.apache.poi.hssf.record.aggregates.FormulaRecordAggregate; import org.apache.poi.ss.formula.ptg.Ptg; /** - * Test utility class to get <tt>Ptg</tt> arrays out of formula cells - * - * @author Josh Micich + * Test utility class to get {@code Ptg} arrays out of formula cells */ public final class FormulaExtractor { private FormulaExtractor() { // no instances of this class } - + public static Ptg[] getPtgs(HSSFCell cell) { CellValueRecordInterface vr = cell.getCellValueRecord(); if (!(vr instanceof FormulaRecordAggregate)) { diff --git a/poi/src/test/java/org/apache/poi/hssf/usermodel/HSSFEvaluationTestHelper.java b/poi/src/test/java/org/apache/poi/hssf/usermodel/HSSFEvaluationTestHelper.java index 96196c146e..c299fc428f 100644 --- a/poi/src/test/java/org/apache/poi/hssf/usermodel/HSSFEvaluationTestHelper.java +++ b/poi/src/test/java/org/apache/poi/hssf/usermodel/HSSFEvaluationTestHelper.java @@ -20,9 +20,7 @@ package org.apache.poi.hssf.usermodel; import org.apache.poi.ss.formula.EvaluationCell; /** - * Raises visibility of some internal functionality for test purposes - * - * @author Josh Micich + * Raises visibility of some internal functionality for test purposes */ public final class HSSFEvaluationTestHelper { diff --git a/poi/src/test/java/org/apache/poi/hssf/usermodel/StreamUtility.java b/poi/src/test/java/org/apache/poi/hssf/usermodel/StreamUtility.java index d467333ffc..26dbcc5cfb 100644 --- a/poi/src/test/java/org/apache/poi/hssf/usermodel/StreamUtility.java +++ b/poi/src/test/java/org/apache/poi/hssf/usermodel/StreamUtility.java @@ -27,8 +27,6 @@ import java.util.List; * any significant detail. Normally this task would be simple except for the presence of artifacts * in the file that change every time it is generated. Usually these volatile artifacts are * time-stamps, user names, or other machine dependent parameters. - * - * @author Josh Micich */ public final class StreamUtility { diff --git a/poi/src/test/java/org/apache/poi/hssf/usermodel/TestCloneSheet.java b/poi/src/test/java/org/apache/poi/hssf/usermodel/TestCloneSheet.java index cb3d92d113..5b4739d4ab 100644 --- a/poi/src/test/java/org/apache/poi/hssf/usermodel/TestCloneSheet.java +++ b/poi/src/test/java/org/apache/poi/hssf/usermodel/TestCloneSheet.java @@ -37,7 +37,6 @@ import org.junit.jupiter.api.Test; * Test the ability to clone a sheet. * If adding new records that belong to a sheet (as opposed to a book) * add that record to the sheet in the testCloneSheetBasic method. - * @author avik */ final class TestCloneSheet extends BaseTestCloneSheet { public TestCloneSheet() { diff --git a/poi/src/test/java/org/apache/poi/hssf/usermodel/TestDataValidation.java b/poi/src/test/java/org/apache/poi/hssf/usermodel/TestDataValidation.java index 4a120b2ac6..777e436e32 100644 --- a/poi/src/test/java/org/apache/poi/hssf/usermodel/TestDataValidation.java +++ b/poi/src/test/java/org/apache/poi/hssf/usermodel/TestDataValidation.java @@ -50,8 +50,6 @@ import org.junit.jupiter.api.Test; /** * Class for testing Excel's data validation mechanism - * - * @author Dragos Buleandra ( dragos.buleandra@trade2b.ro ) */ final class TestDataValidation extends BaseTestDataValidation { diff --git a/poi/src/test/java/org/apache/poi/hssf/usermodel/TestHSSFComment.java b/poi/src/test/java/org/apache/poi/hssf/usermodel/TestHSSFComment.java index 181cd5052b..d6d36a18ce 100644 --- a/poi/src/test/java/org/apache/poi/hssf/usermodel/TestHSSFComment.java +++ b/poi/src/test/java/org/apache/poi/hssf/usermodel/TestHSSFComment.java @@ -48,8 +48,6 @@ import org.junit.jupiter.api.Test; /** * Tests TestHSSFCellComment. - * - * @author Yegor Kozlov */ final class TestHSSFComment extends BaseTestCellComment { diff --git a/poi/src/test/java/org/apache/poi/hssf/usermodel/TestHSSFHyperlink.java b/poi/src/test/java/org/apache/poi/hssf/usermodel/TestHSSFHyperlink.java index 67cb04010d..3bf170d73f 100644 --- a/poi/src/test/java/org/apache/poi/hssf/usermodel/TestHSSFHyperlink.java +++ b/poi/src/test/java/org/apache/poi/hssf/usermodel/TestHSSFHyperlink.java @@ -32,8 +32,6 @@ import org.junit.jupiter.api.Test; /** * Tests HSSFHyperlink. - * - * @author Yegor Kozlov */ final class TestHSSFHyperlink extends BaseTestHyperlink { diff --git a/poi/src/test/java/org/apache/poi/hssf/usermodel/TestHSSFRow.java b/poi/src/test/java/org/apache/poi/hssf/usermodel/TestHSSFRow.java index b588f1375c..d58a00f838 100644 --- a/poi/src/test/java/org/apache/poi/hssf/usermodel/TestHSSFRow.java +++ b/poi/src/test/java/org/apache/poi/hssf/usermodel/TestHSSFRow.java @@ -34,8 +34,6 @@ import org.junit.jupiter.api.Test; /** * Test HSSFRow is okay. - * - * @author Glen Stampoultzis (glens at apache.org) */ final class TestHSSFRow extends BaseTestRow { diff --git a/poi/src/test/java/org/apache/poi/hssf/usermodel/TestHSSFSheetShiftRows.java b/poi/src/test/java/org/apache/poi/hssf/usermodel/TestHSSFSheetShiftRows.java index d78c3bf660..96273fe965 100644 --- a/poi/src/test/java/org/apache/poi/hssf/usermodel/TestHSSFSheetShiftRows.java +++ b/poi/src/test/java/org/apache/poi/hssf/usermodel/TestHSSFSheetShiftRows.java @@ -20,9 +20,6 @@ package org.apache.poi.hssf.usermodel; import org.apache.poi.hssf.HSSFITestDataProvider; import org.apache.poi.ss.usermodel.BaseTestSheetShiftRows; -/** - * @author Yegor Kozlov - */ final class TestHSSFSheetShiftRows extends BaseTestSheetShiftRows { public TestHSSFSheetShiftRows() { diff --git a/poi/src/test/java/org/apache/poi/hssf/usermodel/TestReadWriteChart.java b/poi/src/test/java/org/apache/poi/hssf/usermodel/TestReadWriteChart.java index f1e9f0ef1f..77e89f040e 100644 --- a/poi/src/test/java/org/apache/poi/hssf/usermodel/TestReadWriteChart.java +++ b/poi/src/test/java/org/apache/poi/hssf/usermodel/TestReadWriteChart.java @@ -33,9 +33,6 @@ import org.apache.poi.ss.usermodel.DateUtil; import org.apache.poi.util.LocaleUtil; import org.junit.jupiter.api.Test; -/** - * @author Glen Stampoultzis (glens at apache.org) - */ final class TestReadWriteChart { /** diff --git a/poi/src/test/java/org/apache/poi/hssf/usermodel/TestSanityChecker.java b/poi/src/test/java/org/apache/poi/hssf/usermodel/TestSanityChecker.java index 428fb3030e..16f268a69e 100644 --- a/poi/src/test/java/org/apache/poi/hssf/usermodel/TestSanityChecker.java +++ b/poi/src/test/java/org/apache/poi/hssf/usermodel/TestSanityChecker.java @@ -35,8 +35,6 @@ import org.junit.jupiter.api.Test; /** * A Test case for a test utility class.<br> * Okay, this may seem strange but I need to test my test logic. - * - * @author Glen Stampoultzis (glens at apache.org) */ final class TestSanityChecker { private static final Record INTERFACEHDR = new InterfaceHdrRecord(InterfaceHdrRecord.CODEPAGE); diff --git a/poi/src/test/java/org/apache/poi/hssf/usermodel/TestText.java b/poi/src/test/java/org/apache/poi/hssf/usermodel/TestText.java index a7065cda2e..6cea76d5bf 100644 --- a/poi/src/test/java/org/apache/poi/hssf/usermodel/TestText.java +++ b/poi/src/test/java/org/apache/poi/hssf/usermodel/TestText.java @@ -28,10 +28,6 @@ import org.apache.poi.hssf.record.ObjRecord; import org.apache.poi.hssf.record.TextObjectRecord; import org.junit.jupiter.api.Test; -/** - * @author Evgeniy Berlog - * @date 25.06.12 - */ class TestText { @Test diff --git a/poi/src/test/java/org/apache/poi/hssf/usermodel/TestUnfixedBugs.java b/poi/src/test/java/org/apache/poi/hssf/usermodel/TestUnfixedBugs.java index 76701fd1dd..ac1ed44f1b 100644 --- a/poi/src/test/java/org/apache/poi/hssf/usermodel/TestUnfixedBugs.java +++ b/poi/src/test/java/org/apache/poi/hssf/usermodel/TestUnfixedBugs.java @@ -32,8 +32,6 @@ import org.apache.poi.ss.usermodel.Workbook; import org.junit.jupiter.api.Test; /** - * @author aviks - * * This testcase contains tests for bugs that are yet to be fixed. Therefore, * the standard ant test target does not run these tests. Run this testcase with * the single-test target. The names of the tests usually correspond to the diff --git a/poi/src/test/java/org/apache/poi/poifs/eventfilesystem/Listener.java b/poi/src/test/java/org/apache/poi/poifs/eventfilesystem/Listener.java index 4b597c1719..f584af239f 100644 --- a/poi/src/test/java/org/apache/poi/poifs/eventfilesystem/Listener.java +++ b/poi/src/test/java/org/apache/poi/poifs/eventfilesystem/Listener.java @@ -15,20 +15,14 @@ See the License for the specific language governing permissions and limitations under the License. ==================================================================== */ - + package org.apache.poi.poifs.eventfilesystem; /** * Class Listener - * - * @author Marc Johnson (mjohnson at apache dot org) - * @version %I%, %G% */ - -class Listener - implements POIFSReaderListener -{ +class Listener implements POIFSReaderListener { /** * Process a POIFSReaderEvent that this listener had registered diff --git a/poi/src/test/java/org/apache/poi/poifs/eventfilesystem/TestPOIFSReaderRegistry.java b/poi/src/test/java/org/apache/poi/poifs/eventfilesystem/TestPOIFSReaderRegistry.java index 1eb939f961..9bfc7be578 100644 --- a/poi/src/test/java/org/apache/poi/poifs/eventfilesystem/TestPOIFSReaderRegistry.java +++ b/poi/src/test/java/org/apache/poi/poifs/eventfilesystem/TestPOIFSReaderRegistry.java @@ -30,8 +30,6 @@ import org.junit.jupiter.api.Test; /** * Class to test POIFSReaderRegistry functionality - * - * @author Marc Johnson */ final class TestPOIFSReaderRegistry { private final POIFSReaderListener[] listeners = diff --git a/poi/src/test/java/org/apache/poi/poifs/filesystem/ReaderWriter.java b/poi/src/test/java/org/apache/poi/poifs/filesystem/ReaderWriter.java index ed2ce941ab..195682ae75 100644 --- a/poi/src/test/java/org/apache/poi/poifs/filesystem/ReaderWriter.java +++ b/poi/src/test/java/org/apache/poi/poifs/filesystem/ReaderWriter.java @@ -15,7 +15,7 @@ See the License for the specific language governing permissions and limitations under the License. ==================================================================== */ - + package org.apache.poi.poifs.filesystem; @@ -34,13 +34,8 @@ import org.apache.poi.util.IOUtils; /** * Test (Proof of concept) program that employs the * POIFSReaderListener and POIFSWriterListener interfaces - * - * @author Marc Johnson (mjohnson at apache dot org) */ - -public final class ReaderWriter - implements POIFSReaderListener, POIFSWriterListener -{ +public final class ReaderWriter implements POIFSReaderListener, POIFSWriterListener { private final DirectoryEntry root; // keys are DocumentDescriptors, values are byte[]s diff --git a/poi/src/test/java/org/apache/poi/poifs/property/TestRootProperty.java b/poi/src/test/java/org/apache/poi/poifs/property/TestRootProperty.java index 4b311a8ec8..de51fcefde 100644 --- a/poi/src/test/java/org/apache/poi/poifs/property/TestRootProperty.java +++ b/poi/src/test/java/org/apache/poi/poifs/property/TestRootProperty.java @@ -31,8 +31,6 @@ import org.junit.jupiter.api.Test; /** * Class to test RootProperty functionality - * - * @author Marc Johnson */ final class TestRootProperty { private RootProperty _property; diff --git a/poi/src/test/java/org/apache/poi/sl/draw/geom/TestFormulaParser.java b/poi/src/test/java/org/apache/poi/sl/draw/geom/TestFormulaParser.java index a99041c852..a4274d56da 100644 --- a/poi/src/test/java/org/apache/poi/sl/draw/geom/TestFormulaParser.java +++ b/poi/src/test/java/org/apache/poi/sl/draw/geom/TestFormulaParser.java @@ -24,8 +24,6 @@ import org.junit.jupiter.api.Test; /** * Date: 10/24/11 - * - * @author Yegor Kozlov */ class TestFormulaParser { @Test diff --git a/poi/src/test/java/org/apache/poi/ss/ITestDataProvider.java b/poi/src/test/java/org/apache/poi/ss/ITestDataProvider.java index e258e1a4a2..7feeca2e6a 100644 --- a/poi/src/test/java/org/apache/poi/ss/ITestDataProvider.java +++ b/poi/src/test/java/org/apache/poi/ss/ITestDataProvider.java @@ -46,8 +46,8 @@ public interface ITestDataProvider { * @return an instance of Workbook */ Workbook createWorkbook(); - - + + //************ SXSSF-specific methods ***************// /** * Provides way of creating a SXSSFWorkbook with a specific row access window size. @@ -55,7 +55,7 @@ public interface ITestDataProvider { * @return an instance of Workbook */ Workbook createWorkbook(int rowAccessWindowSize); - + /** * Only matters for SXSSF - enables tracking of the column * widths so that autosizing can work. No-op on others. @@ -65,17 +65,17 @@ public interface ITestDataProvider { /** * Creates the corresponding {@link FormulaEvaluator} for the - * type of Workbook handled by this Provider. + * type of Workbook handled by this Provider. * * @param wb The workbook to base the formula evaluator on. - * @return A new instance of a matching type of formula evaluator. + * @return A new instance of a matching type of formula evaluator. */ FormulaEvaluator createFormulaEvaluator(Workbook wb); /** * Opens a sample file from the standard HSSF test data directory * - * @return an open <tt>InputStream</tt> for the specified sample file + * @return an open {@code InputStream} for the specified sample file */ byte[] getTestDataFileContent(String fileName); diff --git a/poi/src/test/java/org/apache/poi/ss/formula/EvaluationListener.java b/poi/src/test/java/org/apache/poi/ss/formula/EvaluationListener.java index 3524c3f7d0..3f385cde6f 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/EvaluationListener.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/EvaluationListener.java @@ -23,8 +23,6 @@ import org.apache.poi.ss.formula.eval.ValueEval; * Tests should extend this class if they need to track the internal working of the {@link WorkbookEvaluator}.<br> * * Default method implementations all do nothing - * - * @author Josh Micich */ public abstract class EvaluationListener implements IEvaluationListener { @Override diff --git a/poi/src/test/java/org/apache/poi/ss/formula/TestSheetNameFormatter.java b/poi/src/test/java/org/apache/poi/ss/formula/TestSheetNameFormatter.java index 484e5597cb..b2bcc080de 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/TestSheetNameFormatter.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/TestSheetNameFormatter.java @@ -26,8 +26,6 @@ import org.junit.jupiter.api.Test; /** * Tests for {@link SheetNameFormatter} - * - * @author Josh Micich */ final class TestSheetNameFormatter { /** diff --git a/poi/src/test/java/org/apache/poi/ss/formula/TestWorkbookEvaluator.java b/poi/src/test/java/org/apache/poi/ss/formula/TestWorkbookEvaluator.java index 39eafbe65f..b0d6a019d4 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/TestWorkbookEvaluator.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/TestWorkbookEvaluator.java @@ -54,8 +54,6 @@ import org.junit.jupiter.api.Test; /** * Tests {@link WorkbookEvaluator}. - * - * @author Josh Micich */ class TestWorkbookEvaluator { diff --git a/poi/src/test/java/org/apache/poi/ss/formula/WorkbookEvaluatorTestHelper.java b/poi/src/test/java/org/apache/poi/ss/formula/WorkbookEvaluatorTestHelper.java index 673cb9500c..9001e9dc9a 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/WorkbookEvaluatorTestHelper.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/WorkbookEvaluatorTestHelper.java @@ -22,8 +22,6 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook; /** * Allows tests to execute {@link WorkbookEvaluator}s and track the internal workings. - * - * @author Josh Micich */ public final class WorkbookEvaluatorTestHelper { diff --git a/poi/src/test/java/org/apache/poi/ss/formula/eval/EvalInstances.java b/poi/src/test/java/org/apache/poi/ss/formula/eval/EvalInstances.java index 4a15444773..1a84fb06fb 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/eval/EvalInstances.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/eval/EvalInstances.java @@ -21,8 +21,6 @@ import org.apache.poi.ss.formula.functions.Function; /** * Collects eval instances for easy access by tests in this package - * - * @author Josh Micich */ final class EvalInstances { private EvalInstances() { diff --git a/poi/src/test/java/org/apache/poi/ss/formula/eval/TestAreaEval.java b/poi/src/test/java/org/apache/poi/ss/formula/eval/TestAreaEval.java index 40b9a09715..37618b8536 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/eval/TestAreaEval.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/eval/TestAreaEval.java @@ -28,7 +28,7 @@ import org.apache.poi.ss.util.AreaReference; import org.junit.jupiter.api.Test; /** - * Tests for <tt>AreaEval</tt> + * Tests for {@code AreaEval} */ final class TestAreaEval { diff --git a/poi/src/test/java/org/apache/poi/ss/formula/eval/TestFormulasFromSpreadsheet.java b/poi/src/test/java/org/apache/poi/ss/formula/eval/TestFormulasFromSpreadsheet.java index 80ddc6d988..19147487c4 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/eval/TestFormulasFromSpreadsheet.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/eval/TestFormulasFromSpreadsheet.java @@ -44,10 +44,10 @@ import org.junit.jupiter.params.provider.MethodSource; /** * Tests formulas and operators as loaded from a test data spreadsheet.<p> - * This class does not test implementors of <tt>Function</tt> and <tt>OperationEval</tt> in - * isolation. Much of the evaluation engine (i.e. <tt>HSSFFormulaEvaluator</tt>, ...) gets + * This class does not test implementors of {@code Function} and {@code OperationEval} in + * isolation. Much of the evaluation engine (i.e. {@code HSSFFormulaEvaluator}, ...) gets * exercised as well. Tests for bug fixes and specific/tricky behaviour can be found in the - * corresponding test class (<tt>TestXxxx</tt>) of the target (<tt>Xxxx</tt>) implementor, + * corresponding test class ({@code TestXxxx}) of the target ({@code Xxxx}) implementor, * where execution can be observed more easily. */ public final class TestFormulasFromSpreadsheet { @@ -125,7 +125,7 @@ public final class TestFormulasFromSpreadsheet { /** * @param startRowIndex row index in the spreadsheet where the first function/operator is found - * Typically pass <code>null</code> to test all functions + * Typically pass {@code null} to test all functions */ private static void processFunctionGroup(List<Arguments> data, int startRowIndex) { for (int rowIndex = startRowIndex; true; rowIndex += SS.NUMBER_OF_ROWS_PER_FUNCTION) { @@ -202,7 +202,7 @@ public final class TestFormulasFromSpreadsheet { } } /** - * @return <code>null</code> if cell is missing, empty or blank + * @return {@code null} if cell is missing, empty or blank */ private static String getTargetFunctionName(Row r) { if(r == null) { diff --git a/poi/src/test/java/org/apache/poi/ss/formula/eval/TestHSSFCircularReferences.java b/poi/src/test/java/org/apache/poi/ss/formula/eval/TestHSSFCircularReferences.java index 90d9739efb..5eba366903 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/eval/TestHSSFCircularReferences.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/eval/TestHSSFCircularReferences.java @@ -21,8 +21,6 @@ import org.apache.poi.hssf.HSSFITestDataProvider; /** * Tests HSSFFormulaEvaluator for its handling of cell formula circular references. - * - * @author Josh Micich */ final class TestHSSFCircularReferences extends BaseTestCircularReferences { public TestHSSFCircularReferences() { diff --git a/poi/src/test/java/org/apache/poi/ss/formula/eval/TestOperandResolver.java b/poi/src/test/java/org/apache/poi/ss/formula/eval/TestOperandResolver.java index f37b818142..cadd4eb4cf 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/eval/TestOperandResolver.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/eval/TestOperandResolver.java @@ -27,7 +27,7 @@ import java.util.Map; import org.junit.jupiter.api.Test; /** - * Tests for <tt>OperandResolver</tt> + * Tests for {@code OperandResolver} */ final class TestOperandResolver { @Test diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/BaseTestNumeric.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/BaseTestNumeric.java index d5e02e0de8..33111ed2d5 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/BaseTestNumeric.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/BaseTestNumeric.java @@ -22,10 +22,6 @@ package org.apache.poi.ss.formula.functions; import static org.junit.jupiter.api.Assertions.assertTrue; -/** - * @author Amol S. Deshmukh < amolweb at ya hoo dot com > - * - */ public abstract class BaseTestNumeric { public static final double POS_ZERO = 1E-4; diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/EvalFactory.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/EvalFactory.java index 345b4fb80c..f58beac4da 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/EvalFactory.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/EvalFactory.java @@ -32,9 +32,7 @@ import org.apache.poi.ss.formula.ptg.RefPtg; import org.apache.poi.ss.util.AreaReference; /** - * Test helper class for creating mock <code>Eval</code> objects - * - * @author Josh Micich + * Test helper class for creating mock {@code Eval} objects */ public final class EvalFactory { diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestBin2Dec.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestBin2Dec.java index e873ba227c..934f532c8c 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestBin2Dec.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestBin2Dec.java @@ -31,8 +31,6 @@ import org.junit.jupiter.api.Test; /** * Tests for {@link Bin2Dec} - * - * @author cedric dot walter @ gmail dot com */ final class TestBin2Dec { diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestCode.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestCode.java index 32dd466ba8..03ed1785bf 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestCode.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestCode.java @@ -25,8 +25,6 @@ import org.junit.jupiter.api.Test; /** * Tests for {@link Code} - * - * @author cedric dot walter @ gmail dot com */ class TestCode { private static ValueEval invokeValue(String number1) { diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestComplex.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestComplex.java index 018e2222f3..3c1bb4413b 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestComplex.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestComplex.java @@ -25,8 +25,6 @@ import org.junit.jupiter.api.Test; /** * Tests for {@link Complex} - * - * @author cedric dot walter @ gmail dot com */ class TestComplex { private static ValueEval invokeValue(String real_num, String i_num, String suffix) { diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestDate.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestDate.java index 82d0e82742..ea7a162b77 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestDate.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestDate.java @@ -29,9 +29,6 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; -/** - * @author Pavel Krupets (pkrupets at palmtreebusiness dot com) - */ final class TestDate { private HSSFCell cell11; diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestDateValue.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestDateValue.java index fe487b6815..9738546998 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestDateValue.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestDateValue.java @@ -37,8 +37,6 @@ import org.junit.jupiter.api.Test; /** * Tests for Excel function DATEVALUE() - * - * @author Milosz Rembisz */ final class TestDateValue { diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestDays360.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestDays360.java index b796a4d5b9..161b7b98b0 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestDays360.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestDays360.java @@ -80,7 +80,7 @@ final class TestDays360 { } /** - * The <tt>method</tt> parameter only makes a difference when the second parameter + * The {@code method} parameter only makes a difference when the second parameter * is the last day of the month that does <em>not</em> have 30 days. */ @Test diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestDec2Bin.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestDec2Bin.java index d745603a5a..4b6d5ca2c8 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestDec2Bin.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestDec2Bin.java @@ -34,8 +34,6 @@ import org.junit.jupiter.api.Test; /** * Tests for {@link Dec2Bin} - * - * @author cedric dot walter @ gmail dot com */ final class TestDec2Bin { diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestDec2Hex.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestDec2Hex.java index 125f9c4396..aac4cfd751 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestDec2Hex.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestDec2Hex.java @@ -34,8 +34,6 @@ import org.junit.jupiter.api.Test; /** * Tests for {@link Dec2Hex} - * - * @author cedric dot walter @ gmail dot com */ final class TestDec2Hex { diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestDelta.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestDelta.java index 83aee557f3..f6a735d290 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestDelta.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestDelta.java @@ -27,8 +27,6 @@ import org.junit.jupiter.api.Test; /** * Tests for {@link org.apache.poi.ss.formula.functions.Delta} - * - * @author cedric dot walter @ gmail dot com */ final class TestDelta { diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestFinanceLib.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestFinanceLib.java index e0d2aca4c5..5f61c88da0 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestFinanceLib.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestFinanceLib.java @@ -23,10 +23,6 @@ package org.apache.poi.ss.formula.functions; import org.junit.jupiter.api.Test; -/** - * @author Amol S. Deshmukh < amolweb at ya hoo dot com > - * - */ class TestFinanceLib extends BaseTestNumeric { @Test @@ -39,7 +35,7 @@ class TestFinanceLib extends BaseTestNumeric { f = FinanceLib.fv(r, n, y, p, t); x = -2; assertDouble("fv ", x, f); - + r = 0.12/12; n = 12; y = -1000; p = 0; t = false; f = FinanceLib.fv(r, n, y, p, t); x = 12682.50301319; diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestFrequency.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestFrequency.java index 6dd04d13c1..550ad3c779 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestFrequency.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestFrequency.java @@ -32,8 +32,6 @@ import org.junit.jupiter.api.Test; /** * Testcase for the function FREQUENCY(data, bins) - * - * @author Yegor Kozlov */ class TestFrequency { diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestHex2Dec.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestHex2Dec.java index ba5bae0b1f..4afa0e37cb 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestHex2Dec.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestHex2Dec.java @@ -31,8 +31,6 @@ import org.junit.jupiter.api.Test; /** * Tests for {@link Hex2Dec} - * - * @author cedric dot walter @ gmail dot com */ final class TestHex2Dec { diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestIndex.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestIndex.java index b39e396c04..9141f92b6f 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestIndex.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestIndex.java @@ -144,7 +144,7 @@ final class TestIndex { /** * Confirms that the result is an area ref with the specified coordinates - * @return <tt>ve</tt> cast to {@link AreaEval} if it is valid + * @return {@code ve} cast to {@link AreaEval} if it is valid */ private static AreaEval confirmAreaEval(String refText, ValueEval ve) { CellRangeAddress cra = CellRangeAddress.valueOf(refText); diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestIndirectFunctionFromSpreadsheet.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestIndirectFunctionFromSpreadsheet.java index f3a8cccb4f..36b9dc2050 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestIndirectFunctionFromSpreadsheet.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestIndirectFunctionFromSpreadsheet.java @@ -25,7 +25,7 @@ import org.junit.jupiter.params.provider.Arguments; * Tests INDIRECT() as loaded from a test data spreadsheet.<p> * * Tests for bug fixes and specific/tricky behaviour can be found in the corresponding test class - * (<tt>TestXxxx</tt>) of the target (<tt>Xxxx</tt>) implementor, where execution can be observed + * ({@code TestXxxx}) of the target ({@code Xxxx}) implementor, where execution can be observed * more easily. */ final class TestIndirectFunctionFromSpreadsheet extends BaseTestFunctionsFromSpreadsheet { diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestIntercept.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestIntercept.java index 03dac3cef2..2ff1df501c 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestIntercept.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestIntercept.java @@ -33,8 +33,6 @@ import org.junit.jupiter.api.Test; /** * Test for Excel function INTERCEPT() - * - * @author Johan Karlsteen */ final class TestIntercept { private static final Function INTERCEPT = new Intercept(); diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestIsBlank.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestIsBlank.java index 9f6ece060c..6477f7692a 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestIsBlank.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestIsBlank.java @@ -31,8 +31,6 @@ import org.junit.jupiter.api.Test; /** * Tests for Excel function ISBLANK() - * - * @author Josh Micich */ final class TestIsBlank { diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestLeftRight.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestLeftRight.java index 4bf92c7196..287d7efca7 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestLeftRight.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestLeftRight.java @@ -29,8 +29,6 @@ import org.junit.jupiter.api.Test; * * Test cases for {@link TextFunction#LEFT} and {@link TextFunction#RIGHT} * - * @author Brendan Nolan - * */ class TestLeftRight { diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestLen.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestLen.java index b4d8aa7a13..176242b18f 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestLen.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestLen.java @@ -29,8 +29,6 @@ import org.junit.jupiter.api.Test; /** * Tests for Excel function LEN() - * - * @author Josh Micich */ final class TestLen { diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestLookupFunctionsFromSpreadsheet.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestLookupFunctionsFromSpreadsheet.java index 84d3674b70..57e7e0eb80 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestLookupFunctionsFromSpreadsheet.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestLookupFunctionsFromSpreadsheet.java @@ -27,7 +27,7 @@ import org.junit.jupiter.params.provider.Arguments; * functions have more complex test cases and test data setup. * * Tests for bug fixes and specific/tricky behaviour can be found in the corresponding test class - * (<tt>TestXxxx</tt>) of the target (<tt>Xxxx</tt>) implementor, where execution can be observed + * ({@code TestXxxx}) of the target ({@code Xxxx}) implementor, where execution can be observed * more easily. */ final class TestLookupFunctionsFromSpreadsheet extends BaseTestFunctionsFromSpreadsheet { diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestMatch.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestMatch.java index 3721c688df..d6a1ac849e 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestMatch.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestMatch.java @@ -237,7 +237,7 @@ final class TestMatch { /** - * Ensures that the match_type argument can be an <tt>AreaEval</tt>.<br> + * Ensures that the match_type argument can be an {@code AreaEval}.<br> * Bugzilla 44421 */ @Test diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestMatchFunctionsFromSpreadsheet.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestMatchFunctionsFromSpreadsheet.java index 7f6f8ca2e6..d6e56d5dec 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestMatchFunctionsFromSpreadsheet.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestMatchFunctionsFromSpreadsheet.java @@ -25,7 +25,7 @@ import org.junit.jupiter.params.provider.Arguments; * Tests Match functions as loaded from a test data spreadsheet.<p> * * Tests for bug fixes and specific/tricky behaviour can be found in the corresponding test class - * (<tt>TestXxxx</tt>) of the target (<tt>Xxxx</tt>) implementor, where execution can be observed + * ({@code TestXxxx}) of the target ({@code Xxxx}) implementor, where execution can be observed * more easily. */ final class TestMatchFunctionsFromSpreadsheet extends BaseTestFunctionsFromSpreadsheet { diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestMathX.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestMathX.java index e408fceb7e..b7fd5bbf6e 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestMathX.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestMathX.java @@ -26,10 +26,6 @@ import org.apache.poi.ss.formula.functions.XYNumericFunction.Accumulator; import org.junit.jupiter.api.Test; -/** - * @author Amol S. Deshmukh < amolweb at ya hoo dot com > - * - */ public class TestMathX extends BaseTestNumeric { @Test diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestMid.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestMid.java index 866c65fb4a..47be2014b4 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestMid.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestMid.java @@ -31,8 +31,6 @@ import org.junit.jupiter.api.Test; /** * Tests for Excel function MID() - * - * @author Josh Micich */ final class TestMid { diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestMirr.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestMirr.java index f640cb54ee..84843e6b44 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestMirr.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestMirr.java @@ -35,8 +35,6 @@ import org.junit.jupiter.api.Test; /** * Tests for {@link org.apache.poi.ss.formula.functions.Mirr} * - * @author Carlos Delgado (carlos dot del dot est at gmail dot com) - * @author Cedric Walter (cedric dot walter at gmail dot com) * @see org.apache.poi.ss.formula.functions.TestIrr */ final class TestMirr { diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestOct2Dec.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestOct2Dec.java index 89c19277d2..0afac10eed 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestOct2Dec.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestOct2Dec.java @@ -27,8 +27,6 @@ import org.junit.jupiter.api.Test; /** * Tests for {@link org.apache.poi.ss.formula.functions.Oct2Dec} - * - * @author cedric dot walter @ gmail dot com */ final class TestOct2Dec { diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestOffset.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestOffset.java index fd2ada7b97..8c6264ecda 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestOffset.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestOffset.java @@ -36,8 +36,6 @@ import org.junit.jupiter.params.provider.CsvSource; /** * Tests for OFFSET function implementation - * - * @author Josh Micich */ final class TestOffset { diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestPoisson.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestPoisson.java index 35ee88c29d..6f8fc2685f 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestPoisson.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestPoisson.java @@ -27,7 +27,6 @@ import org.junit.jupiter.api.Test; /** * Tests for Excel function POISSON(x,mean,cumulative) - * @author Kalpesh Parmar */ class TestPoisson { diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestQuotient.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestQuotient.java index 15968199b5..838beb576a 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestQuotient.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestQuotient.java @@ -26,8 +26,6 @@ import org.junit.jupiter.api.Test; /** * Tests for {@link Quotient} - * - * @author cedric dot walter @ gmail dot com */ class TestQuotient { private static ValueEval invokeValue(String numerator, String denominator) { diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestRoundFuncs.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestRoundFuncs.java index 4450528822..431719f9e4 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestRoundFuncs.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestRoundFuncs.java @@ -28,8 +28,6 @@ import org.junit.jupiter.api.Test; /** * Test cases for ROUND(), ROUNDUP(), ROUNDDOWN() - * - * @author Josh Micich */ final class TestRoundFuncs { // github-43 diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestSlope.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestSlope.java index 5c8bc1eb33..2ccd3977f3 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestSlope.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestSlope.java @@ -28,8 +28,6 @@ import org.junit.jupiter.api.Test; /** * Test for Excel function SLOPE() - * - * @author Johan Karlsteen */ final class TestSlope { private static final Function SLOPE = new Slope(); diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestSumproduct.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestSumproduct.java index 35ee48d26c..f357af6875 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestSumproduct.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestSumproduct.java @@ -30,8 +30,6 @@ import org.junit.jupiter.api.Test; /** * Test cases for SUMPRODUCT() - * - * @author Josh Micich */ final class TestSumproduct { diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestTFunc.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestTFunc.java index 03cb480e47..08bd4c1dd8 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestTFunc.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestTFunc.java @@ -33,8 +33,6 @@ import org.junit.jupiter.api.Test; /** * Test cases for Excel function T() - * - * @author Josh Micich */ final class TestTFunc { diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestTrim.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestTrim.java index efee41b996..ec71ae0656 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestTrim.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestTrim.java @@ -29,8 +29,6 @@ import org.junit.jupiter.api.Test; /** * Tests for Excel function TRIM() - * - * @author Josh Micich */ final class TestTrim { diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestTrunc.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestTrunc.java index 6e1d5d8cac..782461ef24 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestTrunc.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestTrunc.java @@ -27,8 +27,6 @@ import org.junit.jupiter.api.Test; /** * Test case for TRUNC() - * - * @author Stephen Wolke (smwolke at geistig.com) */ final class TestTrunc extends BaseTestNumeric { private static final NumericFunction F = null; diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestXYNumericFunction.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestXYNumericFunction.java index b97e80171e..54f50049c2 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestXYNumericFunction.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestXYNumericFunction.java @@ -26,8 +26,6 @@ import org.junit.jupiter.api.Test; /** * Tests for Excel functions SUMX2MY2(), SUMX2PY2(), SUMXMY2() - * - * @author Josh Micich */ final class TestXYNumericFunction { private static final Function SUM_SQUARES = new Sumx2py2(); diff --git a/poi/src/test/java/org/apache/poi/ss/formula/ptg/TestArrayPtg.java b/poi/src/test/java/org/apache/poi/ss/formula/ptg/TestArrayPtg.java index c5a1b44bd0..278034d165 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/ptg/TestArrayPtg.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/ptg/TestArrayPtg.java @@ -29,7 +29,7 @@ import org.apache.poi.util.LittleEndianInput; import org.junit.jupiter.api.Test; /** - * Tests for <tt>ArrayPtg</tt> + * Tests for {@code ArrayPtg} */ final class TestArrayPtg { diff --git a/poi/src/test/java/org/apache/poi/ss/formula/ptg/TestExternalFunctionFormulas.java b/poi/src/test/java/org/apache/poi/ss/formula/ptg/TestExternalFunctionFormulas.java index fedc639764..ccdc392661 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/ptg/TestExternalFunctionFormulas.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/ptg/TestExternalFunctionFormulas.java @@ -34,7 +34,7 @@ import org.junit.jupiter.api.Test; final class TestExternalFunctionFormulas { /** - * tests <tt>NameXPtg.toFormulaString(Workbook)</tt> and logic in Workbook below that + * tests {@code NameXPtg.toFormulaString(Workbook)} and logic in Workbook below that */ @Test void testReadFormulaContainingExternalFunction() throws Exception { diff --git a/poi/src/test/java/org/apache/poi/ss/formula/ptg/TestExternalNameReference.java b/poi/src/test/java/org/apache/poi/ss/formula/ptg/TestExternalNameReference.java index 0c582c5cf7..5b014725be 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/ptg/TestExternalNameReference.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/ptg/TestExternalNameReference.java @@ -39,7 +39,7 @@ final class TestExternalNameReference { double NEW_QUANT = 7.0d; double NEW_PART_COST = 15.3d; /** - * tests <tt>NameXPtg for external cell reference by name</tt> and logic in Workbook below that + * tests {@code NameXPtg for external cell reference by name} and logic in Workbook below that */ @Test void testReadCalcSheet() { diff --git a/poi/src/test/java/org/apache/poi/ss/formula/ptg/TestFuncVarPtg.java b/poi/src/test/java/org/apache/poi/ss/formula/ptg/TestFuncVarPtg.java index 2eb91217cb..ebf1d3a260 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/ptg/TestFuncVarPtg.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/ptg/TestFuncVarPtg.java @@ -24,17 +24,15 @@ import org.apache.poi.hssf.model.HSSFFormulaParser; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.junit.jupiter.api.Test; -/** - * @author Josh Micich - */ final class TestFuncVarPtg { /** * The first fix for bugzilla 44675 broke the encoding of SUM formulas (and probably others). * The operand classes of the parameters to SUM() should be coerced to 'reference' not 'value'. * In the case of SUM, Excel evaluates the formula to '#VALUE!' if a parameter operand class is - * wrong. In other cases Excel seems to tolerate bad operand classes.</p> - * This functionality is related to the setParameterRVA() methods of <tt>FormulaParser</tt> + * wrong. In other cases Excel seems to tolerate bad operand classes.<p> + * + * This functionality is related to the setParameterRVA() methods of {@code FormulaParser} */ @Test void testOperandClass() { diff --git a/poi/src/test/java/org/apache/poi/ss/usermodel/BaseTestDataValidation.java b/poi/src/test/java/org/apache/poi/ss/usermodel/BaseTestDataValidation.java index ccfd8293c0..ba68155194 100644 --- a/poi/src/test/java/org/apache/poi/ss/usermodel/BaseTestDataValidation.java +++ b/poi/src/test/java/org/apache/poi/ss/usermodel/BaseTestDataValidation.java @@ -29,8 +29,6 @@ import org.junit.jupiter.api.Test; /** * Class for testing Excel's data validation mechanism - * - * @author Dragos Buleandra ( dragos.buleandra@trade2b.ro ) */ public abstract class BaseTestDataValidation { private final ITestDataProvider _testDataProvider; diff --git a/poi/src/test/java/org/apache/poi/ss/usermodel/BaseTestFont.java b/poi/src/test/java/org/apache/poi/ss/usermodel/BaseTestFont.java index d0d2b0c535..d8e1e6dde3 100644 --- a/poi/src/test/java/org/apache/poi/ss/usermodel/BaseTestFont.java +++ b/poi/src/test/java/org/apache/poi/ss/usermodel/BaseTestFont.java @@ -32,9 +32,6 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; -/** - * @author Yegor Kozlov - */ public abstract class BaseTestFont { private final ITestDataProvider _testDataProvider; diff --git a/poi/src/test/java/org/apache/poi/ss/usermodel/BaseTestHyperlink.java b/poi/src/test/java/org/apache/poi/ss/usermodel/BaseTestHyperlink.java index 44a33c3f20..e5ef5312d9 100644 --- a/poi/src/test/java/org/apache/poi/ss/usermodel/BaseTestHyperlink.java +++ b/poi/src/test/java/org/apache/poi/ss/usermodel/BaseTestHyperlink.java @@ -29,9 +29,7 @@ import org.apache.poi.ss.ITestDataProvider; import org.junit.jupiter.api.Test; /** - * Test diffrent types of Excel hyperlinks - * - * @author Yegor Kozlov + * Test different types of Excel hyperlinks */ public abstract class BaseTestHyperlink { diff --git a/poi/src/test/java/org/apache/poi/ss/usermodel/BaseTestSheetAutosizeColumn.java b/poi/src/test/java/org/apache/poi/ss/usermodel/BaseTestSheetAutosizeColumn.java index 3afec95478..5e8a41c1c4 100644 --- a/poi/src/test/java/org/apache/poi/ss/usermodel/BaseTestSheetAutosizeColumn.java +++ b/poi/src/test/java/org/apache/poi/ss/usermodel/BaseTestSheetAutosizeColumn.java @@ -35,8 +35,6 @@ import org.junit.jupiter.api.Test; /** * Common superclass for testing automatic sizing of sheet columns - * - * @author Yegor Kozlov */ public abstract class BaseTestSheetAutosizeColumn { diff --git a/poi/src/test/java/org/apache/poi/ss/usermodel/BaseTestSheetShiftRows.java b/poi/src/test/java/org/apache/poi/ss/usermodel/BaseTestSheetShiftRows.java index 67d351bffc..6c8e2f2a93 100644 --- a/poi/src/test/java/org/apache/poi/ss/usermodel/BaseTestSheetShiftRows.java +++ b/poi/src/test/java/org/apache/poi/ss/usermodel/BaseTestSheetShiftRows.java @@ -41,9 +41,6 @@ import org.junit.jupiter.api.Test; /** * Tests row shifting capabilities. - * - * @author Shawn Laubach (slaubach at apache dot com) - * @author Toshiaki Kamoshida (kamoshida.toshiaki at future dot co dot jp) */ public abstract class BaseTestSheetShiftRows { diff --git a/poi/src/test/java/org/apache/poi/ss/usermodel/TestHSSFBorderStyle.java b/poi/src/test/java/org/apache/poi/ss/usermodel/TestHSSFBorderStyle.java index 202ffae308..5d3123d3bb 100644 --- a/poi/src/test/java/org/apache/poi/ss/usermodel/TestHSSFBorderStyle.java +++ b/poi/src/test/java/org/apache/poi/ss/usermodel/TestHSSFBorderStyle.java @@ -19,9 +19,6 @@ package org.apache.poi.ss.usermodel; import org.apache.poi.hssf.HSSFITestDataProvider; -/** - * @author Yegor Kozlov - */ final class TestHSSFBorderStyle extends BaseTestBorderStyle { public TestHSSFBorderStyle() { diff --git a/poi/src/test/java/org/apache/poi/ss/usermodel/TestIndexedColors.java b/poi/src/test/java/org/apache/poi/ss/usermodel/TestIndexedColors.java index d336ea95cd..ac260b73e9 100644 --- a/poi/src/test/java/org/apache/poi/ss/usermodel/TestIndexedColors.java +++ b/poi/src/test/java/org/apache/poi/ss/usermodel/TestIndexedColors.java @@ -22,9 +22,6 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import org.junit.jupiter.api.Test; -/** - * @author Yegor Kozlov - */ final class TestIndexedColors { @Test diff --git a/poi/src/test/java/org/apache/poi/ss/util/NumberComparingSpreadsheetGenerator.java b/poi/src/test/java/org/apache/poi/ss/util/NumberComparingSpreadsheetGenerator.java index d8664487ce..8c241a6464 100644 --- a/poi/src/test/java/org/apache/poi/ss/util/NumberComparingSpreadsheetGenerator.java +++ b/poi/src/test/java/org/apache/poi/ss/util/NumberComparingSpreadsheetGenerator.java @@ -37,8 +37,6 @@ import org.apache.poi.util.HexDump; * (along with their expected results) that get encoded into rows of the spreadsheet. * Each example is checked with a formula (in column I) that displays either "OK" or * "ERROR" depending on whether actual results match those expected. - * - * @author Josh Micich */ public class NumberComparingSpreadsheetGenerator { diff --git a/poi/src/test/java/org/apache/poi/ss/util/NumberComparisonExamples.java b/poi/src/test/java/org/apache/poi/ss/util/NumberComparisonExamples.java index 925f968b37..398649c361 100644 --- a/poi/src/test/java/org/apache/poi/ss/util/NumberComparisonExamples.java +++ b/poi/src/test/java/org/apache/poi/ss/util/NumberComparisonExamples.java @@ -22,9 +22,7 @@ import java.util.Collections; import java.util.List; /** - * Contains specific examples of <tt>double</tt> value pairs and their comparison result according to Excel. - * - * @author Josh Micich + * Contains specific examples of {@code double} value pairs and their comparison result according to Excel. */ final class NumberComparisonExamples { @@ -116,29 +114,27 @@ final class NumberComparisonExamples { addStepTransition(temp, 0x001000000000001BL); addStepTransition(temp, 0x001000000000002FL); - Collections.addAll(temp, new ComparisonExample[]{ - // negative, and exponents differ by more than 1 - ce(0xBF30000000000000L, 0xBE60000000000000L, -1), - - // negative zero *is* less than positive zero, but not easy to get out of calculations - ce(0x0000000000000000L, 0x8000000000000000L, +1), - // subnormal numbers compare without rounding for some reason - ce(0x0000000000000000L, 0x0000000000000001L, -1), - ce(0x0008000000000000L, 0x0008000000000001L, -1), - ce(0x000FFFFFFFFFFFFFL, 0x000FFFFFFFFFFFFEL, +1), - ce(0x000FFFFFFFFFFFFBL, 0x000FFFFFFFFFFFFCL, -1), - ce(0x000FFFFFFFFFFFFBL, 0x000FFFFFFFFFFFFEL, -1), - - // across subnormal threshold (some mistakes when close) - ce(0x000FFFFFFFFFFFFFL, 0x0010000000000000L, +1), - ce(0x000FFFFFFFFFFFFBL, 0x0010000000000007L, +1), - ce(0x000FFFFFFFFFFFFAL, 0x0010000000000007L, 0), - - // when a bit further apart - normal results - ce(0x000FFFFFFFFFFFF9L, 0x0010000000000007L, -1), - ce(0x000FFFFFFFFFFFFAL, 0x0010000000000008L, -1), - ce(0x000FFFFFFFFFFFFBL, 0x0010000000000008L, -1), - }); + Collections.addAll(temp, // negative, and exponents differ by more than 1 + ce(0xBF30000000000000L, 0xBE60000000000000L, -1), + + // negative zero *is* less than positive zero, but not easy to get out of calculations + ce(0x0000000000000000L, 0x8000000000000000L, +1), + // subnormal numbers compare without rounding for some reason + ce(0x0000000000000000L, 0x0000000000000001L, -1), + ce(0x0008000000000000L, 0x0008000000000001L, -1), + ce(0x000FFFFFFFFFFFFFL, 0x000FFFFFFFFFFFFEL, +1), + ce(0x000FFFFFFFFFFFFBL, 0x000FFFFFFFFFFFFCL, -1), + ce(0x000FFFFFFFFFFFFBL, 0x000FFFFFFFFFFFFEL, -1), + + // across subnormal threshold (some mistakes when close) + ce(0x000FFFFFFFFFFFFFL, 0x0010000000000000L, +1), + ce(0x000FFFFFFFFFFFFBL, 0x0010000000000007L, +1), + ce(0x000FFFFFFFFFFFFAL, 0x0010000000000007L, 0), + + // when a bit further apart - normal results + ce(0x000FFFFFFFFFFFF9L, 0x0010000000000007L, -1), + ce(0x000FFFFFFFFFFFFAL, 0x0010000000000008L, -1), + ce(0x000FFFFFFFFFFFFBL, 0x0010000000000008L, -1)); ComparisonExample[] result = new ComparisonExample[temp.size()]; temp.toArray(result); @@ -150,11 +146,10 @@ final class NumberComparisonExamples { } private static void addStepTransition(List<ComparisonExample> temp, long rawBits) { - Collections.addAll(temp, new ComparisonExample[]{ - ce(rawBits - 1, rawBits + 0, 0), - ce(rawBits + 0, rawBits + 1, -1), - ce(rawBits + 1, rawBits + 2, 0), - }); + Collections.addAll(temp, + ce(rawBits - 1, rawBits + 0, 0), + ce(rawBits + 0, rawBits + 1, -1), + ce(rawBits + 1, rawBits + 2, 0)); } diff --git a/poi/src/test/java/org/apache/poi/ss/util/NumberRenderingSpreadsheetGenerator.java b/poi/src/test/java/org/apache/poi/ss/util/NumberRenderingSpreadsheetGenerator.java index 0014a1f539..c2ef0dfdc1 100644 --- a/poi/src/test/java/org/apache/poi/ss/util/NumberRenderingSpreadsheetGenerator.java +++ b/poi/src/test/java/org/apache/poi/ss/util/NumberRenderingSpreadsheetGenerator.java @@ -41,8 +41,6 @@ import org.apache.poi.util.HexRead; /** * Creates a spreadsheet that demonstrates Excel's rendering of various IEEE double values. - * - * @author Josh Micich */ public class NumberRenderingSpreadsheetGenerator { @@ -80,7 +78,7 @@ public class NumberRenderingSpreadsheetGenerator { } /** 0x7ff8000000000000 encoded in little endian order */ private static final byte[] JAVA_NAN_BYTES = HexRead.readFromString("00 00 00 00 00 00 F8 7F"); - + private static void writeHeaderCell(HSSFRow row, int i, String text, HSSFCellStyle style) { HSSFCell cell = row.createCell(i); cell.setCellValue(new HSSFRichTextString(text)); @@ -104,22 +102,22 @@ public class NumberRenderingSpreadsheetGenerator { writeHeaderCell(row, 2, "JDK Double Rendering", style); writeHeaderCell(row, 3, "Actual Rendering", style); writeHeaderCell(row, 4, "Expected Rendering", style); - writeHeaderCell(row, 5, "Match", style); + writeHeaderCell(row, 5, "Match", style); writeHeaderCell(row, 6, "Java Metadata", style); } static void writeDataRow(HSSFSheet sheet, int rowIx, long rawLongBits, String expectedExcelRendering) { double d = Double.longBitsToDouble(rawLongBits); HSSFRow row = sheet.createRow(rowIx); - + int rowNum = rowIx + 1; String cel0ref = "A" + rowNum; String rawBitsText = formatLongAsHex(rawLongBits); String jmExpr = "'ec(" + rawBitsText + ", ''\" & C" + rowNum + " & \"'', ''\" & D" + rowNum + " & \"''),'"; - + // The 'Match' column will contain 'OK' if the metadata (from NumberToTextConversionExamples) // matches Excel's rendering. String matchExpr = "if(D" + rowNum + "=E" + rowNum + ", \"OK\", \"ERROR\")"; - + row.createCell(0).setCellValue(d); row.createCell(1).setCellValue(new HSSFRichTextString(rawBitsText)); row.createCell(2).setCellValue(new HSSFRichTextString(Double.toString(d))); @@ -134,22 +132,22 @@ public class NumberRenderingSpreadsheetGenerator { // row.createCell(8).setCellFormula(cel0ref + " / 1.0001"); // } } - + private static String formatLongAsHex(long l) { return HexDump.longToHex(l) + 'L'; } public static void main(String[] args) { writeJavaDoc(); - + HSSFWorkbook wb = new HSSFWorkbook(); SheetWriter sw = new SheetWriter(wb); - + ExampleConversion[] exampleValues = NumberToTextConversionExamples.getExampleConversions(); for (ExampleConversion example : exampleValues) { sw.addTestRow(example.getRawDoubleBits(), example.getExcelRendering()); } - + ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { wb.write(baos); @@ -158,10 +156,10 @@ public class NumberRenderingSpreadsheetGenerator { } byte[] fileContent = baos.toByteArray(); replaceNaNs(fileContent, sw.getReplacementNaNs()); - - + + File outputFile = new File("ExcelNumberRendering.xls"); - + try { FileOutputStream os = new FileOutputStream(outputFile); os.write(fileContent); @@ -173,20 +171,20 @@ public class NumberRenderingSpreadsheetGenerator { } public static void writeJavaDoc() { - + ExampleConversion[] exampleConversions = NumberToTextConversionExamples.getExampleConversions(); for (ExampleConversion ec : exampleConversions) { - String line = " * <tr><td>" + String line = " * <tr><td>" + formatLongAsHex(ec.getRawDoubleBits()) - + "</td><td>" + Double.toString(ec.getDoubleValue()) + + "</td><td>" + Double.toString(ec.getDoubleValue()) + "</td><td>" + ec.getExcelRendering() + "</td></tr>"; - + System.out.println(line); } } - - + + private static void replaceNaNs(byte[] fileContent, long[] replacementNaNs) { int countFound = 0; for(int i=0; i<fileContent.length; i++) { @@ -198,7 +196,7 @@ public class NumberRenderingSpreadsheetGenerator { if (countFound < replacementNaNs.length) { throw new RuntimeException("wrong repl count"); } - + } private static void writeLong(byte[] bb, int i, long val) { @@ -215,7 +213,7 @@ public class NumberRenderingSpreadsheetGenerator { // String newVal = interpretLong(bb, i); // System.out.println("changed offset " + i + " from " + oldVal + " to " + newVal); // } - + } private static String interpretLong(byte[] fileContent, int offset) { diff --git a/poi/src/test/java/org/apache/poi/ss/util/NumberToTextConversionExamples.java b/poi/src/test/java/org/apache/poi/ss/util/NumberToTextConversionExamples.java index 1dcedc97a2..68f1f5c15c 100644 --- a/poi/src/test/java/org/apache/poi/ss/util/NumberToTextConversionExamples.java +++ b/poi/src/test/java/org/apache/poi/ss/util/NumberToTextConversionExamples.java @@ -20,7 +20,7 @@ package org.apache.poi.ss.util; import java.util.Locale; /** - * Contains specific examples of <tt>double</tt> values and their rendering in Excel. + * Contains specific examples of {@code double} values and their rendering in Excel. */ final class NumberToTextConversionExamples { diff --git a/poi/src/test/java/org/apache/poi/ss/util/TestAreaReference.java b/poi/src/test/java/org/apache/poi/ss/util/TestAreaReference.java index e8419d5306..9f944e3918 100644 --- a/poi/src/test/java/org/apache/poi/ss/util/TestAreaReference.java +++ b/poi/src/test/java/org/apache/poi/ss/util/TestAreaReference.java @@ -28,8 +28,6 @@ import org.junit.jupiter.api.Test; /** * Test for {@link AreaReference} handling of max rows. - * - * @author David North */ class TestAreaReference { @Test diff --git a/poi/src/test/java/org/apache/poi/ss/util/TestNumberToTextConverter.java b/poi/src/test/java/org/apache/poi/ss/util/TestNumberToTextConverter.java index 387980d870..0a197ab0c5 100644 --- a/poi/src/test/java/org/apache/poi/ss/util/TestNumberToTextConverter.java +++ b/poi/src/test/java/org/apache/poi/ss/util/TestNumberToTextConverter.java @@ -21,6 +21,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals; import org.apache.poi.hssf.record.FormulaRecord; +import org.apache.poi.hssf.record.NumberRecord; import org.apache.poi.ss.formula.constant.ConstantValueParser; import org.apache.poi.ss.formula.ptg.NumberPtg; import org.apache.poi.ss.util.NumberToTextConversionExamples.ExampleConversion; @@ -31,8 +32,8 @@ import org.junit.jupiter.api.Test; */ final class TestNumberToTextConverter { /** - * Confirms that <tt>ExcelNumberToTextConverter.toText(d)</tt> produces the right results. - * As part of preparing this test class, the <tt>ExampleConversion</tt> instances should be set + * Confirms that {@code ExcelNumberToTextConverter.toText(d)} produces the right results. + * As part of preparing this test class, the {@code ExampleConversion} instances should be set * up to contain the rendering as produced by Excel. */ @Test @@ -60,14 +61,14 @@ final class TestNumberToTextConverter { * values as a plain number. That is the unusual functionality that this method is testing.<p> * * There are multiple encodings (bit patterns) for NaN, and CPUs and applications can convert - * to a preferred NaN encoding (Java prefers <tt>0x7FF8000000000000L</tt>). Besides the - * special encoding in {@link FormulaRecord.SpecialCachedValue}, it is not known how/whether + * to a preferred NaN encoding (Java prefers {@code 0x7FF8000000000000L}). Besides the + * special encoding in {@code FormulaRecord.SpecialCachedValue}, it is not known how/whether * Excel attempts to encode NaN values. * * Observed NaN behaviour on HotSpot/Windows: - * <tt>Double.longBitsToDouble()</tt> will set one bit 51 (the NaN signaling flag) if it isn't - * already. <tt>Double.doubleToLongBits()</tt> will return a double with bit pattern - * <tt>0x7FF8000000000000L</tt> for any NaN bit pattern supplied.<br> + * {@code Double.longBitsToDouble()} will set one bit 51 (the NaN signaling flag) if it isn't + * already. {@code Double.doubleToLongBits()} will return a double with bit pattern + * {@code 0x7FF8000000000000L} for any NaN bit pattern supplied.<br> * Differences are likely to be observed with other architectures.<p> * * <p> diff --git a/poi/src/test/java/org/apache/poi/util/TestIntList.java b/poi/src/test/java/org/apache/poi/util/TestIntList.java index 3483933ce4..4c4317ad0e 100644 --- a/poi/src/test/java/org/apache/poi/util/TestIntList.java +++ b/poi/src/test/java/org/apache/poi/util/TestIntList.java @@ -29,8 +29,6 @@ import org.junit.jupiter.api.Test; /** * Class to test IntList - * - * @author Marc Johnson */ final class TestIntList { @Test |