From: Andreas Beeker Date: Wed, 14 Apr 2021 22:53:33 +0000 (+0000) Subject: fix javadocs - remove @author tags (http://apache-poi.1045710.n5.nabble.com/Javadocs... X-Git-Tag: REL_5_1_0~251 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=bb5d321b79193b98051f435621f5044842716c4e;p=poi.git 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 --- 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> * - * - * @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. *

- * @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 result is NaN or Infinity + * @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 ".xlsx" 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. - * + *

* Note - You probably don't want to use this approach any more! 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. *

- * See - * https://poi.apache.org/spreadsheet/how-to.html#sxssf. - *

* If you really want to use this approach, which is also the one that SXSSF * does for you, it works as follows: + *

    + *
  1. create a template workbook, create sheets and global objects such as cell styles, number formats, etc.
  2. + *
  3. create an application that streams data in a text file
  4. + *
  5. Substitute the sheet in the template with the generated data
  6. + *
* - * 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 - * - *

* 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. - *

- * See - * https://poi.apache.org/spreadsheet/how-to.html#sxssf. + * + * @see SXSSF (Streaming Usermodel API). */ 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> * - * - * @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 *

- * - * @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; * IExcelAntWorkbookHandler 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 result is NaN or Infinity + * @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 POIXMLException 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 POIXMLException with - * the String 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 POIXMLException with - * the String 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 null 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 POIXMLException 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 null 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.
+ * This type seems to be interpreted as percent value when the trailing percent sign is missing.

* sample snippet from settings.xml - *

-     *    <w:zoom w:percent="50" />
-     * 
+     * 
{@code
+     *    
+     * }
* * @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.
+ * This type seems to be interpreted as percent value when the trailing percent sign is missing.

* sample snippet from settings.xml - *

-     *    <w:textscale w:w="50" />
-     * 
+     * 
{@code
+     *    
+     * }
* * @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 null. + * @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 null, 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. - * - *

- * 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" - *

+ * Replace a content type in this package.

+ * 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"
  • + *
* For example, a code converting a .xlsm macro workbook to .xlsx would look as follows: - *

- *


+     * 
{@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();
      *
-     *    
- *

+ * }
* * @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, Comparabletrue if the part have at least one relationship else * false. - * @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, Comparabletrue if the specified relationship exists in this part, * else returns false - * @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, Comparablenull. + * {@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 { 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 true if the part have at least one relationship else * false. */ - 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 true if the specified relationship exists in this part, * else returns false */ - 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. *

- * @author Julien Chable - * @version 0.1 * * @see http://www.ietf.org/rfc/rfc2045.txt * @see http://www.ietf.org/rfc/rfc2616.txt 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 XAdES * */ 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 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 getOCSPs() { @@ -104,7 +101,7 @@ public class RevocationData { /** * Returns true if this revocation data set holds OCSP * responses. - * + * * @return true if this revocation data set holds OCSP * responses. */ @@ -114,7 +111,7 @@ public class RevocationData { /** * Returns true if this revocation data set holds CRLs. - * + * * @return true if this revocation data set holds CRLs. */ public boolean hasCRLs() { @@ -123,7 +120,7 @@ public class RevocationData { /** * Returns true if this revocation data is not empty. - * + * * @return true 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 * null if a description is not available. - * + * * @return the description, or null. */ String getSignaturePolicyDescription(); @@ -51,14 +48,14 @@ public interface SignaturePolicyService { * Gives back the download URL where the signature policy document can be * found. Can be null in case such a download location does not * exist. - * + * * @return the download URL, or null. */ 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 Gradient paints not working in Apache Batik's svggen * @see BATIK-1032 */ 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 { 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 { 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. *

- * - * @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 { 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 { - private static Logger LOG = LogManager.getLogger(XSLFSheet.class); + private static final Logger LOG = LogManager.getLogger(XSLFSheet.class); private XSLFDrawing _drawing; private List _shapes; @@ -345,7 +345,7 @@ implements XSLFShapeContainer, Sheet { * it is unchanged. * * @param xShape shape to be removed from this sheet, if present - * @return true 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 { * Append content to this sheet. * * @param src the source sheet - * @return modified this. + * @return modified {@code this}. */ @SuppressWarnings("unused") public XSLFSheet appendContent(XSLFSheet src){ @@ -490,7 +490,7 @@ implements XSLFShapeContainer, Sheet { /** * @return theme (shared styles) associated with this theme. - * By default returns null 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 { 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 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 OPCPackage 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 logical 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 true if the iteration has more elements. + * Returns {@code true} if the iteration has more elements. * - * @return true 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 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 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 getAllSimpleXmlCell(){ List 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 name, or null if no table is named name. + * @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'. *

* Chart sheet is a special kind of Sheet that contains only chart and no data. - *

- * - * @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 collection, referencing a particular or - * 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 collection, referencing a particular or - * 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 color 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 CellRangeAddresss. Never null + * @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 Radhakrishnan J - * - */ 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 Radhakrishnan J - * - */ 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 Radhakrishnan J - * - */ 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 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; *

* 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"); * *

- * - * @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 validate) + * @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 null 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 null + * @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 true + * @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 null 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 XSSFRow representing the rownumber or null 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 null + * @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. *

- * @return true 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. *

- * @param value true 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. *

- * @return true 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. *

- * @param value true 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 - false 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 true 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 true (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 true 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 *

* - * @return true (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 *

* - * @param show true 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 true 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, sheet.setColumnBreak(2); breaks the sheet into two parts - * with columns A,B,C in the first and D,E,... in the second. Simuilar, sheet.setRowBreak(2); + * 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 true 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 true 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, sheet.setColumnBreak(2); breaks the sheet into two parts - * with columns A,B,C in the first and D,E,... in the second. Simuilar, sheet.setRowBreak(2); + * 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 { * *

* Character width is defined as the maximum digit width - * of the numbers 0, 1, 2, ... 9 as rendered + * of the numbers {@code 0, 1, 2, ... 9} as rendered * using the default font (first font in the workbook). *
* 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): *

- * + * {@code * width = Truncate([{Number of Visible Characters} * * {Maximum Digit Width} + {5 pixel padding}]/{Maximum Digit Width}*256)/256 - * + * } *

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. setColumnWidth(columnIndex, 8*256), + * 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 Truncate([numChars*7+5]/7*256)/256 = 8; - * + * } * - * which gives 7.29. + * 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 8. + * @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 true 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 true 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 { *

* Note: multiple sheets can be selected, but only one sheet can be active at one time. * - * @return true 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 { *

* Note: multiple sheets can be selected, but only one sheet can be active at one time. * - * @param value true 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. A1. + * 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 null 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 null 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 - * {@link org.apache.poi.hssf.record.CFRuleBase.ComparisonOperator}:

+ * {@code {@link org.apache.poi.hssf.record.CFRuleBase.ComparisonOperator}}: *

    *
  • BETWEEN
  • *
  • NOT_BETWEEN
  • @@ -67,12 +67,13 @@ public class XSSFSheetConditionalFormatting implements SheetConditionalFormattin *
  • GE
  • *
  • LE
  • *
- *

+ * * @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. - *

The thresholds and colour for it will be created, but will be - * empty and require configuring with + *

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. - *

The thresholds and colours for it will be created, but will be - * empty and require configuring with + *

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 tableColumns; private transient HashMap 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 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 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 0 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 0 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 must 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 must 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 Package object, + * Constructs a XSSFWorkbook object given a OpenXML4J {@code Package} object, * see https://poi.apache.org/oxml4j/. * *

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 *

Creating a XSSFWorkbook from a file-backed OPC Package has a lower memory * footprint than an InputStream backed one. * - * @param pkg the OpenXML4J OPC Package 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 * *

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 - *


+     *   
{@code
      *       OPCPackage pkg = OPCPackage.open(path);
      *       XSSFWorkbook wb = new XSSFWorkbook(pkg);
      *       // work with the wb object
      *       ......
      *       pkg.close(); // gracefully closes the underlying zip file
-     *   
+ * }
*/ 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: * - *

+     *     
{@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();
-     *     
+ * }
*

* * 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 null + * @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. null 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. -1 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 null 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 -1 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). -1 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 *

* - * @return the CalculationChain object or null 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.

- * @return the ExternalLinksTable list, which may be empty + * @return the {@code ExternalLinksTable} list, which may be empty */ @Internal public List 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 name, or null if no table is named name. + * @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; -/** - *

- * 9 Jan 2010 - *

- *

- * // TODO insert Javadoc here! - *

- * - * @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 * * - * - * @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 abstractNums = new ArrayList<>(); protected List 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 AssertionFailedError + * Asserts that two files are equal. Throws an {@code AssertionFailedError} * if they are not. - *

- * */ 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 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 * http://social.msdn.microsoft.com/Forums/mr-IN/os_binaryfile/thread/650888db-fabd-4b95-88dc-f0455f6e2d28 - * - * @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 - *

- * - * - * @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. *

- * It contains:
+ * It contains: + *

    *
  • 1. {@link HeadersFootersAtom} *
  • 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. *
  • 3. {@link CString }, Instance Header (1), optional: Stores the Header's contents. *
  • 4. {@link CString }, Instance Footer (2), optional: Stores the Footer's contents. - *

    - * - * @author Yegor Kozlov + *
*/ 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. - *

- * - * @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: - *

+ *

    *
  • 1. CString (4026), Instance 0: Name of sound (e.g. "crash") *
  • 2. CString (4026), Instance 1: Type of sound (e.g. ".wav") *
  • 3. CString (4026), Instance 2: Reference id of sound in sound collection *
  • 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. *
  • 5. SoundData (2023), optional - *

    - * - * @author Yegor Kozlov + *
*/ 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: - *
  • 1. SoundCollAtom (2021) - *
  • 2. Sound (2022), for each sound, if any - * - * @author Yegor Kozlov + *
      + *
    • 1. SoundCollAtom (2021)
    • + *
    • 2. Sound (2022), for each sound, if any
    • + *
    */ 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 { 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 { public HSLFLine(EscherContainerRecord escherRecord, ShapeContainer parent){ @@ -47,7 +45,7 @@ public final class HSLFLine extends HSLFTextShape implements Line { @@ -72,6 +70,7 @@ public final class HSLFNotes extends HSLFSheet implements Notesnull - 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 { /** - * The SlideShow we belong to + * The {@code SlideShow} we belong to */ private HSLFSlideShow _slideShow; @@ -69,9 +66,9 @@ public abstract class HSLFSheet implements HSLFShapeContainer, Sheet> trs = getTextParagraphs(); if (trs == null) { @@ -177,14 +174,14 @@ public abstract class HSLFSheet implements HSLFShapeContainer, Sheettrue
    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, SheetTextShape or null + * @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___PPT12. + * 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 { @@ -154,9 +150,10 @@ public final class HSLFSlide extends HSLFSheet implements Slide * For Slide we need to do the following: - *
  • set id of the drawing group. - *
  • set shapeId for the container descriptor and background - *

    + *
      + *
    • set id of the drawing group.
    • + *
    • set shapeId for the container descriptor and background
    • + *
    */ @Override public void onCreate(){ @@ -191,9 +188,9 @@ public final class HSLFSlide extends HSLFSheet implements SlideTextBox object that represents the slide's title. + * Create a {@code TextBox} object that represents the slide's title. * - * @return TextBox 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 - * The title is a run of text of type TextHeaderAtom.CENTER_TITLE_TYPE or - * TextHeaderAtom.TITLE_TYPE + * The title is a run of text of type {@code TextHeaderAtom.CENTER_TITLE_TYPE} or + * {@code TextHeaderAtom.TITLE_TYPE} *

    * * @see TextHeaderAtom @@ -259,7 +256,7 @@ public final class HSLFSlide extends HSLFSheet implements SlideSlideListWithtext 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 Slidetrue if the slide follows master, - * false 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 Slidetrue if the slide follows master background, - * false 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 Slidetrue if the slide draws master sheet objects, - * false 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 Slidetrue if the slide follows master color scheme, - * false 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 Slidetrue if the slide draws master color scheme, - * false 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 Slidetrue if the slide draws master sheet objects, - * false 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 getComments() { final List comments = new ArrayList<>(); // If there are any, they're in @@ -427,6 +425,7 @@ public final class HSLFSlide extends HSLFSheet implements Slide> _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 { @@ -186,10 +184,10 @@ implements HSLFShapeContainer, TableShape { if (htc.isEmpty()) { throw new IllegalStateException("HSLFTable without HSLFTableCells"); } - + SortedSet colSet = new TreeSet<>(); SortedSet rowSet = new TreeSet<>(); - + // #1 pass - determine cols and rows for (HSLFTableCell sh : htc) { Rectangle2D anchor = sh.getAnchor(); @@ -197,10 +195,10 @@ implements HSLFShapeContainer, TableShape { rowSet.add(anchor.getY()); } cells = new HSLFTableCell[rowSet.size()][colSet.size()]; - + List colLst = new ArrayList<>(colSet); List 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 { 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 spaces, double totalSpace, int idx) { @@ -227,7 +225,7 @@ implements HSLFShapeContainer, TableShape { } return span; } - + static class LineRect { final HSLFLine l; final double lx1, lx2, ly1, ly2; @@ -356,10 +354,10 @@ implements HSLFShapeContainer, TableShape { 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 { 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 { 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; *

    * Contains the text in a text frame as well as the properties and methods * that control alignment and anchoring of the text. - *

    - * - * @author Yegor Kozlov */ public class HSLFTextBox extends HSLFTextShape implements TextBox { 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 - * {@link #isOutputColumnHeaders()} == true + * {@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 - * {@link #isOutputRowNumbers()} == true + * {@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, null 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 false if cell style by itself (without text, i.e. - * borders, fill, etc.) worth a mention, true otherwise + * Returns {@code false} if cell style by itself (without text, i.e. + * borders, fill, etc.) worth a mention, {@code true} otherwise * - * @return false if cell style by itself (without text, i.e. - * borders, fill, etc.) worth a mention, true 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 {@link #isOutputRowNumbers()}==true) + * 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 true if result were added to FO document, false + * @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 * *

    * 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 {@link #isOutputRowNumbers()}==true) + * 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 null 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 p element. Those - * properties shall not be doubled in children span 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}

    + * Java main() interface to interact with WordToHtmlConverter

    * * Usage: WordToHtmlConverter infile outfile

    * 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; /** - *

    * For iterating through our fields. Used during model classes autogeneration. - *

    - * - * @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. - *

    - * Class and fields descriptions are quoted from [MS-DOC] -- v20121003 Word - * (.doc) Binary File Format; Copyright (c) 2012 Microsoft Corporation; Release: - * October 8, 2012 - *

    - * 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; *

    * 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; *

    * 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. - *

    - * 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; *

    * 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. - *

    - * 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 */ @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 - * */ @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. - *

    - * Class and fields descriptions are quoted from [MS-DOC] -- v20110315 Word - * (.doc) Binary File Format specification - *

    - * 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; *

    * 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. - *

    - * 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. *

    * 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. - *

    - * 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 */ @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; *

    * 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 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 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. - *

    - * Class and fields descriptions are quoted from [MS-DOC] -- v20121003 Word - * (.doc) Binary File Format; Copyright (c) 2012 Microsoft Corporation; Release: - * October 8, 2012 - *

    - * 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; *

    * 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. - *

    - * 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.

    Class and fields - descriptions are quoted from [MS-DOC] -- v20121003 Word (.doc) Binary - File Format; Copyright (c) 2012 Microsoft Corporation; Release: - October 8, 2012 - - *

    - * NOTE: This source is automatically generated please do not modify this file. Either subclass or - * remove the record in src/types/definitions. - *

    - * 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). - *

    - * 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). - *

    - * 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/types/definitions. - *

    - * 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.

    Class and fields descriptions are quoted from Microsoft - Office Word 97-2007 Binary File Format and [MS-DOC] - v20110608 Word (.doc) Binary File - Format - - *

    - * NOTE: This source is automatically generated please do not modify this file. Either subclass or - * remove the record in src/types/definitions. - *

    - * 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. - - *

    - * NOTE: This source is automatically generated please do not modify this file. Either subclass or - * remove the record in src/types/definitions. - *

    - * 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.

    Class and fields descriptions are quoted from Microsoft Office Word - 97-2007 Binary File Format and [MS-DOC] - v20110608 Word (.doc) Binary File Format - - *

    - * NOTE: This source is automatically generated please do not modify this file. Either subclass or - * remove the record in src/types/definitions. - *

    - * 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.

    Class and - fields descriptions are quoted from Microsoft Office Word 97-2007 Binary File Format and - [MS-DOC] - v20110608 Word (.doc) Binary File Format - - *

    - * NOTE: This source is automatically generated please do not modify this file. Either subclass or - * remove the record in src/types/definitions. - *

    - * 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.

    Class and - fields descriptions are quoted from [MS-DOC] -- v20110315 Word (.doc) Binary File Format - specification - - *

    - * NOTE: This source is automatically generated please do not modify this file. Either subclass or - * remove the record in src/types/definitions. - *

    - * 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).

    Class and fields descriptions are quoted from - [MS-DOC] --v20110315; Word (.doc) Binary File Format - - *

    - * NOTE: This source is automatically generated please do not modify this file. Either subclass or - * remove the record in src/types/definitions. - *

    - * 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.

    Class and fields descriptions are quoted from - Microsoft Office Word 97-2007 Binary File Format and [MS-DOC] - v20110608 Word (.doc) Binary - File Format - - *

    - * NOTE: This source is automatically generated please do not modify this file. Either subclass or - * remove the record in src/types/definitions. - *

    - * 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. -

    Class and fields descriptions are quoted from Microsoft Office Word 97-2007 Binary - File Format and [MS-DOC] - v20110608 Word (.doc) Binary File Format - - *

    - * NOTE: This source is automatically generated please do not modify this file. Either subclass or - * remove the record in src/types/definitions. - *

    - * 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.

    Class and fields descriptions are quoted from Microsoft Office Word 97-2007 - Binary File Format and [MS-DOC] - v20110608 Word (.doc) Binary File Format - - *

    - * NOTE: This source is automatically generated please do not modify this file. Either subclass or - * remove the record in src/types/definitions. - *

    - * 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.

    Class and fields descriptions are quoted - from Microsoft Office Word 97-2007 - Binary File Format and [MS-DOC] - v20110608 Word (.doc) - Binary File Format - - *

    - * NOTE: This source is automatically generated please do not modify this file. Either subclass or - * remove the record in src/types/definitions. - *

    - * 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.

    Class - and fields descriptions are quoted from Microsoft Office Word 97-2007 Binary File Format and - [MS-DOC] - v20110608 Word (.doc) Binary File Format - - *

    - * NOTE: This source is automatically generated please do not modify this file. Either subclass or - * remove the record in src/types/definitions. - *

    - * 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. -

    Class and fields descriptions are quoted from Microsoft Office Word 97-2007 Binary - File Format and [MS-DOC] - v20110608 Word (.doc) Binary File Format - - *

    - * NOTE: This source is automatically generated please do not modify this file. Either subclass or - * remove the record in src/types/definitions. - *

    - * 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.

    Class and - fields descriptions are quoted from Microsoft Office Word 97-2007 Binary File Format and - [MS-DOC] - v20110608 Word (.doc) Binary File Format - - *

    - * NOTE: This source is automatically generated please do not modify this file. Either subclass or - * remove the record in src/types/definitions. - *

    - * 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; *

  • [MS-ODRAW] -- v20110608; Office Drawing Binary File Format; Copyright (c) * 2011 Microsoft Corporation. * - * - * @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 - * 0xF004). Returned record has a child with record type - * 0xF00A and value of shape id equals to {@link #getShapeId()}. - * - * @return Returns office art shape container or null 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 getOfficeDrawings() { List 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 true, if table trailer paragraph (last in table row), - * false 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 true, if the end of paragraph mark is really an end of - * cell mark for a nested table cell, false 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 true 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 Range) + * (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 - * FIB.CCPText 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 ByteArrayOutputStream and reads it back - * from a ByteArrayInputStream.

    + * Writes a slideshow to a {@code ByteArrayOutputStream} and reads it back + * from a {@code ByteArrayInputStream}.

    * 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 ByteArrayOutputStream and reads it back - * from a ByteArrayInputStream.

    + * Writes a slideshow to a {@code ByteArrayOutputStream} and reads it back + * from a {@code ByteArrayInputStream}.

    * 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 Sheet 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 Fill 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 * PPT: Missing TextAutoNumberScheme structure providing the style of the number bullets - * - * @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 ByteArrayOutputStream and reads it back - * from a ByteArrayInputStream.

    + * Writes a spreadsheet to a {@code ByteArrayOutputStream} and reads it back + * from a {@code ByteArrayInputStream}.

    * 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 childRecords + * replaces the internal child list with the contents of the supplied {@code childRecords} */ @Override public void setChildRecords(List 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 -1 (true) or 0 (false). * Any other value would trigger this exception. It supports a nested * "reason" throwable, i.e. an exception that caused this one to be - * thrown.

    - * - * @author Drew Varner(Drew.Varner atDomain sc.edu) + * thrown. */ public class IllegalPropertySetDataException extends HPSFRuntimeException { @@ -42,7 +40,7 @@ public class IllegalPropertySetDataException extends HPSFRuntimeException /** *

    Constructor

    - * + * * @param msg The exception's message string */ public IllegalPropertySetDataException(final String msg) @@ -54,7 +52,7 @@ public class IllegalPropertySetDataException extends HPSFRuntimeException /** *

    Constructor

    - * + * * @param reason This exception's underlying reason */ public IllegalPropertySetDataException(final Throwable reason) @@ -66,7 +64,7 @@ public class IllegalPropertySetDataException extends HPSFRuntimeException /** *

    Constructor

    - * + * * @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 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 Record 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. null if this stream is exhausted. + * @return the {@link Class} of the next Record. {@code null} if this stream is exhausted. */ public Class peekNextClass() { if(!hasNext()) { @@ -71,7 +71,7 @@ public final class RecordStream { } /** - * @return the next Record. null 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 MergeCellsRecords 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 null + * @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 null + * @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 null if formula 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 null if the double value encoded by valueLongBits + * @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 - * idx. + * {@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 ci 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 false 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 true the group will be indented by one - * level, if false 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 ColumnInfoRecord 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 null 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; /** - * RecordAggregates are groups of of BIFF Records 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 null + * @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; *
  • {@link ArrayRecord}s
  • *
  • {@link TableRecord}s
  • * - * - * @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 null + * @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. null 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 sharedFormulaRecord + * 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 null. + * @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 null. + * @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 { 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 true 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. *

    @@ -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 null 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: *

      *
    • The value of the 'is16bitEncoded' flag is determined by the actual character data - * of text
    • + * of {@code text} *
    • The string options flag is never separated (by a {@link ContinueRecord}) from the * first chunk of character data it refers to.
    • *
    • The 'ushort length' field is assumed to have been explicitly written earlier. Hence, @@ -132,7 +132,7 @@ public final class ContinuableRecordOutput implements LittleEndianOutput { * Notes: *
        *
      • The value of the 'is16bitEncoded' flag is determined by the actual character data - * of text
      • + * of {@code text} *
      • 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).
      • @@ -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 true if record type specified by sid 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 cchName 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 SimpleDateFormat can be used + * otherwise any other valid argument for {@code SimpleDateFormat} can be used * @see SimpleDateFormat */ 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 null 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 null if numberStr is null + * @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 null if timeStr is null + * @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 null for default YYYYMMDD - * @return null if timeStr is null + * @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 true 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 true 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 null + * @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 null + * @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 null + * @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 - * - *
          - *
        • - * to make a copy HSSFConditionalFormatting settings. - *
        • - * - * + * HSSFConditionalFormatting class encapsulates all settings of Conditional Formatting. + * + * The class can be used to make a copy HSSFConditionalFormatting settings. + * + * * For example: - *
          + * 
          {@code
            * HSSFConditionalFormatting cf = sheet.getConditionalFormattingAt(index);
            * newSheet.addConditionalFormatting(cf);
          - * 
          - * - *
        • - * or to modify existing Conditional Formatting settings (formatting regions and/or rules). - *
        • - *
        - * + * }
    + * + * or to modify existing Conditional Formatting settings (formatting regions and/or rules).

    + * * Use {@link org.apache.poi.hssf.usermodel.HSSFSheet#getSheetConditionalFormatting()} to get access to an instance of this class. *

    * To create a new Conditional Formatting set use the following approach: - * - *

    - * 
    + *
    + * 
    {@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);
    - * 
    + * }
    */ 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 CellRangeAddresss. never null + * @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 HSSFSheet + * 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 - * {@link org.apache.poi.hssf.record.CFRuleBase.ComparisonOperator}:

    + * {@code {@link org.apache.poi.hssf.record.CFRuleBase.ComparisonOperator}}: *

      *
    • BETWEEN
    • *
    • NOT_BETWEEN
    • @@ -59,12 +59,13 @@ public final class HSSFSheetConditionalFormatting implements SheetConditionalFor *
    • GE
    • *
    • LE
    • *
    - *

    + * * @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 names; + private final ArrayList 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 indexes. + * 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 indexes. + * 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). -1 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: * - *
    
    +     * 
    {@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();
    -     *     
    + * }
    *

    *

    * 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 null 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.

    + * Removes sheet at the given index. *

    * 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 _list; + private final List _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 PICTURE_TYPE_* + * @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 indexHash; private static Map 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 Integer excel-style palette indexes + * @return a Map containing all colours keyed by {@code Integer} excel-style palette indexes */ public static synchronized Map 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 color 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 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 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.

    + * POI. *

    * 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 } /** - *

    Creates a POIFSFileSystem from a File. This uses less memory than - * creating from an InputStream. The File will be opened read-only

    + *

    Creates a POIFSFileSystem from a {@code File}. This uses less memory than + * creating from an {@code InputStream}. The File will be opened read-only

    * *

    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 } /** - *

    Creates a POIFSFileSystem from a File. This uses less memory than - * creating from an InputStream.

    + *

    Creates a POIFSFileSystem from a {@code File}. This uses less memory than + * creating from an {@code InputStream}.

    * *

    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 } /** - *

    Creates a POIFSFileSystem from an open FileChannel. This uses - * less memory than creating from an InputStream. The stream will + *

    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.

    * *

    Note that with this constructor, you will need to call {@link #close()} @@ -185,8 +185,8 @@ public class POIFSFileSystem extends BlockStore } /** - *

    Creates a POIFSFileSystem from an open FileChannel. This uses - * less memory than creating from an InputStream.

    + *

    Creates a POIFSFileSystem from an open {@code FileChannel}. This uses + * less memory than creating from an {@code InputStream}.

    * *

    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 InputStream. Normally the stream is read until - * EOF. The stream is always closed.

    + * Create a POIFSFileSystem from an {@code InputStream}. Normally the stream is read until + * EOF. The stream is always closed. *

    - * Some streams are usable after reaching EOF (typically those that return true - * for markSupported()). 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 * and needs to use it after this constructor completes, a work around is to wrap the - * stream in order to trap the close() call. A convenience method ( - * createNonClosingInputStream()) 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: *

          * InputStream wrappedStream = POIFSFileSystem.createNonClosingInputStream(is);
          * HSSFWorkbook wb = new HSSFWorkbook(wrappedStream);
          * is.reset();
          * doSomethingElse(is);
          * 
    - * Note also the special case of ByteArrayInputStream for which the close() + * Note also the special case of {@code ByteArrayInputStream} for which the {@code close()} * method does nothing. *
          * ByteArrayInputStream bais = ...
    @@ -316,7 +316,7 @@ public class POIFSFileSystem extends BlockStore
     
         /**
          * @param stream  the stream to be closed
    -     * @param success false 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 outputDir.
    +      * to files in {@code outputDir}.
           *
    -      * Creates the outputDir, directory, including any necessary but
    -      * nonexistent parent directories, if outputDir does not exist.
    -      * If outputDir 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 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 .vba files in outputDir. 
    -      * 
    -      * Creates the outputDir, directory, including any necessary but
    -      * nonexistent parent directories, if outputDir does not exist.
    -      * If outputDir 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 dir.
    +     * Recursively traverses directory structure rooted at {@code dir}.
          * For each macro module that is found, the module's name and code are
    -     * added to modules.
    +     * 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 n 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
    -     * macroDir into modules.
    +     * {@code macroDir} into {@code modules}.
          *
          * @since 3.15-beta2
          */
    @@ -634,8 +636,8 @@ public class VBAMacroReader implements Closeable {
                                                Map 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 length 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, null 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 true 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 createTextBox();
    -	
    +
         /**
          * create a connector
          */
     	ConnectorShape createConnector();
    -	
    +
         /**
          * create a group of shapes belonging to this container
          */
     	GroupShape createGroup();
    -	
    +
         /**
          * create a picture belonging to this container
          */
     	PictureShape 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 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
    - * 
    + *
      * 
    - * 
    - * @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}
          * 

    - * For a date, this is "mm/d/y". + * 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 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} *

    - * For a date, this is "mm/d/y". + * 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: *

    - *
    One part (example: [Green]#.##)
    + *
    One part (example: {@code [Green]#.##})
    *
    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.
    * - *
    Two parts (example: [Green]#.##;[Red]#.##)
    + *
    Two parts (example: {@code [Green]#.##;[Red]#.##})
    *
    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.
    * - *
    Three parts (example: [Green]#.##;[Black]#.##;[Red]#.##)
    + *
    Three parts (example: {@code [Green]#.##;[Black]#.##;[Red]#.##})
    *
    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.
    * - *
    Four parts (example: [Green]#.##;[Black]#.##;[Red]#.##;[@])
    + *
    Four parts (example: {@code [Green]#.##;[Black]#.##;[Red]#.##;[@]})
    *
    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; *
    *

    * A given format part may specify a given Locale, by including something - * like [$$-409] or [$£-809] or [$-40C]. 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. *

    @@ -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 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 true 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 true 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 true 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 true 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 true 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 - * true only if the number passes the condition. Otherwise, this - * always return true. + * {@code true} only if the number passes the condition. Otherwise, this + * always return {@code true}. * * @param valueObject The value to evaluate. * - * @return true 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 null 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 null. + * @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 null 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 null. + * @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 true 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 true if this format part has a condition. + * Returns {@code true} if this format part has a condition. * - * @return true 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 "" if the group is - * null. + * 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 "". + * @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 true 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 false. + * when applied the value fails the test, this is {@code false}. */ public final boolean applies; - /** The resulting text. This will never be null. */ + /** The resulting text. This will never be {@code null}. */ public final String text; /** - * The color the format sets, or null if the format sets no color. - * This will always be null if {@link #applies} is false. + * 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 "General". */ + /** 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 true 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 true 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} *

    - * For a number, this is "#" for integer values, and "#.#" + * 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 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.
    - * - * 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.
    - * - * 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.
    - * - * 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 null 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.
    * - * In the case of a true 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 - * endEvaluate() when complete.
    + * {@code endEvaluate()} when complete.
    * - * In the case of a null return code, the caller should + * In the case of a {@code null} return code, the caller should * return an evaluation result of - * ErrorEval.CIRCULAR_REF_ERROR, and not call endEvaluate(). + * {@code ErrorEval.CIRCULAR_REF_ERROR}, and not call {@code endEvaluate()}. *
    - * @return false 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.

    * - * Every successful call to startEvaluate must be followed by a call to endEvaluate (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.

    * * 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.
    - * - * 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
    * * 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, encodedTokenLen==totalEncodedLen + * 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 ushort encodedTokenLen field. - * @return A new formula object as read from the stream. Possibly empty, never null. + * 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 { *

  • tokenData
  • *
  • arrayConstantData (optional)
  • * - * Note - this value is different to tokenDataLength + * 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 nulls OK. - * @param ptgs may be null - * @return Never null (Possibly empty if the supplied ptgs is null) + * 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 nulls OK. + * Gets the {@link Ptg} array from the supplied Formula. + * Handles {@code null}s OK. * - * @param formula may be null - * @return possibly null (if the supplied formula is null) + * @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. null 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.
    * * 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.
    - * - * 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.
    - * - * For POI internal use only - * - * @author Josh Micich + * Abstracts a workbook for the purpose of converting formula to text. */ +@Internal public interface FormulaRenderingWorkbook { /** * @return null 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}.
    * * 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 final.
    * The term final 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}).
    *
    * General guidelines: @@ -31,29 +31,27 @@ package org.apache.poi.ss.formula; * to {@link WorkbookEvaluator#evaluate(EvaluationCell)}. * *
  • 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.
  • *
  • plain value cells should be marked as 'not final' if their plain value value may change. - *
  • - *
  • formula cells should be marked as 'not final' if their formula definition may change.
  • + * + *
  • formula cells should be marked as 'not final' if their formula definition may change.
  • *
  • cells which may switch between plain value and formula should also be marked as 'not final'. - *
  • + * * * Notes: *
      *
    • 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.
    • *
    • 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.
    • - *
    • For the purpose of these classifications, setting the cached formula result of a cell (for + *
    • 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.
    • - *
    • Updating cells which have been classified as 'final' will cause the evaluator to behave - * unpredictably (typically ignoring the update).
    • + *
    • Updating cells which have been classified as 'final' will cause the evaluator to behave + * unpredictably (typically ignoring the update).
    • *
    - * - * @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 false if the evaluating application may need to modify the specified - * cell between calls to the evaluator. + * @return false 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 Ptg.setClass() 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 true 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 null 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 null + * @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 null - * (when workbookName 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 null. + * be {@code null}. * @param refStrPart2 the second part of the area reference. For single cell references this - * parameter must be null - * @param isA1Style specifies the format for refStrPart1 and refStrPart2. - * Pass true for 'A1' style and false 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 OperationEval instances to help evaluate OperationPtg + * 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 Ptg - * token. Each ParseNode may have child ParseNodes in the case when the wrapped - * Ptg 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 Ptg 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 true 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 true 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. *

    * This code is currently being used for translating formulas represented with Ptg - * 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: *

      *
    1. POI's own formula parser
    2. @@ -220,9 +218,9 @@ public final class SheetNameFormatter { *
    3. Manual entry into Excel cell contents
    4. *
    5. Some third party formula parser
    6. *
    - * + * * 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. *

    * 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). *

    * Some notable cases: - *

    * * @@ -251,7 +249,7 @@ public final class SheetNameFormatter { * * *
    Input Result Comments
    "A1"  true 
    "SALES20080101"  trueStill needs delimiting even though well out of range
    - * + * * @return true 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 - * AbstractFunctionPtg.field_2_fnc_index == 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. - *
    - * - * 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.

    + * Evaluates formula cells.

    * * 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.
    - * - * 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 null 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 null, 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 null - * @return {@link BlankEval} if cell is null or blank, never null + * @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 startIndex+1) that need to be skipped - * to achieve the specified distInBytes 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 null. {@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 null. {@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
    special Note: OperationPtg subtypes cannot be - * passed here! + * StringPtg, BoolPtg

    + * + * 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. *

    * 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. - *

    formula ref + range top-left + current cell range offset 

    + * and further move references by the position of the target within the region.

    + * + * {@code formula ref + range top-left + current cell range offset} * which simplifies to - *

    formula ref + current cell ref

    - * @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()
    * * Returns an error text if there is an error in the evaluation

    - * + * * Syntax
    * IFERROR(expression, string) - * - * @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; * * Syntax
    * MROUND(number, multiple) - * - *

    - * - * @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; * Syntax
    * NETWORKDAYS(startDate, endDate, holidays) *

    - * - * @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()
    - * - * @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; * * bottom is the smallest integer RANDBETWEEN will return.
    * top is the largest integer RANDBETWEEN will return.
    - - * @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; * Syntax
    * WORKDAY(startDate, days, holidays) *

    - * - * @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.

    - * - * @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.

    * * This class is a type-safe wrapper for a 16-bit int value performing a similar job to - * ErrorEval. + * {@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:
    - * (b ? BoolEval.TRUE : BoolEval.FALSE) + * {@code (b ? BoolEval.TRUE : BoolEval.FALSE)} * - * @return the BoolEval instance representing b. + * @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 within operator and function - * implementations. Note - OperationEval.evaluate() and Function.evaluate() + * implementations. Note - {@code OperationEval.evaluate()} and {@code Function.evaluate()} * method signatures do not throw this exception so it cannot propagate outside.

    * - * Here is an example coded without EvaluationException, to show how it can help: + * Here is an example coded without {@code EvaluationException}, to show how it can help: *

    {@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.
    - * Using EvaluationException allows the error returning code to be consolidated to one - * place.

    + * Using {@code EvaluationException} allows the error returning code to be consolidated to one + * place. + * *

    {@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.

    * - * Note - Only standard evaluation errors are represented by EvaluationException ( + * Note - 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 - * aeA and aeB. If the two areas do not intersect, the result is null. + * {@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 do 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 NumberEval, StringEval, BoolEval or BlankEval. - * Never null or ErrorEval. + * @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 NumberEval, StringEval, BoolEval or BlankEval. or ErrorEval - * Never null. + * @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 can throw a 'circular reference' EvaluationException. Note that - * this method does not attempt to detect cycles. Every cell in the specified Area ae + * 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 cells) part of - * ae that would incur a cyclic reference error if selected by this method, will - * already have the value ErrorEval.CIRCULAR_REF_ERROR 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 null. Never - * ErrorEval. + * @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 ErrorEval, and null + * @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.
    - * Value is first coerced to a double ( See coerceValueToDouble() ). - * Note - BlankEval is converted to 0.

    + * Value is first coerced to a {@code double} ( See {@code coerceValueToDouble()} ). + * Note - {@code BlankEval} is converted to {@code 0}.

    * * Excel typically converts doubles to integers by truncating toward negative infinity.
    * The equivalent java code is:
    - *   return (int)Math.floor(d);
    + *   {@code return (int)Math.floor(d);}
    * not:
    - *   return (int)d; // wrong - rounds toward zero + *   {@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 - BlankEval 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 parseDouble() 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.
    * Tolerates leading and trailing spaces,

    - * - * 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:
    * " 123 " -> 123.0
    @@ -288,7 +285,7 @@ public final class OperandResolver { * "5**2" -> 500
    * "250%" -> 2.5
    * - * @return null 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 NumberEval, StringEval, BoolEval, or BlankEval - * @return the converted string value. never null + * @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 null 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 '%'.

    - * @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 - * aeA and aeB + * {@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 null 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 value + * 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 workbook.
    - * Typically, the supplied workbook is a writable copy of the 'master workbook', + * #updateCell(String, int, int, ValueEval)}) to the supplied {@code workbook}.
    + * 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 null if the supplied cell is null 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 FunctionMetadata instances for creation of a - * FunctionMetadataRegistry. - * - * @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 true 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 FunctionMetadataRegistry - * - * @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. *

    * 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; *

  • If omitted, suffix is assumed to be "i".
  • *
  • If suffix is neither "i" nor "j", COMPLEX returns the #VALUE! error value.
  • * - * - * @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