poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kiwiwi...@apache.org
Subject svn commit: r1705789 [1/2] - in /poi/trunk/src: integrationtest/org/apache/poi/hssf/usermodel/ java/org/apache/poi/ddf/ java/org/apache/poi/hssf/dev/ java/org/apache/poi/hssf/model/ java/org/apache/poi/hssf/record/ java/org/apache/poi/hssf/record/aggre...
Date Mon, 28 Sep 2015 23:16:59 GMT
Author: kiwiwings
Date: Mon Sep 28 23:16:58 2015
New Revision: 1705789

URL: http://svn.apache.org/viewvc?rev=1705789&view=rev
Log:
Sonar fixes - add cloneable interface to classes with clone()
Sonar fixes - remove pubic/static/final modifier from interfaces

Modified:
    poi/trunk/src/integrationtest/org/apache/poi/hssf/usermodel/RecordsStresser.java
    poi/trunk/src/java/org/apache/poi/ddf/EscherRecord.java
    poi/trunk/src/java/org/apache/poi/ddf/EscherTextboxRecord.java
    poi/trunk/src/java/org/apache/poi/ddf/UnknownEscherRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/dev/BiffViewer.java
    poi/trunk/src/java/org/apache/poi/hssf/model/InternalSheet.java
    poi/trunk/src/java/org/apache/poi/hssf/record/AbstractEscherHolderRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/ArrayRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/AutoFilterInfoRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/BOFRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/BlankRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/BoolErrRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/BottomMarginRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/CFHeader12Record.java
    poi/trunk/src/java/org/apache/poi/hssf/record/CFHeaderBase.java
    poi/trunk/src/java/org/apache/poi/hssf/record/CFHeaderRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/CFRule12Record.java
    poi/trunk/src/java/org/apache/poi/hssf/record/CFRuleBase.java
    poi/trunk/src/java/org/apache/poi/hssf/record/CFRuleRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/CalcCountRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/CalcModeRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/ColumnInfoRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/CommonObjectDataSubRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/ContinueRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/DBCellRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/DVALRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/DVRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/DefaultColWidthRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/DefaultRowHeightRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/DeltaRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/DimensionsRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/DrawingRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/DrawingSelectionRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/EOFRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/EmbeddedObjectRefSubRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/EndSubRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/FeatHdrRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/FeatRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/FilePassRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/FileSharingRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/FooterRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/FormatRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/FormulaRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/FtCblsSubRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/FtCfSubRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/FtPioGrbitSubRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/GridsetRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/GroupMarkerSubRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/GutsRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/HCenterRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/HeaderFooterRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/HeaderRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/HorizontalPageBreakRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/HyperlinkRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/IndexRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/IterationRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/LabelRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/LabelSSTRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/LbsDataSubRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/LeftMarginRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/MergeCellsRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/MulBlankRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/NoteRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/NoteStructureSubRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/NumberRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/ObjRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/ObjectProtectRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/Record.java
    poi/trunk/src/java/org/apache/poi/hssf/record/aggregates/ColumnInfoRecordsAggregate.java
    poi/trunk/src/java/org/apache/poi/hssf/record/cf/BorderFormatting.java
    poi/trunk/src/java/org/apache/poi/hssf/record/cf/ColorGradientThreshold.java
    poi/trunk/src/java/org/apache/poi/hssf/record/cf/DataBarThreshold.java
    poi/trunk/src/java/org/apache/poi/hssf/record/cf/FontFormatting.java
    poi/trunk/src/java/org/apache/poi/hssf/record/cf/IconMultiStateThreshold.java
    poi/trunk/src/java/org/apache/poi/hssf/record/chart/AreaFormatRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/chart/AreaRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/chart/AxisLineFormatRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/chart/AxisOptionsRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/chart/AxisParentRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/chart/AxisRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/chart/AxisUsedRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/chart/BarRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/chart/BeginRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/chart/CategorySeriesAxisRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/chart/ChartEndBlockRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/chart/ChartRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/chart/ChartStartBlockRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/chart/DatRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/chart/DataFormatRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/chart/DefaultDataLabelTextPropertiesRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/chart/EndRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/chart/FontBasisRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/chart/FontIndexRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/chart/FrameRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/chart/LegendRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/chart/LineFormatRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/chart/LinkedDataRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/chart/NumberFormatIndexRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/chart/ObjectLinkRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/common/ExtendedColor.java
    poi/trunk/src/java/org/apache/poi/hssf/record/common/FtrHeader.java
    poi/trunk/src/java/org/apache/poi/poifs/filesystem/BATManaged.java
    poi/trunk/src/java/org/apache/poi/poifs/storage/BlockList.java
    poi/trunk/src/java/org/apache/poi/poifs/storage/BlockWritable.java
    poi/trunk/src/java/org/apache/poi/sl/usermodel/Insets2D.java
    poi/trunk/src/java/org/apache/poi/ss/formula/ptg/AreaI.java
    poi/trunk/src/java/org/apache/poi/ss/usermodel/BorderFormatting.java
    poi/trunk/src/java/org/apache/poi/ss/usermodel/Cell.java
    poi/trunk/src/java/org/apache/poi/ss/usermodel/CellStyle.java
    poi/trunk/src/java/org/apache/poi/wp/usermodel/CharacterRun.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/CharIndexTranslator.java

