diff options
author | Javen O'Neal <onealj@apache.org> | 2016-10-19 21:52:31 +0000 |
---|---|---|
committer | Javen O'Neal <onealj@apache.org> | 2016-10-19 21:52:31 +0000 |
commit | 99125ee19173959d42553f78c9ea936648f904b8 (patch) | |
tree | f5250e86fe41b26e92a6b26b6066dff811a484fd /src/examples | |
parent | 9eef74edd1d49ef6b7245faa938c817a7fda2967 (diff) | |
download | poi-99125ee19173959d42553f78c9ea936648f904b8.tar.gz poi-99125ee19173959d42553f78c9ea936648f904b8.zip |
Eclipse automated refactor/cleanup: add missing @Override and @Deprecated annotations
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1765726 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/examples')
30 files changed, 115 insertions, 32 deletions
diff --git a/src/examples/src/org/apache/poi/hpsf/examples/CopyCompare.java b/src/examples/src/org/apache/poi/hpsf/examples/CopyCompare.java index b09427c321..43ea2e9d8d 100644 --- a/src/examples/src/org/apache/poi/hpsf/examples/CopyCompare.java +++ b/src/examples/src/org/apache/poi/hpsf/examples/CopyCompare.java @@ -311,6 +311,7 @@ public class CopyCompare * <p>The method is called by POI's eventing API for each file in the * origin POIFS.</p> */ + @Override public void processPOIFSReaderEvent(final POIFSReaderEvent event) { /* The following declarations are shortcuts for accessing the * "event" object. */ diff --git a/src/examples/src/org/apache/poi/hpsf/examples/ReadCustomPropertySets.java b/src/examples/src/org/apache/poi/hpsf/examples/ReadCustomPropertySets.java index 222fff9fff..9649842114 100644 --- a/src/examples/src/org/apache/poi/hpsf/examples/ReadCustomPropertySets.java +++ b/src/examples/src/org/apache/poi/hpsf/examples/ReadCustomPropertySets.java @@ -61,6 +61,7 @@ public class ReadCustomPropertySets static class MyPOIFSReaderListener implements POIFSReaderListener { + @Override public void processPOIFSReaderEvent(final POIFSReaderEvent event) { PropertySet ps = null; diff --git a/src/examples/src/org/apache/poi/hpsf/examples/ReadTitle.java b/src/examples/src/org/apache/poi/hpsf/examples/ReadTitle.java index 201030ac29..1805444100 100644 --- a/src/examples/src/org/apache/poi/hpsf/examples/ReadTitle.java +++ b/src/examples/src/org/apache/poi/hpsf/examples/ReadTitle.java @@ -54,6 +54,7 @@ public class ReadTitle static class MyPOIFSReaderListener implements POIFSReaderListener { + @Override public void processPOIFSReaderEvent(final POIFSReaderEvent event) { SummaryInformation si = null; diff --git a/src/examples/src/org/apache/poi/hpsf/examples/WriteAuthorAndTitle.java b/src/examples/src/org/apache/poi/hpsf/examples/WriteAuthorAndTitle.java index 996aa9ff7b..d08d778b0a 100644 --- a/src/examples/src/org/apache/poi/hpsf/examples/WriteAuthorAndTitle.java +++ b/src/examples/src/org/apache/poi/hpsf/examples/WriteAuthorAndTitle.java @@ -155,6 +155,7 @@ public class WriteAuthorAndTitle * <p>The method is called by POI's eventing API for each file in the * origin POIFS.</p> */ + @Override public void processPOIFSReaderEvent(final POIFSReaderEvent event) { /* The following declarations are shortcuts for accessing the diff --git a/src/examples/src/org/apache/poi/hssf/eventusermodel/examples/XLS2CSVmra.java b/src/examples/src/org/apache/poi/hssf/eventusermodel/examples/XLS2CSVmra.java index 8bab0a8e4b..610d961741 100644 --- a/src/examples/src/org/apache/poi/hssf/eventusermodel/examples/XLS2CSVmra.java +++ b/src/examples/src/org/apache/poi/hssf/eventusermodel/examples/XLS2CSVmra.java @@ -133,7 +133,8 @@ public class XLS2CSVmra implements HSSFListener { * Main HSSFListener method, processes events, and outputs the * CSV as the file is processed. */ - public void processRecord(Record record) { + @Override + public void processRecord(Record record) { int thisRow = -1; int thisColumn = -1; String thisStr = null; diff --git a/src/examples/src/org/apache/poi/hssf/usermodel/examples/EventExample.java b/src/examples/src/org/apache/poi/hssf/usermodel/examples/EventExample.java index 7dd5ee3ca9..a324b3af43 100644 --- a/src/examples/src/org/apache/poi/hssf/usermodel/examples/EventExample.java +++ b/src/examples/src/org/apache/poi/hssf/usermodel/examples/EventExample.java @@ -40,6 +40,7 @@ public class EventExample * This method listens for incoming records and handles them as required. * @param record The record that was found while reading. */ + @Override public void processRecord(Record record) { switch (record.getSid()) diff --git a/src/examples/src/org/apache/poi/hssf/usermodel/examples/Outlines.java b/src/examples/src/org/apache/poi/hssf/usermodel/examples/Outlines.java index 125d60d770..ad93f5e717 100644 --- a/src/examples/src/org/apache/poi/hssf/usermodel/examples/Outlines.java +++ b/src/examples/src/org/apache/poi/hssf/usermodel/examples/Outlines.java @@ -61,6 +61,7 @@ public class Outlines implements Closeable { } } + @Override public void close() throws IOException { wb.close(); } diff --git a/src/examples/src/org/apache/poi/hssf/view/SVBorder.java b/src/examples/src/org/apache/poi/hssf/view/SVBorder.java index 97a4689663..273ed07fdb 100644 --- a/src/examples/src/org/apache/poi/hssf/view/SVBorder.java +++ b/src/examples/src/org/apache/poi/hssf/view/SVBorder.java @@ -66,7 +66,8 @@ public class SVBorder extends AbstractBorder { this.selected = selected; } - public void paintBorder(Component c, Graphics g, int x, int y, int width, + @Override +public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Color oldColor = g.getColor(); diff --git a/src/examples/src/org/apache/poi/hssf/view/SVFractionalFormat.java b/src/examples/src/org/apache/poi/hssf/view/SVFractionalFormat.java index cd6ff6ea72..4884195880 100644 --- a/src/examples/src/org/apache/poi/hssf/view/SVFractionalFormat.java +++ b/src/examples/src/org/apache/poi/hssf/view/SVFractionalFormat.java @@ -189,7 +189,8 @@ public class SVFractionalFormat extends Format { throw new RuntimeException("Unexpected Case"); } - public StringBuffer format(Object obj, + @Override +public StringBuffer format(Object obj, StringBuffer toAppendTo, FieldPosition pos) { if (obj instanceof Number) { @@ -199,19 +200,22 @@ public class SVFractionalFormat extends Format { throw new IllegalArgumentException("Can only handle Numbers"); } - public Object parseObject(String source, + @Override +public Object parseObject(String source, ParsePosition status) { //JMH TBD return null; } - public Object parseObject(String source) + @Override +public Object parseObject(String source) throws ParseException { //JMH TBD return null; } - public Object clone() { + @Override +public Object clone() { //JMH TBD return null; } diff --git a/src/examples/src/org/apache/poi/hssf/view/SVRowHeader.java b/src/examples/src/org/apache/poi/hssf/view/SVRowHeader.java index c6db2f71a4..622f506430 100644 --- a/src/examples/src/org/apache/poi/hssf/view/SVRowHeader.java +++ b/src/examples/src/org/apache/poi/hssf/view/SVRowHeader.java @@ -44,9 +44,11 @@ public class SVRowHeader extends JList { this.sheet = sheet; } + @Override public int getSize() { return sheet.getLastRowNum() + 1; } + @Override public Object getElementAt(int index) { return Integer.toString(index+1); } @@ -69,6 +71,7 @@ public class SVRowHeader extends JList { setFont(header.getFont()); } + @Override public Component getListCellRendererComponent( JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { Dimension d = getPreferredSize(); diff --git a/src/examples/src/org/apache/poi/hssf/view/SVSheetTable.java b/src/examples/src/org/apache/poi/hssf/view/SVSheetTable.java index 8f95e03fbe..c9e2090877 100644 --- a/src/examples/src/org/apache/poi/hssf/view/SVSheetTable.java +++ b/src/examples/src/org/apache/poi/hssf/view/SVSheetTable.java @@ -114,6 +114,7 @@ public class SVSheetTable extends JTable { } private class HeaderCellRenderer implements TableCellRenderer { + @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { @@ -128,6 +129,7 @@ public class SVSheetTable extends JTable { this.formulaDisplay = formulaDisplay; } + @Override public void valueChanged(ListSelectionEvent e) { int row = getSelectedRow(); int col = getSelectedColumn(); @@ -187,7 +189,8 @@ public class SVSheetTable extends JTable { } addHierarchyListener(new HierarchyListener() { - public void hierarchyChanged(HierarchyEvent e) { + @Override + public void hierarchyChanged(HierarchyEvent e) { if ((e.getChangeFlags() & HierarchyEvent.PARENT_CHANGED) != 0) { Container changedParent = e.getChangedParent(); if (changedParent instanceof JViewport) { diff --git a/src/examples/src/org/apache/poi/hssf/view/SVTableCellEditor.java b/src/examples/src/org/apache/poi/hssf/view/SVTableCellEditor.java index 6c1552e54f..3c58d5346b 100644 --- a/src/examples/src/org/apache/poi/hssf/view/SVTableCellEditor.java +++ b/src/examples/src/org/apache/poi/hssf/view/SVTableCellEditor.java @@ -66,7 +66,8 @@ public class SVTableCellEditor extends AbstractCellEditor implements TableCellEd * * @return The cellEditable value */ - public boolean isCellEditable(java.util.EventObject e) { + @Override +public boolean isCellEditable(java.util.EventObject e) { if (e instanceof MouseEvent) { return ((MouseEvent) e).getClickCount() >= 2; } @@ -74,7 +75,8 @@ public class SVTableCellEditor extends AbstractCellEditor implements TableCellEd } - public boolean shouldSelectCell(EventObject anEvent) { + @Override +public boolean shouldSelectCell(EventObject anEvent) { return true; } @@ -85,20 +87,23 @@ public class SVTableCellEditor extends AbstractCellEditor implements TableCellEd } - public boolean stopCellEditing() { + @Override +public boolean stopCellEditing() { System.out.println("Stop Cell Editing"); fireEditingStopped(); return true; } - public void cancelCellEditing() { + @Override +public void cancelCellEditing() { System.out.println("Cancel Cell Editing"); fireEditingCanceled(); } - public void actionPerformed(ActionEvent e) { + @Override +public void actionPerformed(ActionEvent e) { System.out.println("Action performed"); stopCellEditing(); } @@ -109,7 +114,8 @@ public class SVTableCellEditor extends AbstractCellEditor implements TableCellEd * * @return The cellEditorValue value */ - public Object getCellEditorValue() { + @Override +public Object getCellEditorValue() { System.out.println("GetCellEditorValue"); //JMH Look at when this method is called. Should it return a HSSFCell? return editor.getText(); @@ -121,7 +127,8 @@ public class SVTableCellEditor extends AbstractCellEditor implements TableCellEd * * @return The tableCellEditorComponent value */ - public Component getTableCellEditorComponent(JTable table, Object value, + @Override +public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { diff --git a/src/examples/src/org/apache/poi/hssf/view/SVTableCellRenderer.java b/src/examples/src/org/apache/poi/hssf/view/SVTableCellRenderer.java index 8a59b8306f..1448c5363c 100644 --- a/src/examples/src/org/apache/poi/hssf/view/SVTableCellRenderer.java +++ b/src/examples/src/org/apache/poi/hssf/view/SVTableCellRenderer.java @@ -137,6 +137,7 @@ public class SVTableCellRenderer extends JLabel this.wb = wb; } + @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { boolean isBorderSet = false; @@ -249,14 +250,19 @@ public class SVTableCellRenderer extends JLabel return this; } + @Override public void validate() {} + @Override public void revalidate() {} + @Override public void repaint(long tm, int x, int y, int width, int height) {} + @Override public void repaint(Rectangle r) { } + @Override protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) { // Strings get interned... if (propertyName=="text") { @@ -264,6 +270,7 @@ public class SVTableCellRenderer extends JLabel } } + @Override public void firePropertyChange(String propertyName, boolean oldValue, boolean newValue) { } /** diff --git a/src/examples/src/org/apache/poi/hssf/view/SVTableModel.java b/src/examples/src/org/apache/poi/hssf/view/SVTableModel.java index 5868a175df..25ac83fc50 100644 --- a/src/examples/src/org/apache/poi/hssf/view/SVTableModel.java +++ b/src/examples/src/org/apache/poi/hssf/view/SVTableModel.java @@ -55,10 +55,12 @@ public class SVTableModel extends AbstractTableModel { } - public int getColumnCount() { + @Override +public int getColumnCount() { return this.maxcol+1; } - public Object getValueAt(int row, int col) { + @Override +public Object getValueAt(int row, int col) { HSSFRow r = st.getRow(row); HSSFCell c = null; if (r != null) { @@ -66,19 +68,23 @@ public class SVTableModel extends AbstractTableModel { } return c; } - public int getRowCount() { + @Override +public int getRowCount() { return st.getLastRowNum() + 1; } - public Class<?> getColumnClass(int c) { + @Override +public Class<?> getColumnClass(int c) { return HSSFCell.class; } - public boolean isCellEditable(int rowIndex, int columnIndex) { + @Override +public boolean isCellEditable(int rowIndex, int columnIndex) { return true; } - public void setValueAt(Object aValue, int rowIndex, int columnIndex) { + @Override +public void setValueAt(Object aValue, int rowIndex, int columnIndex) { if (aValue != null) System.out.println("SVTableModel.setValueAt. value type = "+aValue.getClass().getName()); else System.out.println("SVTableModel.setValueAt. value type = null"); diff --git a/src/examples/src/org/apache/poi/hssf/view/SViewer.java b/src/examples/src/org/apache/poi/hssf/view/SViewer.java index de2cfb1f6d..a323992756 100644 --- a/src/examples/src/org/apache/poi/hssf/view/SViewer.java +++ b/src/examples/src/org/apache/poi/hssf/view/SViewer.java @@ -54,7 +54,8 @@ public class SViewer extends JApplet { } /**Initialize the applet*/ - public void init() { + @Override +public void init() { try { jbInit(); } @@ -104,20 +105,25 @@ public class SViewer extends JApplet { } /**Start the applet*/ - public void start() { + @Override +public void start() { } /**Stop the applet*/ - public void stop() { + @Override +public void stop() { } /**Destroy the applet*/ - public void destroy() { + @Override +public void destroy() { } /**Get Applet information*/ - public String getAppletInfo() { + @Override +public String getAppletInfo() { return "Applet Information"; } /**Get parameter info*/ - public String[][] getParameterInfo() { + @Override +public String[][] getParameterInfo() { return null; } @@ -149,13 +155,15 @@ public class SViewer extends JApplet { applet.filename = args[0]; Frame frame; frame = new Frame() { - protected void processWindowEvent(WindowEvent e) { + @Override + protected void processWindowEvent(WindowEvent e) { super.processWindowEvent(e); if (e.getID() == WindowEvent.WINDOW_CLOSING) { System.exit(0); } } - public synchronized void setTitle(String title) { + @Override + public synchronized void setTitle(String title) { super.setTitle(title); enableEvents(AWTEvent.WINDOW_EVENT_MASK); } diff --git a/src/examples/src/org/apache/poi/hssf/view/SViewerPanel.java b/src/examples/src/org/apache/poi/hssf/view/SViewerPanel.java index 5fe596220a..bf1ba4ab7f 100644 --- a/src/examples/src/org/apache/poi/hssf/view/SViewerPanel.java +++ b/src/examples/src/org/apache/poi/hssf/view/SViewerPanel.java @@ -129,7 +129,8 @@ public class SViewerPanel extends JPanel { return scroll; } - public void paint(Graphics g) { + @Override +public void paint(Graphics g) { //JMH I am only overriding this to get a picture of the time taken to paint long start = System.currentTimeMillis(); super.paint(g); @@ -180,19 +181,24 @@ public class SViewerPanel extends JPanel { } } + @Override public void mouseClicked(MouseEvent e) { checkPopup(e); } + @Override public void mousePressed(MouseEvent e) { checkPopup(e); } + @Override public void mouseReleased(MouseEvent e) { checkPopup(e); } + @Override public void mouseEntered(MouseEvent e) {} + @Override public void mouseExited(MouseEvent e) {} } @@ -202,6 +208,7 @@ public class SViewerPanel extends JPanel { super("Rename"); } + @Override public void actionPerformed(ActionEvent e) { int tabIndex = sheetPane.getSelectedIndex(); if (tabIndex != -1) { @@ -220,6 +227,7 @@ public class SViewerPanel extends JPanel { super("Insert"); } + @Override public void actionPerformed(ActionEvent e) { //Create a new sheet then search for the sheet and make sure that the //sheetPane shows it. @@ -239,6 +247,7 @@ public class SViewerPanel extends JPanel { super("Delete"); } + @Override public void actionPerformed(ActionEvent e) { int tabIndex = sheetPane.getSelectedIndex(); if (tabIndex != -1) { @@ -267,12 +276,14 @@ public class SViewerPanel extends JPanel { SViewerPanel p = new SViewerPanel(wb, true); JFrame frame; frame = new JFrame() { + @Override protected void processWindowEvent(WindowEvent e) { super.processWindowEvent(e); if (e.getID() == WindowEvent.WINDOW_CLOSING) { System.exit(0); } } + @Override public synchronized void setTitle(String title) { super.setTitle(title); enableEvents(AWTEvent.WINDOW_EVENT_MASK); diff --git a/src/examples/src/org/apache/poi/hssf/view/brush/DoubleStroke.java b/src/examples/src/org/apache/poi/hssf/view/brush/DoubleStroke.java index 126214b8a1..01b17ef4d0 100644 --- a/src/examples/src/org/apache/poi/hssf/view/brush/DoubleStroke.java +++ b/src/examples/src/org/apache/poi/hssf/view/brush/DoubleStroke.java @@ -47,6 +47,7 @@ public class DoubleStroke implements Brush { * * @return The created stroke as a new shape. */ + @Override public Shape createStrokedShape(Shape s) { // Use the first stroke to create an outline of the shape Shape outline = stroke1.createStrokedShape(s); @@ -56,6 +57,7 @@ public class DoubleStroke implements Brush { } /** {@inheritDoc} */ + @Override public float getLineWidth() { return stroke1.getLineWidth() + 2 * stroke2.getLineWidth(); } diff --git a/src/examples/src/org/apache/poi/poifs/poibrowser/DocumentDescriptorRenderer.java b/src/examples/src/org/apache/poi/poifs/poibrowser/DocumentDescriptorRenderer.java index 698aab35ea..de1204e77d 100644 --- a/src/examples/src/org/apache/poi/poifs/poibrowser/DocumentDescriptorRenderer.java +++ b/src/examples/src/org/apache/poi/poifs/poibrowser/DocumentDescriptorRenderer.java @@ -31,6 +31,7 @@ import org.apache.poi.util.HexDump; public class DocumentDescriptorRenderer extends DefaultTreeCellRenderer { + @Override public Component getTreeCellRendererComponent(final JTree tree, final Object value, final boolean selectedCell, diff --git a/src/examples/src/org/apache/poi/poifs/poibrowser/ExtendableTreeCellRenderer.java b/src/examples/src/org/apache/poi/poifs/poibrowser/ExtendableTreeCellRenderer.java index 917c0b0570..dbb759c9c5 100644 --- a/src/examples/src/org/apache/poi/poifs/poibrowser/ExtendableTreeCellRenderer.java +++ b/src/examples/src/org/apache/poi/poifs/poibrowser/ExtendableTreeCellRenderer.java @@ -49,6 +49,7 @@ public class ExtendableTreeCellRenderer implements TreeCellRenderer renderers = new HashMap<Class<?>,TreeCellRenderer>(); register(Object.class, new DefaultTreeCellRenderer() { + @Override public Component getTreeCellRendererComponent (JTree tree, Object value, boolean selectedCell, boolean expanded, boolean leaf, int row, boolean hasCellFocus) @@ -97,6 +98,7 @@ public class ExtendableTreeCellRenderer implements TreeCellRenderer * * @see TreeCellRenderer#getTreeCellRendererComponent */ + @Override public Component getTreeCellRendererComponent (final JTree tree, final Object value, final boolean selected, final boolean expanded, final boolean leaf, final int row, diff --git a/src/examples/src/org/apache/poi/poifs/poibrowser/POIBrowser.java b/src/examples/src/org/apache/poi/poifs/poibrowser/POIBrowser.java index d1fa1727ca..ec84847d68 100644 --- a/src/examples/src/org/apache/poi/poifs/poibrowser/POIBrowser.java +++ b/src/examples/src/org/apache/poi/poifs/poibrowser/POIBrowser.java @@ -65,6 +65,7 @@ public class POIBrowser extends JFrame { addWindowListener(new WindowAdapter() { + @Override public void windowClosing(WindowEvent e) { System.exit(0); diff --git a/src/examples/src/org/apache/poi/poifs/poibrowser/PropertySetDescriptorRenderer.java b/src/examples/src/org/apache/poi/poifs/poibrowser/PropertySetDescriptorRenderer.java index 085f2db6d7..8ce336f24d 100644 --- a/src/examples/src/org/apache/poi/poifs/poibrowser/PropertySetDescriptorRenderer.java +++ b/src/examples/src/org/apache/poi/poifs/poibrowser/PropertySetDescriptorRenderer.java @@ -41,6 +41,7 @@ import org.apache.poi.util.HexDump; public class PropertySetDescriptorRenderer extends DocumentDescriptorRenderer { + @Override public Component getTreeCellRendererComponent(final JTree tree, final Object value, final boolean selectedCell, diff --git a/src/examples/src/org/apache/poi/poifs/poibrowser/TreeReaderListener.java b/src/examples/src/org/apache/poi/poifs/poibrowser/TreeReaderListener.java index 3174610cad..d2427ce15b 100644 --- a/src/examples/src/org/apache/poi/poifs/poibrowser/TreeReaderListener.java +++ b/src/examples/src/org/apache/poi/poifs/poibrowser/TreeReaderListener.java @@ -121,6 +121,7 @@ public class TreeReaderListener implements POIFSReaderListener * reading. This method retrieves properties of the document and * adds them to a tree model.</p> */ + @Override public void processPOIFSReaderEvent(final POIFSReaderEvent event) { DocumentDescriptor d; diff --git a/src/examples/src/org/apache/poi/ss/examples/ToCSV.java b/src/examples/src/org/apache/poi/ss/examples/ToCSV.java index e8bca901f8..532b89c0f7 100644 --- a/src/examples/src/org/apache/poi/ss/examples/ToCSV.java +++ b/src/examples/src/org/apache/poi/ss/examples/ToCSV.java @@ -764,6 +764,7 @@ public class ToCSV { * file ends with either '.xls' or '.xlsx' and false will be * returned in all other instances. */ + @Override public boolean accept(File file, String name) { return(name.endsWith(".xls") || name.endsWith(".xlsx")); } diff --git a/src/examples/src/org/apache/poi/ss/examples/formula/CalculateMortgage.java b/src/examples/src/org/apache/poi/ss/examples/formula/CalculateMortgage.java index 4b9a325cdf..3d6b4423a1 100644 --- a/src/examples/src/org/apache/poi/ss/examples/formula/CalculateMortgage.java +++ b/src/examples/src/org/apache/poi/ss/examples/formula/CalculateMortgage.java @@ -33,6 +33,7 @@ import org.apache.poi.ss.formula.functions.FreeRefFunction ; */ public class CalculateMortgage implements FreeRefFunction { + @Override public ValueEval evaluate( ValueEval[] args, OperationEvaluationContext ec ) { // verify that we have enough data diff --git a/src/examples/src/org/apache/poi/ss/examples/formula/SettingExternalFunction.java b/src/examples/src/org/apache/poi/ss/examples/formula/SettingExternalFunction.java index ae70794368..bf4018f3d6 100644 --- a/src/examples/src/org/apache/poi/ss/examples/formula/SettingExternalFunction.java +++ b/src/examples/src/org/apache/poi/ss/examples/formula/SettingExternalFunction.java @@ -56,6 +56,7 @@ public class SettingExternalFunction { // don't care about the implementation, we are not interested in evaluation
// and this method will never be called
FreeRefFunction NA = new FreeRefFunction() {
+ @Override
public ValueEval evaluate(ValueEval[] args, OperationEvaluationContext ec) {
return ErrorEval.NA;
}
@@ -66,6 +67,7 @@ public class SettingExternalFunction { _functionsByName.put("BDS", NA);
}
+ @Override
public FreeRefFunction findFunction(String name) {
return _functionsByName.get(name.toUpperCase(Locale.ROOT));
}
diff --git a/src/examples/src/org/apache/poi/ss/examples/html/HSSFHtmlHelper.java b/src/examples/src/org/apache/poi/ss/examples/html/HSSFHtmlHelper.java index 1e235f929e..677a38ab71 100644 --- a/src/examples/src/org/apache/poi/ss/examples/html/HSSFHtmlHelper.java +++ b/src/examples/src/org/apache/poi/ss/examples/html/HSSFHtmlHelper.java @@ -42,6 +42,7 @@ public class HSSFHtmlHelper implements HtmlHelper { colors = wb.getCustomPalette(); } + @Override public void colorStyles(CellStyle style, Formatter out) { HSSFCellStyle cs = (HSSFCellStyle) style; out.format(" /* fill pattern = %d */%n", cs.getFillPattern()); diff --git a/src/examples/src/org/apache/poi/ss/examples/html/XSSFHtmlHelper.java b/src/examples/src/org/apache/poi/ss/examples/html/XSSFHtmlHelper.java index 9b22e1ed04..20a30ed2eb 100644 --- a/src/examples/src/org/apache/poi/ss/examples/html/XSSFHtmlHelper.java +++ b/src/examples/src/org/apache/poi/ss/examples/html/XSSFHtmlHelper.java @@ -28,6 +28,7 @@ import org.apache.poi.xssf.usermodel.XSSFColor; * @author Ken Arnold, Industrious Media LLC */ public class XSSFHtmlHelper implements HtmlHelper { + @Override public void colorStyles(CellStyle style, Formatter out) { XSSFCellStyle cs = (XSSFCellStyle) style; styleColor(out, "background-color", cs.getFillForegroundXSSFColor()); diff --git a/src/examples/src/org/apache/poi/xssf/eventusermodel/XLSX2CSV.java b/src/examples/src/org/apache/poi/xssf/eventusermodel/XLSX2CSV.java index 11d14ae376..0f84ce91fe 100644 --- a/src/examples/src/org/apache/poi/xssf/eventusermodel/XLSX2CSV.java +++ b/src/examples/src/org/apache/poi/xssf/eventusermodel/XLSX2CSV.java @@ -83,6 +83,7 @@ public class XLSX2CSV { } } + @Override public void startRow(int rowNum) { // If there were gaps, output the missing rows outputMissingRows(rowNum-currentRow-1); @@ -92,6 +93,7 @@ public class XLSX2CSV { currentCol = -1; } + @Override public void endRow(int rowNum) { // Ensure the minimum number of columns for (int i=currentCol; i<minColumns; i++) { @@ -100,6 +102,7 @@ public class XLSX2CSV { output.append('\n'); } + @Override public void cell(String cellReference, String formattedValue, XSSFComment comment) { if (firstCellOfRow) { @@ -132,6 +135,7 @@ public class XLSX2CSV { } } + @Override public void headerFooter(String text, boolean isHeader, String tagName) { // Skip, no headers or footers in CSV } diff --git a/src/examples/src/org/apache/poi/xssf/eventusermodel/examples/FromHowTo.java b/src/examples/src/org/apache/poi/xssf/eventusermodel/examples/FromHowTo.java index 1997e6776f..6e35e8cdbd 100644 --- a/src/examples/src/org/apache/poi/xssf/eventusermodel/examples/FromHowTo.java +++ b/src/examples/src/org/apache/poi/xssf/eventusermodel/examples/FromHowTo.java @@ -116,7 +116,8 @@ public class FromHowTo { this.sst = sst; } - public void startElement(String uri, String localName, String name, + @Override + public void startElement(String uri, String localName, String name, Attributes attributes) throws SAXException { // c => cell if(name.equals("c")) { @@ -131,7 +132,8 @@ public class FromHowTo { lastContents = ""; } - public void endElement(String uri, String localName, String name) + @Override + public void endElement(String uri, String localName, String name) throws SAXException { // Process the last contents as required. // Do now, as characters() may be called more than once @@ -152,7 +154,8 @@ public class FromHowTo { } } - public void characters(char[] ch, int start, int length) throws SAXException { // NOSONAR + @Override + public void characters(char[] ch, int start, int length) throws SAXException { // NOSONAR lastContents += new String(ch, start, length); } } diff --git a/src/examples/src/org/apache/poi/xssf/streaming/examples/HybridStreaming.java b/src/examples/src/org/apache/poi/xssf/streaming/examples/HybridStreaming.java index 1e5515859d..31b5e859fd 100644 --- a/src/examples/src/org/apache/poi/xssf/streaming/examples/HybridStreaming.java +++ b/src/examples/src/org/apache/poi/xssf/streaming/examples/HybridStreaming.java @@ -42,6 +42,7 @@ public class HybridStreaming { InputStream sourceBytes = new FileInputStream("workbook.xlsx"); XSSFWorkbook workbook = new XSSFWorkbook(sourceBytes) { /** Avoid DOM parse of large sheet */ + @Override public void parseSheet(java.util.Map<String,XSSFSheet> shIdMap, CTSheet ctSheet) { if (!SHEET_TO_STREAM.equals(ctSheet.getName())) { super.parseSheet(shIdMap, ctSheet); @@ -59,15 +60,19 @@ public class HybridStreaming { private static SheetContentsHandler createSheetContentsHandler() { return new SheetContentsHandler() { + @Override public void startRow(int rowNum) { } + @Override public void headerFooter(String text, boolean isHeader, String tagName) { } + @Override public void endRow(int rowNum) { } + @Override public void cell(String cellReference, String formattedValue, XSSFComment comment) { } }; |