Modified: poi/trunk/src/integrationtest/org/apache/poi/hssf/usermodel/RecordsStresser.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/integrationtest/org/apache/poi/hssf/usermodel/RecordsStresser.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/integrationtest/org/apache/poi/hssf/usermodel/RecordsStresser.java (original)
+++ poi/trunk/src/integrationtest/org/apache/poi/hssf/usermodel/RecordsStresser.java Mon Sep 28 23:16:58 2015
@@ -56,6 +56,8 @@ public class RecordsStresser {
                 
                 assertArrayEquals("Record of type " + record.getClass() + " should return the same byte array via the clone() method, but did return a different array", 
                         origBytes, newBytes);
+            } catch (CloneNotSupportedException e) {
+                throw new RuntimeException(e);
             } catch (RuntimeException e) {
                 // some Records do not implement clone, ignore those for now
                 assertTrue(e.getMessage().contains("needs to define a clone method"));
@@ -70,6 +72,7 @@ public class RecordsStresser {
         try {
             HSSFWorkbook wb = new HSSFWorkbook(stream);
             handleWorkbook(wb);
+            wb.close();
         } finally {
             stream.close();
         }

Modified: poi/trunk/src/java/org/apache/poi/ddf/EscherRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ddf/EscherRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ddf/EscherRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/ddf/EscherRecord.java Mon Sep 28 23:16:58 2015
@@ -22,7 +22,11 @@ import java.io.PrintWriter;
 import java.util.Collections;
 import java.util.List;
 
-import org.apache.poi.util.*;
+import org.apache.poi.util.BitField;
+import org.apache.poi.util.BitFieldFactory;
+import org.apache.poi.util.HexDump;
+import org.apache.poi.util.Internal;
+import org.apache.poi.util.LittleEndian;
 
 /**
  * The base abstract record from which all escher records are defined.  Subclasses will need
@@ -223,9 +227,9 @@ public abstract class EscherRecord {
     /**
      * Escher records may need to be clonable in the future.
      */
-    public Object clone()
-    {
-        throw new RuntimeException( "The class " + getClass().getName() + " needs to define a clone method" );
+    @Override
+    public EscherRecord clone() throws CloneNotSupportedException {
+        throw new CloneNotSupportedException( "The class " + getClass().getName() + " needs to define a clone method" );
     }
 
     /**

Modified: poi/trunk/src/java/org/apache/poi/ddf/EscherTextboxRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ddf/EscherTextboxRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ddf/EscherTextboxRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/ddf/EscherTextboxRecord.java Mon Sep 28 23:16:58 2015
@@ -26,12 +26,8 @@ import org.apache.poi.util.RecordFormatE
  *  text in the format of the parent application, rather than in
  *  Escher format. We don't attempt to understand the contents, since
  *  they will be in the parent's format, not Escher format.
- *
- * @author Glen Stampoultzis (glens at apache.org)
- * @author Nick Burch  (nick at torchbox dot com)
  */
-public class EscherTextboxRecord extends EscherRecord
-{
+public class EscherTextboxRecord extends EscherRecord implements Cloneable {
     public static final short RECORD_ID = (short)0xF00D;
     public static final String RECORD_DESCRIPTION = "msofbtClientTextbox";
 
@@ -102,10 +98,13 @@ public class EscherTextboxRecord extends
         return 8 + thedata.length;
     }
 
-    public Object clone()
-    {
-        // shallow clone
-        return super.clone();
+    @Override
+    public EscherTextboxRecord clone() {
+        EscherTextboxRecord etr = new EscherTextboxRecord();
+        etr.setOptions(this.getOptions());
+        etr.setRecordId(this.getRecordId());
+        etr.thedata = this.thedata.clone();
+        return etr;
     }
 
     public String getRecordName() {

Modified: poi/trunk/src/java/org/apache/poi/ddf/UnknownEscherRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ddf/UnknownEscherRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ddf/UnknownEscherRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/ddf/UnknownEscherRecord.java Mon Sep 28 23:16:58 2015
@@ -31,7 +31,7 @@ import org.apache.poi.util.LittleEndian;
  * @author Glen Stampoultzis (glens at apache.org)
  * @author Zhang Zhang (zhangzzh at gmail.com)
  */
-public final class UnknownEscherRecord extends EscherRecord {
+public final class UnknownEscherRecord extends EscherRecord implements Cloneable {
     private static final byte[] NO_BYTES = new byte[0];
 
     /** The data for this record not including the the 8 byte header */
@@ -113,9 +113,13 @@ public final class UnknownEscherRecord e
         _childRecords = childRecords;
     }
 
-    public Object clone() {
-        // shallow clone
-        return super.clone();
+    @Override
+    public UnknownEscherRecord clone() {
+        UnknownEscherRecord uer = new UnknownEscherRecord();
+        uer.thedata = this.thedata.clone();
+        uer.setOptions(this.getOptions());
+        uer.setRecordId(this.getRecordId());
+        return uer;
     }
 
     public String getRecordName() {

Modified: poi/trunk/src/java/org/apache/poi/hssf/dev/BiffViewer.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/dev/BiffViewer.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/dev/BiffViewer.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/dev/BiffViewer.java Mon Sep 28 23:16:58 2015
@@ -487,7 +487,7 @@ public final class BiffViewer {
 		}
 	}
 
-	private static interface IBiffRecordListener {
+	private interface IBiffRecordListener {
 
 		void processRecord(int globalOffset, int recordCounter, int sid, int dataSize, byte[] data);
 

Modified: poi/trunk/src/java/org/apache/poi/hssf/model/InternalSheet.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/model/InternalSheet.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/model/InternalSheet.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/model/InternalSheet.java Mon Sep 28 23:16:58 2015
@@ -390,7 +390,11 @@ public final class InternalSheet {
             _destList = destList;
         }
         public void visitRecord(Record r) {
-            _destList.add((Record)r.clone());
+            try {
+                _destList.add((Record)r.clone());
+            } catch (CloneNotSupportedException e) {
+                throw new RuntimeException(e);
+            }
         }
     }
 
@@ -415,8 +419,12 @@ public final class InternalSheet {
                  */
                 rb = new DrawingRecord();
             }
-            Record rec = (Record) ((Record) rb).clone();
-            clonedRecords.add(rec);
+            try {
+                Record rec = (Record) ((Record) rb).clone();
+                clonedRecords.add(rec);
+            } catch (CloneNotSupportedException e) {
+                throw new RuntimeException(e);
+            }
         }
         return createSheet(new RecordStream(clonedRecords, 0));
     }

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/AbstractEscherHolderRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/AbstractEscherHolderRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/AbstractEscherHolderRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/AbstractEscherHolderRecord.java Mon Sep 28 23:16:58 2015
@@ -36,7 +36,7 @@ import org.apache.poi.hssf.util.LazilyCo
  * @author Glen Stampoultzis (glens at apache.org)
  * @author Michael Zalewski (zalewski at optonline.net)
  */
-public abstract class AbstractEscherHolderRecord extends Record {
+public abstract class AbstractEscherHolderRecord extends Record implements Cloneable {
     private static boolean DESERIALISE;
     static {
     try {
@@ -148,9 +148,9 @@ public abstract class AbstractEscherHold
 
     public abstract short getSid();
 
-    public Object clone()
-    {
-    	return cloneViaReserialise();
+    @Override
+    public AbstractEscherHolderRecord clone() {
+    	return (AbstractEscherHolderRecord)cloneViaReserialise();
     }
 
     public void addEscherRecord(int index, EscherRecord element)

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/ArrayRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/ArrayRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/ArrayRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/ArrayRecord.java Mon Sep 28 23:16:58 2015
@@ -30,7 +30,7 @@ import org.apache.poi.util.LittleEndianO
  *
  * @author Josh Micich
  */
-public final class ArrayRecord extends SharedValueRecordBase {
+public final class ArrayRecord extends SharedValueRecordBase implements Cloneable {
 
 	public final static short sid = 0x0221;
 	private static final int OPT_ALWAYS_RECALCULATE = 0x0001;
@@ -96,7 +96,8 @@ public final class ArrayRecord extends S
 		return sb.toString();
 	}	
     
-    public Object clone() {
+	@Override
+    public ArrayRecord clone() {
         ArrayRecord rec = new ArrayRecord(_formula.copy(), getRange());
 
         // they both seem unused, but clone them nevertheless to have an exact copy

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/AutoFilterInfoRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/AutoFilterInfoRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/AutoFilterInfoRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/AutoFilterInfoRecord.java Mon Sep 28 23:16:58 2015
@@ -28,9 +28,7 @@ import org.apache.poi.util.LittleEndianO
  * @author Yegor Kozlov
  */
 
-public final class AutoFilterInfoRecord
-    extends StandardRecord
-{
+public final class AutoFilterInfoRecord extends StandardRecord implements Cloneable {
     public final static short sid = 0x9D;
     /**
      * Number of AutoFilter drop-down arrows on the sheet
@@ -93,9 +91,9 @@ public final class AutoFilterInfoRecord
     }
 
     @Override
-    public Object clone()
+    public AutoFilterInfoRecord clone()
     {
-    	return cloneViaReserialise();
+    	return (AutoFilterInfoRecord)cloneViaReserialise();
     }
     
 }
\ No newline at end of file

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/BOFRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/BOFRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/BOFRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/BOFRecord.java Mon Sep 28 23:16:58 2015
@@ -29,7 +29,7 @@ import org.apache.poi.util.LittleEndianO
  * @author Andrew C. Oliver
  * @author Jason Height (jheight at chariot dot net dot au)
  */
-public final class BOFRecord extends StandardRecord {
+public final class BOFRecord extends StandardRecord implements Cloneable {
     /**
      * for BIFF8 files the BOF is 0x809. For earlier versions see
      *  {@link #biff2_sid} {@link #biff3_sid} {@link #biff4_sid} 
@@ -268,7 +268,8 @@ public final class BOFRecord extends Sta
         return sid;
     }
 
-    public Object clone() {
+    @Override
+    public BOFRecord clone() {
       BOFRecord rec = new BOFRecord();
       rec.field_1_version = field_1_version;
       rec.field_2_type = field_2_type;

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/BlankRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/BlankRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/BlankRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/BlankRecord.java Mon Sep 28 23:16:58 2015
@@ -28,7 +28,7 @@ import org.apache.poi.util.LittleEndianO
  * @author Jason Height (jheight at chariot dot net dot au)
  * @version 2.0-pre
  */
-public final class BlankRecord extends StandardRecord implements CellValueRecordInterface {
+public final class BlankRecord extends StandardRecord implements CellValueRecordInterface, Cloneable {
     public final static short sid = 0x0201;
     private int             field_1_row;
     private short             field_2_col;
@@ -137,7 +137,8 @@ public final class BlankRecord extends S
         return 6;
     }
 
-    public Object clone() {
+    @Override
+    public BlankRecord clone() {
       BlankRecord rec = new BlankRecord();
       rec.field_1_row = field_1_row;
       rec.field_2_col = field_2_col;

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/BoolErrRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/BoolErrRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/BoolErrRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/BoolErrRecord.java Mon Sep 28 23:16:58 2015
@@ -27,7 +27,7 @@ import org.apache.poi.util.LittleEndianO
  * @author Michael P. Harhen
  * @author Jason Height (jheight at chariot dot net dot au)
  */
-public final class BoolErrRecord extends CellRecord {
+public final class BoolErrRecord extends CellRecord implements Cloneable {
 	public final static short sid = 0x0205;
 	private int _value;
 	/**
@@ -169,7 +169,8 @@ public final class BoolErrRecord extends
 		return sid;
 	}
 
-	public Object clone() {
+	@Override
+	public BoolErrRecord clone() {
 	  BoolErrRecord rec = new BoolErrRecord();
 	  copyBaseFields(rec);
 	  rec._value = _value;

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/BottomMarginRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/BottomMarginRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/BottomMarginRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/BottomMarginRecord.java Mon Sep 28 23:16:58 2015
@@ -27,7 +27,7 @@ import org.apache.poi.util.*;
  * 
  * @author Shawn Laubach (slaubach at apache dot org)
  */
-public final class BottomMarginRecord extends StandardRecord implements Margin {
+public final class BottomMarginRecord extends StandardRecord implements Margin, Cloneable {
     public final static short sid = 0x29;
     private double field_1_margin;
 
@@ -80,8 +80,8 @@ public final class BottomMarginRecord ex
         this.field_1_margin = field_1_margin;
     }
 
-    public Object clone()
-    {
+    @Override
+    public BottomMarginRecord clone() {
         BottomMarginRecord rec = new BottomMarginRecord();
         rec.field_1_margin = this.field_1_margin;
         return rec;

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/CFHeader12Record.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/CFHeader12Record.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/CFHeader12Record.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/CFHeader12Record.java Mon Sep 28 23:16:58 2015
@@ -26,7 +26,7 @@ import org.apache.poi.util.LittleEndianO
  * Conditional Formatting Header v12 record CFHEADER12 (0x0879),
  *  for conditional formattings introduced in Excel 2007 and newer.
  */
-public final class CFHeader12Record extends CFHeaderBase implements FutureRecord {
+public final class CFHeader12Record extends CFHeaderBase implements FutureRecord, Cloneable {
     public static final short sid = 0x0879;
 
     private FtrHeader futureHeader;
@@ -79,7 +79,8 @@ public final class CFHeader12Record exte
         return futureHeader.getAssociatedRange();
     }
     
-    public Object clone() {
+    @Override
+    public CFHeader12Record clone() {
         CFHeader12Record result = new CFHeader12Record();
         result.futureHeader = (FtrHeader)futureHeader.clone();
         super.copyTo(result);

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/CFHeaderBase.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/CFHeaderBase.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/CFHeaderBase.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/CFHeaderBase.java Mon Sep 28 23:16:58 2015
@@ -26,7 +26,7 @@ import org.apache.poi.util.LittleEndianO
  * Parent of Conditional Formatting Header records,
  *  {@link CFHeaderRecord} and {@link CFHeader12Record}.
  */
-public abstract class CFHeaderBase extends StandardRecord {
+public abstract class CFHeaderBase extends StandardRecord implements Cloneable {
     private int field_1_numcf;
     private int field_2_need_recalculation_and_id;
     private CellRangeAddress field_3_enclosing_cell_range;
@@ -150,4 +150,7 @@ public abstract class CFHeaderBase exten
         result.field_3_enclosing_cell_range = field_3_enclosing_cell_range.copy();
         result.field_4_cell_ranges = field_4_cell_ranges.copy();
     }
+
+    @Override
+    public abstract CFHeaderBase clone();
 }

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/CFHeaderRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/CFHeaderRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/CFHeaderRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/CFHeaderRecord.java Mon Sep 28 23:16:58 2015
@@ -24,7 +24,7 @@ import org.apache.poi.ss.util.CellRangeA
  * Used to describe a {@link CFRuleRecord}.
  * @see CFHeader12Record
  */
-public final class CFHeaderRecord extends CFHeaderBase {
+public final class CFHeaderRecord extends CFHeaderBase implements Cloneable {
     public static final short sid = 0x01B0;
 
     /** Creates new CFHeaderRecord */
@@ -47,7 +47,8 @@ public final class CFHeaderRecord extend
         return sid;
     }
 
-    public Object clone() {
+    @Override
+    public CFHeaderRecord clone() {
         CFHeaderRecord result = new CFHeaderRecord();
         super.copyTo(result);
         return result;

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/CFRule12Record.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/CFRule12Record.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/CFRule12Record.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/CFRule12Record.java Mon Sep 28 23:16:58 2015
@@ -49,7 +49,7 @@ import org.apache.poi.util.POILogger;
  *  {@link #CONDITION_TYPE_CELL_VALUE_IS} or {@link #CONDITION_TYPE_FORMULA},
  *  this is only used for the other types
  */
-public final class CFRule12Record extends CFRuleBase implements FutureRecord {
+public final class CFRule12Record extends CFRuleBase implements FutureRecord, Cloneable {
     public static final short sid = 0x087A;
 
     private FtrHeader futureHeader;
@@ -409,7 +409,8 @@ public final class CFRule12Record extend
         return buffer.toString();
     }
 
-    public Object clone() {
+    @Override
+    public CFRule12Record clone() {
         CFRule12Record rec = new CFRule12Record(getConditionType(), getComparisonOperation());
         rec.futureHeader.setAssociatedRange(futureHeader.getAssociatedRange().copy());
         

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/CFRuleBase.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/CFRuleBase.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/CFRuleBase.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/CFRuleBase.java Mon Sep 28 23:16:58 2015
@@ -39,7 +39,7 @@ import org.apache.poi.util.POILogger;
  *  new-style (Excel 2007+) also make use of {@link CFRule12Record}
  *  and {@link CFExRuleRecord} for their rules.
  */
-public abstract class CFRuleBase extends StandardRecord {
+public abstract class CFRuleBase extends StandardRecord implements Cloneable {
     public static final class ComparisonOperator {
         public static final byte NO_COMPARISON = 0;
         public static final byte BETWEEN       = 1;
@@ -452,4 +452,7 @@ public abstract class CFRuleBase extends
         rec.setFormula1(getFormula1().copy());
         rec.setFormula2(getFormula2().copy());
     }
+    
+    @Override
+    public abstract CFRuleBase clone();
 }

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/CFRuleRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/CFRuleRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/CFRuleRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/CFRuleRecord.java Mon Sep 28 23:16:58 2015
@@ -31,7 +31,7 @@ import org.apache.poi.util.LittleEndianO
  *  new-style (Excel 2007+) also make use of {@link CFRule12Record}
  *  and {@link CFExRuleRecord} for their rules.
  */
-public final class CFRuleRecord extends CFRuleBase {
+public final class CFRuleRecord extends CFRuleBase implements Cloneable {
     public static final short sid = 0x01B1;
 
     /** Creates new CFRuleRecord */
@@ -139,7 +139,8 @@ public final class CFRuleRecord extends
         return buffer.toString();
     }
 
-    public Object clone() {
+    @Override
+    public CFRuleRecord clone() {
         CFRuleRecord rec = new CFRuleRecord(getConditionType(), getComparisonOperation());
         super.copyTo(rec);
         return rec;

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/CalcCountRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/CalcCountRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/CalcCountRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/CalcCountRecord.java Mon Sep 28 23:16:58 2015
@@ -33,9 +33,7 @@ import org.apache.poi.util.LittleEndianO
  * @see org.apache.poi.hssf.record.CalcModeRecord
  */
 
-public final class CalcCountRecord
-    extends StandardRecord
-{
+public final class CalcCountRecord extends StandardRecord implements Cloneable {
     public final static short sid = 0xC;
     private short             field_1_iterations;
 
@@ -92,7 +90,8 @@ public final class CalcCountRecord
         return sid;
     }
 
-    public Object clone() {
+    @Override
+    public CalcCountRecord clone() {
       CalcCountRecord rec = new CalcCountRecord();
       rec.field_1_iterations = field_1_iterations;
       return rec;

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/CalcModeRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/CalcModeRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/CalcModeRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/CalcModeRecord.java Mon Sep 28 23:16:58 2015
@@ -33,9 +33,7 @@ import org.apache.poi.util.LittleEndianO
  * @see org.apache.poi.hssf.record.CalcCountRecord
  */
 
-public final class CalcModeRecord
-    extends StandardRecord
-{
+public final class CalcModeRecord extends StandardRecord implements Cloneable {
     public final static short sid                     = 0xD;
 
     /**
@@ -120,7 +118,8 @@ public final class CalcModeRecord
         return sid;
     }
 
-    public Object clone() {
+    @Override
+    public CalcModeRecord clone() {
       CalcModeRecord rec = new CalcModeRecord();
       rec.field_1_calcmode = field_1_calcmode;
       return rec;

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/ColumnInfoRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/ColumnInfoRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/ColumnInfoRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/ColumnInfoRecord.java Mon Sep 28 23:16:58 2015
@@ -28,7 +28,7 @@ import org.apache.poi.util.BitFieldFacto
  * REFERENCE:  PG 293 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)<p/>
  * @author Andrew C. Oliver (acoliver at apache dot org)
  */
-public final class ColumnInfoRecord extends StandardRecord {
+public final class ColumnInfoRecord extends StandardRecord implements Cloneable {
     public static final short sid = 0x007D;
 
     private int _firstCol;
@@ -244,7 +244,8 @@ public final class ColumnInfoRecord exte
         return sb.toString();
     }
 
-    public Object clone() {
+    @Override
+    public ColumnInfoRecord clone() {
         ColumnInfoRecord rec = new ColumnInfoRecord();
         rec._firstCol = _firstCol;
         rec._lastCol = _lastCol;

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/CommonObjectDataSubRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/CommonObjectDataSubRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/CommonObjectDataSubRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/CommonObjectDataSubRecord.java Mon Sep 28 23:16:58 2015
@@ -28,7 +28,7 @@ import org.apache.poi.util.LittleEndianO
  * 
  * @author Glen Stampoultzis (glens at apache.org)
  */
-public final class CommonObjectDataSubRecord extends SubRecord {
+public final class CommonObjectDataSubRecord extends SubRecord implements Cloneable {
     public final static short sid = 0x0015;
 
     private static final BitField locked    = BitFieldFactory.getInstance(0x0001);
@@ -153,7 +153,8 @@ public final class CommonObjectDataSubRe
         return sid;
     }
 
-    public Object clone() {
+    @Override
+    public CommonObjectDataSubRecord clone() {
         CommonObjectDataSubRecord rec = new CommonObjectDataSubRecord();
     
         rec.field_1_objectType = field_1_objectType;

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/ContinueRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/ContinueRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/ContinueRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/ContinueRecord.java Mon Sep 28 23:16:58 2015
@@ -28,7 +28,7 @@ import org.apache.poi.util.LittleEndianO
  * @author Andrew C. Oliver (acoliver at apache dot org)
  * @author Csaba Nagy (ncsaba at yahoo dot com)
  */
-public final class ContinueRecord extends StandardRecord {
+public final class ContinueRecord extends StandardRecord implements Cloneable {
     public final static short sid = 0x003C;
     private byte[] _data;
 
@@ -69,7 +69,8 @@ public final class ContinueRecord extend
         _data = in.readRemainder();
     }
 
-    public Object clone() {
+    @Override
+    public ContinueRecord clone() {
         return new ContinueRecord(_data);
     }
 }

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/DBCellRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/DBCellRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/DBCellRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/DBCellRecord.java Mon Sep 28 23:16:58 2015
@@ -27,7 +27,7 @@ import org.apache.poi.util.LittleEndianO
  * @author Andrew C. Oliver (acoliver at apache dot org)
  * @author Jason Height
  */
-public final class DBCellRecord extends StandardRecord {
+public final class DBCellRecord extends StandardRecord implements Cloneable {
     public final static short sid = 0x00D7;
     public final static int BLOCK_SIZE = 32;
     
@@ -116,7 +116,8 @@ public final class DBCellRecord extends
         return sid;
     }
 
-    public Object clone() {
+    @Override
+    public DBCellRecord clone() {
         // safe because immutable
         return this;
     }

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/DVALRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/DVALRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/DVALRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/DVALRecord.java Mon Sep 28 23:16:58 2015
@@ -25,7 +25,7 @@ import org.apache.poi.util.LittleEndianO
  *               This record is the list header of all data validation records (0x01BE) in the current sheet.
  * @author Dragos Buleandra (dragos.buleandra@trade2b.ro)
  */
-public final class DVALRecord extends StandardRecord {
+public final class DVALRecord extends StandardRecord implements Cloneable {
 	public final static short sid = 0x01B2;
 
 	/** Options of the DVAL */
@@ -159,7 +159,8 @@ public final class DVALRecord extends St
         return sid;
     }
 
-    public Object clone() {
+    @Override
+    public DVALRecord clone() {
       DVALRecord rec = new DVALRecord();
       rec.field_1_options = field_1_options;
       rec.field_2_horiz_pos = field_2_horiz_pos;

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/DVRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/DVRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/DVRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/DVRecord.java Mon Sep 28 23:16:58 2015
@@ -36,7 +36,7 @@ import org.apache.poi.util.StringUtil;
  * @author Dragos Buleandra (dragos.buleandra@trade2b.ro)
  * @author Josh Micich
  */
-public final class DVRecord extends StandardRecord {
+public final class DVRecord extends StandardRecord implements Cloneable {
 	public final static short sid = 0x01BE;
 	
 	/** the unicode string used for error/prompt title/text when not present */
@@ -345,7 +345,8 @@ public final class DVRecord extends Stan
 	 * Clones the object. Uses serialisation, as the
 	 *  contents are somewhat complex
 	 */
-	public Object clone() {
-		return cloneViaReserialise();
+	@Override
+	public DVRecord clone() {
+		return (DVRecord)cloneViaReserialise();
 	}
 }

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/DefaultColWidthRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/DefaultColWidthRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/DefaultColWidthRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/DefaultColWidthRecord.java Mon Sep 28 23:16:58 2015
@@ -28,7 +28,7 @@ import org.apache.poi.util.LittleEndianO
  * @author Jason Height (jheight at chariot dot net dot au)
  * @version 2.0-pre
  */
-public final class DefaultColWidthRecord extends StandardRecord {
+public final class DefaultColWidthRecord extends StandardRecord implements Cloneable {
     public final static short sid = 0x0055;
     private int             field_1_col_width;
 
@@ -91,7 +91,8 @@ public final class DefaultColWidthRecord
         return sid;
     }
 
-    public Object clone() {
+    @Override
+    public DefaultColWidthRecord clone() {
       DefaultColWidthRecord rec = new DefaultColWidthRecord();
       rec.field_1_col_width = field_1_col_width;
       return rec;

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/DefaultRowHeightRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/DefaultRowHeightRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/DefaultRowHeightRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/DefaultRowHeightRecord.java Mon Sep 28 23:16:58 2015
@@ -31,9 +31,7 @@ import org.apache.poi.util.LittleEndianO
  * @version 2.0-pre
  */
 
-public final class DefaultRowHeightRecord
-    extends StandardRecord
-{
+public final class DefaultRowHeightRecord extends StandardRecord implements Cloneable {
     public final static short sid = 0x225;
     private short             field_1_option_flags;
     private short             field_2_row_height;
@@ -122,7 +120,8 @@ public final class DefaultRowHeightRecor
         return sid;
     }
 
-    public Object clone() {
+    @Override
+    public DefaultRowHeightRecord clone() {
       DefaultRowHeightRecord rec = new DefaultRowHeightRecord();
       rec.field_1_option_flags = field_1_option_flags;
       rec.field_2_row_height = field_2_row_height;

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/DeltaRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/DeltaRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/DeltaRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/DeltaRecord.java Mon Sep 28 23:16:58 2015
@@ -26,7 +26,7 @@ import org.apache.poi.util.LittleEndianO
  * @author Andrew C. Oliver (acoliver at apache dot org)
  * @author Jason Height (jheight at chariot dot net dot au)
  */
-public final class DeltaRecord extends StandardRecord {
+public final class DeltaRecord extends StandardRecord implements Cloneable {
     public final static short sid = 0x0010;
     public final static double DEFAULT_VALUE = 0.0010;   // should be .001
 
@@ -71,7 +71,8 @@ public final class DeltaRecord extends S
         return sid;
     }
 
-    public Object clone() {
+    @Override
+    public DeltaRecord clone() {
         // immutable
         return this;
     }

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/DimensionsRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/DimensionsRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/DimensionsRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/DimensionsRecord.java Mon Sep 28 23:16:58 2015
@@ -31,9 +31,7 @@ import org.apache.poi.util.LittleEndianO
  * @version 2.0-pre
  */
 
-public final class DimensionsRecord
-    extends StandardRecord
-{
+public final class DimensionsRecord extends StandardRecord implements Cloneable {
     public final static short sid = 0x200;
     private int               field_1_first_row;
     private int               field_2_last_row;   // plus 1
@@ -170,7 +168,8 @@ public final class DimensionsRecord
         return sid;
     }
 
-    public Object clone() {
+    @Override
+    public DimensionsRecord clone() {
       DimensionsRecord rec = new DimensionsRecord();
       rec.field_1_first_row = field_1_first_row;
       rec.field_2_last_row = field_2_last_row;

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/DrawingRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/DrawingRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/DrawingRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/DrawingRecord.java Mon Sep 28 23:16:58 2015
@@ -21,7 +21,7 @@ import org.apache.poi.util.LittleEndianO
 /**
  * DrawingRecord (0x00EC)<p/>
  */
-public final class DrawingRecord extends StandardRecord {
+public final class DrawingRecord extends StandardRecord implements Cloneable {
     public static final short sid = 0x00EC;
 
     private static final byte[] EMPTY_BYTE_ARRAY = {};
@@ -75,7 +75,8 @@ public final class DrawingRecord extends
      * Cloning of drawing records must be executed through HSSFPatriarch, because all id's must be changed
      * @return cloned drawing records
      */
-    public Object clone() {
+    @Override
+    public DrawingRecord clone() {
         DrawingRecord rec = new DrawingRecord();
         rec.recordData = recordData.clone();
         if (contd != null) {

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/DrawingSelectionRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/DrawingSelectionRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/DrawingSelectionRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/DrawingSelectionRecord.java Mon Sep 28 23:16:58 2015
@@ -28,7 +28,7 @@ import org.apache.poi.util.LittleEndianO
  * 
  * @author Josh Micich
  */
-public final class DrawingSelectionRecord extends StandardRecord {
+public final class DrawingSelectionRecord extends StandardRecord implements Cloneable {
 	public static final short sid = 0x00ED;
 
 	/**
@@ -110,7 +110,8 @@ public final class DrawingSelectionRecor
 		}
 	}
 
-	public Object clone() {
+	@Override
+	public DrawingSelectionRecord clone() {
 		// currently immutable
 		return this;
 	}

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/EOFRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/EOFRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/EOFRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/EOFRecord.java Mon Sep 28 23:16:58 2015
@@ -29,7 +29,7 @@ import org.apache.poi.util.LittleEndianO
  * @author Jason Height (jheight at chariot dot net dot au)
  * @version 2.0-pre
  */
-public final class EOFRecord extends StandardRecord {
+public final class EOFRecord extends StandardRecord implements Cloneable {
     public final static short sid = 0x0A;
 	public static final int ENCODED_SIZE = 4;
 
@@ -67,7 +67,8 @@ public final class EOFRecord extends Sta
         return sid;
     }
 
-    public Object clone() {
+    @Override
+    public EOFRecord clone() {
       return instance;
     }
 }

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/EmbeddedObjectRefSubRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/EmbeddedObjectRefSubRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/EmbeddedObjectRefSubRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/EmbeddedObjectRefSubRecord.java Mon Sep 28 23:16:58 2015
@@ -40,7 +40,7 @@ import org.apache.poi.util.StringUtil;
  *
  * @author Daniel Noll
  */
-public final class EmbeddedObjectRefSubRecord extends SubRecord {
+public final class EmbeddedObjectRefSubRecord extends SubRecord implements Cloneable {
 	private static POILogger logger = POILogFactory.getLogger(EmbeddedObjectRefSubRecord.class);
 	public static final short sid = 0x0009;
 
@@ -305,7 +305,8 @@ public final class EmbeddedObjectRefSubR
 		return field_6_unknown;
 	}
 
-	public Object clone() {
+	@Override
+	public EmbeddedObjectRefSubRecord clone() {
 		return this; // TODO proper clone
 	}
 

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/EndSubRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/EndSubRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/EndSubRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/EndSubRecord.java Mon Sep 28 23:16:58 2015
@@ -27,7 +27,7 @@ import org.apache.poi.util.LittleEndianO
  * 
  * @author Glen Stampoultzis (glens at apache.org)
  */
-public final class EndSubRecord extends SubRecord {
+public final class EndSubRecord extends SubRecord implements Cloneable {
     public final static short sid = 0x0000; // Note - zero sid is somewhat unusual (compared to plain Records)
     private static final int ENCODED_SIZE = 0;
 
@@ -75,7 +75,8 @@ public final class EndSubRecord extends
         return sid;
     }
 
-    public Object clone() {
+    @Override
+    public EndSubRecord clone() {
         EndSubRecord rec = new EndSubRecord();
     
         return rec;

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/FeatHdrRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/FeatHdrRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/FeatHdrRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/FeatHdrRecord.java Mon Sep 28 23:16:58 2015
@@ -28,7 +28,7 @@ import org.apache.poi.util.LittleEndianO
  * The collection of data (Globals Substream ABNF, macro sheet substream 
  *  ABNF or worksheet substream ABNF) specifies Shared Feature data.
  */
-public final class FeatHdrRecord extends StandardRecord  {
+public final class FeatHdrRecord extends StandardRecord implements Cloneable  {
 	/**
 	 * Specifies the enhanced protection type. Used to protect a 
 	 * shared workbook by restricting access to some areas of it 
@@ -106,9 +106,10 @@ public final class FeatHdrRecord extends
 		return 12 + 2+1+4+rgbHdrData.length;
 	}
     
-    //HACK: do a "cheat" clone, see Record.java for more information
-    public Object clone() {
-        return cloneViaReserialise();
+	@Override
+    public FeatHdrRecord clone() {
+	    //HACK: do a "cheat" clone, see Record.java for more information
+        return (FeatHdrRecord)cloneViaReserialise();
     }
 
     

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/FeatRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/FeatRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/FeatRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/FeatRecord.java Mon Sep 28 23:16:58 2015
@@ -33,7 +33,7 @@ import org.apache.poi.util.POILogger;
  * This record specifies Shared Features data. It is normally paired
  *  up with a {@link FeatHdrRecord}.
  */
-public final class FeatRecord extends StandardRecord  {
+public final class FeatRecord extends StandardRecord implements Cloneable  {
     private static POILogger logger = POILogFactory.getLogger(FeatRecord.class);
     public final static short sid = 0x0868;
     // SIDs from newer versions
@@ -175,9 +175,10 @@ public final class FeatRecord extends St
 	}
 
     
-    //HACK: do a "cheat" clone, see Record.java for more information
-    public Object clone() {
-        return cloneViaReserialise();
+	@Override
+	public FeatRecord clone() {
+        //HACK: do a "cheat" clone, see Record.java for more information
+        return (FeatRecord)cloneViaReserialise();
     }
 
     

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/FilePassRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/FilePassRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/FilePassRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/FilePassRecord.java Mon Sep 28 23:16:58 2015
@@ -28,17 +28,20 @@ import org.apache.poi.util.LittleEndianO
  *
  * @author Jason Height (jheight at chariot dot net dot au)
  */
-public final class FilePassRecord extends StandardRecord {
-	public final static short sid = 0x002F;
+public final class FilePassRecord extends StandardRecord implements Cloneable {
+	public static final short sid = 0x002F;
+    private static final int ENCRYPTION_XOR = 0;
+    private static final int ENCRYPTION_OTHER = 1;
 	
 	private int _encryptionType;
 	private KeyData _keyData;
 
-	private static interface KeyData {
+	private static interface KeyData extends Cloneable {
 	    void read(RecordInputStream in);
 	    void serialize(LittleEndianOutput out);
 	    int getDataSize();
 	    void appendToString(StringBuffer buffer);
+	    KeyData clone();
 	} 
 	
 	public static class Rc4KeyData implements KeyData {
@@ -119,6 +122,17 @@ public final class FilePassRecord extend
             buffer.append("    .rc4.verifier = ").append(HexDump.toHex(_encryptedVerifier)).append("\n");
             buffer.append("    .rc4.verifierHash = ").append(HexDump.toHex(_encryptedVerifierHash)).append("\n");
         }
+        
+        @Override
+        public Rc4KeyData clone() {
+            Rc4KeyData other = new Rc4KeyData();
+            other._salt = this._salt.clone();
+            other._encryptedVerifier = this._encryptedVerifier.clone();
+            other._encryptedVerifierHash = this._encryptedVerifierHash.clone();
+            other._encryptionInfo = this._encryptionInfo;
+            other._minorVersionNo = this._minorVersionNo;
+            return other;
+        }
 	}
 
 	public static class XorKeyData implements KeyData {
@@ -170,12 +184,22 @@ public final class FilePassRecord extend
             buffer.append("    .xor.key = ").append(HexDump.intToHex(_key)).append("\n");
             buffer.append("    .xor.verifier  = ").append(HexDump.intToHex(_verifier)).append("\n");
         }
+        
+        @Override
+        public XorKeyData clone() {
+            XorKeyData other = new XorKeyData();
+            other._key = this._key;
+            other._verifier = this._verifier;
+            return other;
+        }
 	}
 	
 	
-	private static final int ENCRYPTION_XOR = 0;
-	private static final int ENCRYPTION_OTHER = 1;
-
+	private FilePassRecord(FilePassRecord other) {
+	    _encryptionType = other._encryptionType;
+	    _keyData = other._keyData.clone();
+	}
+	
 	public FilePassRecord(RecordInputStream in) {
 		_encryptionType = in.readUShort();
 
@@ -282,9 +306,9 @@ public final class FilePassRecord extend
 		return sid;
 	}
 	
-    public Object clone() {
-		// currently immutable
-		return this;
+	@Override
+	public FilePassRecord clone() {
+		return new FilePassRecord(this);
 	}
 
 	public String toString() {

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/FileSharingRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/FileSharingRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/FileSharingRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/FileSharingRecord.java Mon Sep 28 23:16:58 2015
@@ -27,7 +27,7 @@ import org.apache.poi.util.StringUtil;
  * REFERENCE:  PG 314 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)<p/>
  * @author Andrew C. Oliver (acoliver at apache dot org)
  */
-public final class FileSharingRecord extends StandardRecord {
+public final class FileSharingRecord extends StandardRecord implements Cloneable {
 
     public final static short sid = 0x005B;
     private short             field_1_readonly;
@@ -137,10 +137,8 @@ public final class FileSharingRecord ext
         return sid;
     }
 
-    /**
-     * Clone this record.
-     */
-    public Object clone() {
+    @Override
+    public FileSharingRecord clone() {
       FileSharingRecord clone = new FileSharingRecord();
       clone.setReadOnly(field_1_readonly);
       clone.setPassword(field_2_password);

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/FooterRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/FooterRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/FooterRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/FooterRecord.java Mon Sep 28 23:16:58 2015
@@ -26,7 +26,7 @@ package org.apache.poi.hssf.record;
  * @author Jason Height (jheight at chariot dot net dot au)
  *
  */
-public final class FooterRecord extends HeaderFooterBase {
+public final class FooterRecord extends HeaderFooterBase implements Cloneable {
 	public final static short sid = 0x0015;
 
 	public FooterRecord(String text) {
@@ -50,7 +50,8 @@ public final class FooterRecord extends
 		return sid;
 	}
 
-	public Object clone() {
+	@Override
+	public FooterRecord clone() {
 		return new FooterRecord(getText());
 	}
 }

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/FormatRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/FormatRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/FormatRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/FormatRecord.java Mon Sep 28 23:16:58 2015
@@ -29,13 +29,19 @@ import org.apache.poi.util.StringUtil;
  * @author Andrew C. Oliver (acoliver at apache dot org)
  * @author Shawn M. Laubach (slaubach at apache dot org)
  */
-public final class FormatRecord extends StandardRecord {
+public final class FormatRecord extends StandardRecord implements Cloneable {
     public final static short sid = 0x041E;
 
     private final int field_1_index_code;
     private final boolean field_3_hasMultibyte;
     private final String field_4_formatstring;
 
+    private FormatRecord(FormatRecord other) {
+        field_1_index_code = other.field_1_index_code;
+        field_3_hasMultibyte = other.field_3_hasMultibyte;
+        field_4_formatstring = other.field_4_formatstring;
+    }
+    
     public FormatRecord(int indexCode, String fs) {
         field_1_index_code = indexCode;
         field_4_formatstring = fs;
@@ -104,9 +110,9 @@ public final class FormatRecord extends
     public short getSid() {
         return sid;
     }
+    
     @Override
-    public Object clone() {
-        // immutable
-        return this;
+    public FormatRecord clone() {
+        return new FormatRecord(this);
     }
 }

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/FormulaRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/FormulaRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/FormulaRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/FormulaRecord.java Mon Sep 28 23:16:58 2015
@@ -33,7 +33,7 @@ import org.apache.poi.util.LittleEndianO
  * @author Andrew C. Oliver (acoliver at apache dot org)
  * @author Jason Height (jheight at chariot dot net dot au)
  */
-public final class FormulaRecord extends CellRecord {
+public final class FormulaRecord extends CellRecord implements Cloneable {
 
 	public static final short sid = 0x0006;   // docs say 406...because of a bug Microsoft support site article #Q184647)
 	private static int FIXED_SIZE = 14; // double + short + int
@@ -375,7 +375,7 @@ public final class FormulaRecord extends
 	}
 
 	@Override
-    public Object clone() {
+    public FormulaRecord clone() {
 		FormulaRecord rec = new FormulaRecord();
 		copyBaseFields(rec);
 		rec.field_4_value = field_4_value;

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/FtCblsSubRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/FtCblsSubRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/FtCblsSubRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/FtCblsSubRecord.java Mon Sep 28 23:16:58 2015
@@ -27,7 +27,7 @@ import org.apache.poi.util.LittleEndianO
  *
  * @author Yegor Kozlov
  */
-public final class FtCblsSubRecord extends SubRecord {
+public final class FtCblsSubRecord extends SubRecord implements Cloneable {
     public final static short sid = 0x0C;
     private static final int ENCODED_SIZE = 20;
 
@@ -90,7 +90,8 @@ public final class FtCblsSubRecord exten
         return sid;
     }
 
-    public Object clone() {
+    @Override
+    public FtCblsSubRecord clone() {
         FtCblsSubRecord rec = new FtCblsSubRecord();
         byte[] recdata = new byte[reserved.length];
         System.arraycopy(reserved, 0, recdata, 0, recdata.length);

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/FtCfSubRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/FtCfSubRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/FtCfSubRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/FtCfSubRecord.java Mon Sep 28 23:16:58 2015
@@ -25,7 +25,7 @@ import org.apache.poi.util.LittleEndianO
 /**
  * The FtCf structure specifies the clipboard format of the picture-type Obj record containing this FtCf.
  */
-public final class FtCfSubRecord extends SubRecord {
+public final class FtCfSubRecord extends SubRecord implements Cloneable {
     public final static short sid = 0x07;
     public final static short length = 0x02;
     
@@ -97,7 +97,8 @@ public final class FtCfSubRecord extends
         return sid;
     }
 
-    public Object clone() {
+    @Override
+    public FtCfSubRecord clone() {
         FtCfSubRecord rec = new FtCfSubRecord();
         rec.flags = this.flags;
         return rec;

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/FtPioGrbitSubRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/FtPioGrbitSubRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/FtPioGrbitSubRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/FtPioGrbitSubRecord.java Mon Sep 28 23:16:58 2015
@@ -25,7 +25,7 @@ import org.apache.poi.util.LittleEndianO
 /**
  * This structure appears as part of an Obj record that represents image display properties.
  */
-public final class FtPioGrbitSubRecord extends SubRecord {
+public final class FtPioGrbitSubRecord extends SubRecord implements Cloneable {
     public final static short sid = 0x08;
     public final static short length = 0x02;
     
@@ -151,7 +151,8 @@ public final class FtPioGrbitSubRecord e
         return sid;
     }
 
-    public Object clone() {
+    @Override
+    public FtPioGrbitSubRecord clone() {
         FtPioGrbitSubRecord rec = new FtPioGrbitSubRecord();
         rec.flags = this.flags;
         return rec;

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/GridsetRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/GridsetRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/GridsetRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/GridsetRecord.java Mon Sep 28 23:16:58 2015
@@ -34,9 +34,7 @@ import org.apache.poi.util.LittleEndianO
  * @version 2.0-pre
  */
 
-public final class GridsetRecord
-    extends StandardRecord
-{
+public final class GridsetRecord extends StandardRecord implements Cloneable {
     public final static short sid = 0x82;
     public short              field_1_gridset_flag;
 
@@ -102,7 +100,8 @@ public final class GridsetRecord
         return sid;
     }
 
-    public Object clone() {
+    @Override
+    public GridsetRecord clone() {
       GridsetRecord rec = new GridsetRecord();
       rec.field_1_gridset_flag = field_1_gridset_flag;
       return rec;

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/GroupMarkerSubRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/GroupMarkerSubRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/GroupMarkerSubRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/GroupMarkerSubRecord.java Mon Sep 28 23:16:58 2015
@@ -27,7 +27,7 @@ import org.apache.poi.util.LittleEndianO
 
  * @author Glen Stampoultzis (glens at apache.org)
  */
-public final class GroupMarkerSubRecord extends SubRecord {
+public final class GroupMarkerSubRecord extends SubRecord implements Cloneable {
     public final static short sid = 0x0006;
 
     private static final byte[] EMPTY_BYTE_ARRAY = { };
@@ -70,7 +70,8 @@ public final class GroupMarkerSubRecord
         return sid;
     }
 
-    public Object clone() {
+    @Override
+    public GroupMarkerSubRecord clone() {
         GroupMarkerSubRecord rec = new GroupMarkerSubRecord();
         rec.reserved = new byte[reserved.length];
         for ( int i = 0; i < reserved.length; i++ )

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/GutsRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/GutsRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/GutsRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/GutsRecord.java Mon Sep 28 23:16:58 2015
@@ -30,9 +30,7 @@ import org.apache.poi.util.LittleEndianO
  * @version 2.0-pre
  */
 
-public final class GutsRecord
-    extends StandardRecord
-{
+public final class GutsRecord extends StandardRecord implements Cloneable {
     public final static short sid = 0x80;
     private short             field_1_left_row_gutter;   // size of the row gutter to the left of the rows
     private short             field_2_top_col_gutter;    // size of the column gutter above the columns
@@ -172,7 +170,8 @@ public final class GutsRecord
         return sid;
     }
 
-    public Object clone() {
+    @Override
+    public GutsRecord clone() {
       GutsRecord rec = new GutsRecord();
       rec.field_1_left_row_gutter = field_1_left_row_gutter;
       rec.field_2_top_col_gutter = field_2_top_col_gutter;

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/HCenterRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/HCenterRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/HCenterRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/HCenterRecord.java Mon Sep 28 23:16:58 2015
@@ -27,7 +27,7 @@ import org.apache.poi.util.LittleEndianO
  * @author Jason Height (jheight at chariot dot net dot au)
  * @version 2.0-pre
  */
-public final class HCenterRecord extends StandardRecord {
+public final class HCenterRecord extends StandardRecord implements Cloneable {
     public final static short sid = 0x0083;
     private short             field_1_hcenter;
 
@@ -91,7 +91,8 @@ public final class HCenterRecord extends
         return sid;
     }
 
-    public Object clone() {
+    @Override
+    public HCenterRecord clone() {
       HCenterRecord rec = new HCenterRecord();
       rec.field_1_hcenter = field_1_hcenter;
       return rec;

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/HeaderFooterRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/HeaderFooterRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/HeaderFooterRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/HeaderFooterRecord.java Mon Sep 28 23:16:58 2015
@@ -28,7 +28,7 @@ import java.util.Locale;
  *
  * @author Yegor Kozlov
  */
-public final class HeaderFooterRecord extends StandardRecord {
+public final class HeaderFooterRecord extends StandardRecord implements Cloneable {
 
     private static final byte[] BLANK_GUID = new byte[16];
 
@@ -95,9 +95,10 @@ public final class HeaderFooterRecord ex
         return sb.toString();
     }
 
-    //HACK: do a "cheat" clone, see Record.java for more information
-    public Object clone() {
-                return cloneViaReserialise();
+    @Override
+    public HeaderFooterRecord clone() {
+        //HACK: do a "cheat" clone, see Record.java for more information
+        return (HeaderFooterRecord)cloneViaReserialise();
     }
     
  

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/HeaderRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/HeaderRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/HeaderRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/HeaderRecord.java Mon Sep 28 23:16:58 2015
@@ -25,7 +25,7 @@ package org.apache.poi.hssf.record;
  * @author Shawn Laubach (slaubach at apache dot org) Modified 3/14/02
  * @author Jason Height (jheight at chariot dot net dot au)
  */
-public final class HeaderRecord extends HeaderFooterBase {
+public final class HeaderRecord extends HeaderFooterBase implements Cloneable {
 	public final static short sid = 0x0014;
 
 	public HeaderRecord(String text) {
@@ -49,7 +49,8 @@ public final class HeaderRecord extends
 		return sid;
 	}
 
-	public Object clone() {
+	@Override
+	public HeaderRecord clone() {
 		return new HeaderRecord(getText());
 	}
 }

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/HorizontalPageBreakRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/HorizontalPageBreakRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/HorizontalPageBreakRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/HorizontalPageBreakRecord.java Mon Sep 28 23:16:58 2015
@@ -25,7 +25,7 @@ import java.util.Iterator;
  * @see PageBreakRecord
  * @author Danny Mui (dmui at apache dot org)
  */
-public final class HorizontalPageBreakRecord extends PageBreakRecord {
+public final class HorizontalPageBreakRecord extends PageBreakRecord implements Cloneable {
 
 	public static final short sid = 0x001B;
 
@@ -48,7 +48,8 @@ public final class HorizontalPageBreakRe
 		return sid;
 	}
 
-	public Object clone() {
+	@Override
+	public PageBreakRecord clone() {
 		PageBreakRecord result = new HorizontalPageBreakRecord();
 		Iterator<Break> iterator = getBreaksIterator();
 		while (iterator.hasNext()) {

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/HyperlinkRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/HyperlinkRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/HyperlinkRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/HyperlinkRecord.java Mon Sep 28 23:16:58 2015
@@ -36,7 +36,7 @@ import org.apache.poi.util.StringUtil;
  *  from the Excel-97 format.
  * Supports only external links for now (eg http://)
  */
-public final class HyperlinkRecord extends StandardRecord {
+public final class HyperlinkRecord extends StandardRecord implements Cloneable {
     public final static short sid = 0x01B8;
     private static POILogger logger = POILogFactory.getLogger(HyperlinkRecord.class);
 
@@ -743,7 +743,8 @@ public final class HyperlinkRecord exten
         setTextMark("");
     }
 
-    public Object clone() {
+    @Override
+    public HyperlinkRecord clone() {
         HyperlinkRecord rec = new HyperlinkRecord();
         rec._range = _range.copy();
         rec._guid = _guid;

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/IndexRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/IndexRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/IndexRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/IndexRecord.java Mon Sep 28 23:16:58 2015
@@ -29,7 +29,7 @@ import org.apache.poi.util.LittleEndianO
  * @author Andrew C. Oliver (acoliver at apache dot org)
  * @author Jason Height (jheight at chariot dot net dot au)
  */
-public class IndexRecord extends StandardRecord {
+public class IndexRecord extends StandardRecord implements Cloneable {
     public final static short sid = 0x020B;
     private int                field_2_first_row;       // first row on the sheet
     private int                field_3_last_row_add1;   // last row
@@ -149,7 +149,8 @@ public class IndexRecord extends Standar
         return sid;
     }
 
-    public Object clone() {
+    @Override
+    public IndexRecord clone() {
       IndexRecord rec = new IndexRecord();
       rec.field_2_first_row = field_2_first_row;
       rec.field_3_last_row_add1 = field_3_last_row_add1;

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/IterationRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/IterationRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/IterationRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/IterationRecord.java Mon Sep 28 23:16:58 2015
@@ -32,7 +32,7 @@ import org.apache.poi.util.LittleEndianO
  * @author Andrew C. Oliver (acoliver at apache dot org)
  * @author Jason Height (jheight at chariot dot net dot au)
  */
-public final class IterationRecord extends StandardRecord {
+public final class IterationRecord extends StandardRecord implements Cloneable {
     public final static short sid = 0x0011;
 
     private static final BitField iterationOn = BitFieldFactory.getInstance(0x0001);
@@ -86,7 +86,8 @@ public final class IterationRecord exten
         return sid;
     }
 
-    public Object clone() {
+    @Override
+    public IterationRecord clone() {
         return new IterationRecord(getIteration());
     }
 }

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/LabelRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/LabelRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/LabelRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/LabelRecord.java Mon Sep 28 23:16:58 2015
@@ -28,7 +28,7 @@ import org.apache.poi.util.POILogger;
  * 
  * @see org.apache.poi.hssf.record.LabelSSTRecord
  */
-public final class LabelRecord extends Record implements CellValueRecordInterface {
+public final class LabelRecord extends Record implements CellValueRecordInterface, Cloneable {
     private final static POILogger logger = POILogFactory.getLogger(LabelRecord.class);
 
     public final static short sid = 0x0204;
@@ -170,7 +170,8 @@ public final class LabelRecord extends R
     {
     }
 
-    public Object clone() {
+    @Override
+    public LabelRecord clone() {
       LabelRecord rec = new LabelRecord();
       rec.field_1_row = field_1_row;
       rec.field_2_column = field_2_column;

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/LabelSSTRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/LabelSSTRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/LabelSSTRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/LabelSSTRecord.java Mon Sep 28 23:16:58 2015
@@ -26,7 +26,7 @@ import org.apache.poi.util.LittleEndianO
  *               value.  <P>
  * REFERENCE:  PG 325 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)<P>
  */
-public final class LabelSSTRecord extends CellRecord {
+public final class LabelSSTRecord extends CellRecord implements Cloneable {
     public final static short sid = 0xfd;
     private int field_4_sst_index;
 
@@ -84,7 +84,8 @@ public final class LabelSSTRecord extend
         return sid;
     }
 
-    public Object clone() {
+    @Override
+    public LabelSSTRecord clone() {
       LabelSSTRecord rec = new LabelSSTRecord();
       copyBaseFields(rec);
       rec.field_4_sst_index = field_4_sst_index;

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/LbsDataSubRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/LbsDataSubRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/LbsDataSubRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/LbsDataSubRecord.java Mon Sep 28 23:16:58 2015
@@ -258,7 +258,8 @@ public class LbsDataSubRecord extends Su
     }
 
     @Override
-    public Object clone() {
+    public LbsDataSubRecord clone() {
+        // TODO: is immutable ???
         return this;
     }
 

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/LeftMarginRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/LeftMarginRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/LeftMarginRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/LeftMarginRecord.java Mon Sep 28 23:16:58 2015
@@ -24,8 +24,7 @@ import org.apache.poi.util.LittleEndianO
  * 
  * @author Shawn Laubach (slaubach at apache dot org)
  */
-public final class LeftMarginRecord extends StandardRecord implements Margin
-{
+public final class LeftMarginRecord extends StandardRecord implements Margin, Cloneable {
     public final static short sid = 0x0026;
     private double field_1_margin;
 
@@ -72,10 +71,10 @@ public final class LeftMarginRecord exte
         this.field_1_margin = field_1_margin;
     }
 
-    public Object clone()
-    {
+    @Override
+    public LeftMarginRecord clone() {
         LeftMarginRecord rec = new LeftMarginRecord();
         rec.field_1_margin = this.field_1_margin;
         return rec;
     }
-}  // END OF 
\ No newline at end of file
+} 
\ No newline at end of file

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/MergeCellsRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/MergeCellsRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/MergeCellsRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/MergeCellsRecord.java Mon Sep 28 23:16:58 2015
@@ -27,7 +27,7 @@ import org.apache.poi.util.LittleEndianO
  * Description:  Optional record defining a square area of cells to "merged" into one cell. <br>
  * @author Andrew C. Oliver (acoliver at apache dot org)
  */
-public final class MergeCellsRecord extends StandardRecord {
+public final class MergeCellsRecord extends StandardRecord implements Cloneable {
     public final static short sid = 0x00E5;
     /** sometimes the regions array is shared with other MergedCellsRecords */ 
     private CellRangeAddress[] _regions;
@@ -102,7 +102,8 @@ public final class MergeCellsRecord exte
         return retval.toString();
     }
 
-    public Object clone() {
+    @Override
+    public MergeCellsRecord clone() {
     	int nRegions = _numberOfRegions;
     	CellRangeAddress[] clonedRegions = new CellRangeAddress[nRegions];
 		for (int i = 0; i < clonedRegions.length; i++) {

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/MulBlankRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/MulBlankRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/MulBlankRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/MulBlankRecord.java Mon Sep 28 23:16:58 2015
@@ -135,7 +135,7 @@ public final class MulBlankRecord extend
 	}
 
 	@Override
-	public Object clone() {
+	public MulBlankRecord clone() {
 		// immutable - so OK to return this
 		return this;
 	}

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/NoteRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/NoteRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/NoteRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/NoteRecord.java Mon Sep 28 23:16:58 2015
@@ -25,7 +25,7 @@ import org.apache.poi.util.StringUtil;
  *
  * @author Yegor Kozlov
  */
-public final class NoteRecord extends StandardRecord {
+public final class NoteRecord extends StandardRecord implements Cloneable {
 	public final static short sid = 0x001C;
 
 	public static final NoteRecord[] EMPTY_ARRAY = { };
@@ -235,7 +235,8 @@ public final class NoteRecord extends St
       field_5_hasMultibyte = StringUtil.hasMultibyte(author);
 	}
 
-	public Object clone() {
+	@Override
+	public NoteRecord clone() {
 		NoteRecord rec = new NoteRecord();
 		rec.field_1_row = field_1_row;
 		rec.field_2_col = field_2_col;

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/NoteStructureSubRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/NoteStructureSubRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/NoteStructureSubRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/NoteStructureSubRecord.java Mon Sep 28 23:16:58 2015
@@ -31,7 +31,7 @@ import org.apache.poi.util.LittleEndianO
  *
  * @author Yegor Kozlov
  */
-public final class NoteStructureSubRecord extends SubRecord {
+public final class NoteStructureSubRecord extends SubRecord implements Cloneable {
     public final static short sid = 0x0D;
     private static final int ENCODED_SIZE = 22;
 
@@ -98,7 +98,8 @@ public final class NoteStructureSubRecor
         return sid;
     }
 
-    public Object clone() {
+    @Override
+    public NoteStructureSubRecord clone() {
         NoteStructureSubRecord rec = new NoteStructureSubRecord();
         byte[] recdata = new byte[reserved.length];
         System.arraycopy(reserved, 0, recdata, 0, recdata.length);

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/NumberRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/NumberRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/NumberRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/NumberRecord.java Mon Sep 28 23:16:58 2015
@@ -26,7 +26,7 @@ import org.apache.poi.util.LittleEndianO
  * @author Andrew C. Oliver (acoliver at apache dot org)
  * @author Jason Height (jheight at chariot dot net dot au)
  */
-public final class NumberRecord extends CellRecord {
+public final class NumberRecord extends CellRecord implements Cloneable {
     public static final short sid = 0x0203;
     private double field_4_value;
 
@@ -87,7 +87,7 @@ public final class NumberRecord extends
     }
 
     @Override
-    public Object clone() {
+    public NumberRecord clone() {
       NumberRecord rec = new NumberRecord();
       copyBaseFields(rec);
       rec.field_4_value = field_4_value;

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/ObjRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/ObjRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/ObjRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/ObjRecord.java Mon Sep 28 23:16:58 2015
@@ -33,7 +33,7 @@ import org.apache.poi.util.LittleEndianI
  *
  * @author Glen Stampoultzis (glens at apache.org)
  */
-public final class ObjRecord extends Record {
+public final class ObjRecord extends Record implements Cloneable {
 	public final static short sid = 0x005D;
 
 	private static final int NORMAL_PAD_ALIGNMENT = 2;
@@ -222,7 +222,7 @@ public final class ObjRecord extends Rec
 	}
 
 	@Override
-	public Object clone() {
+	public ObjRecord clone() {
 		ObjRecord rec = new ObjRecord();
 
 		for (int i = 0; i < subrecords.size(); i++) {

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/ObjectProtectRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/ObjectProtectRecord.java?rev=1705789&r1=1705788&r2=1705789&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/ObjectProtectRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/ObjectProtectRecord.java Mon Sep 28 23:16:58 2015
@@ -31,9 +31,7 @@ import org.apache.poi.util.LittleEndianO
  * @author Andrew C. Oliver (acoliver at apache dot org)
  */
 
-public final class ObjectProtectRecord
-    extends StandardRecord
-{
+public final class ObjectProtectRecord extends StandardRecord implements Cloneable {
     public final static short sid = 0x63;
     private short             field_1_protect;
 
@@ -97,7 +95,8 @@ public final class ObjectProtectRecord
         return sid;
     }
 
-    public Object clone() {
+    @Override
+    public ObjectProtectRecord clone() {
         ObjectProtectRecord rec = new ObjectProtectRecord();
         rec.field_1_protect = field_1_protect;
         return rec;




---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message