poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r887432 - in /poi/trunk/src/java/org/apache/poi/hssf: record/ record/formula/ usermodel/
Date Fri, 04 Dec 2009 23:05:08 GMT
Author: josh
Date: Fri Dec  4 23:05:06 2009
New Revision: 887432

URL: http://svn.apache.org/viewvc?rev=887432&view=rev
Log:
Removed generic type parameter from OperandPtg because it was not worth the extra syntax.

Modified:
    poi/trunk/src/java/org/apache/poi/hssf/record/SharedFormulaRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/TextObjectRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/formula/Area3DPtg.java
    poi/trunk/src/java/org/apache/poi/hssf/record/formula/AreaPtgBase.java
    poi/trunk/src/java/org/apache/poi/hssf/record/formula/OperandPtg.java
    poi/trunk/src/java/org/apache/poi/hssf/record/formula/Ref3DPtg.java
    poi/trunk/src/java/org/apache/poi/hssf/record/formula/RefPtgBase.java
    poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/SharedFormulaRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/SharedFormulaRecord.java?rev=887432&r1=887431&r2=887432&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/SharedFormulaRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/SharedFormulaRecord.java Fri Dec  4 23:05:06
2009
@@ -130,9 +130,9 @@
                                 areaNPtg.isFirstColRelative(),
                                 areaNPtg.isLastColRelative());
                 ptg.setClass(originalOperandClass);
-            } else if (ptg instanceof OperandPtg<?>) {
+            } else if (ptg instanceof OperandPtg) {
                 // Any subclass of OperandPtg is mutable, so it's safest to not share these
instances.
-                ptg = ((OperandPtg<?>) ptg).copy();
+                ptg = ((OperandPtg) ptg).copy();
             } else {
             	// all other Ptgs are immutable and can be shared
             }

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/TextObjectRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/TextObjectRecord.java?rev=887432&r1=887431&r2=887432&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/TextObjectRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/TextObjectRecord.java Fri Dec  4 23:05:06
2009
@@ -75,7 +75,7 @@
 	 */
 	private int _unknownPreFormulaInt;
 	/** expect tRef, tRef3D, tArea, tArea3D or tName */
-	private OperandPtg<?> _linkRefPtg;
+	private OperandPtg _linkRefPtg;
 	/**
 	 * Not clear if needed .  Excel seems to be OK if this byte is not present.
 	 * Value is often the same as the earlier firstColumn byte. */
@@ -108,7 +108,7 @@
 				throw new RecordFormatException("Read " + ptgs.length
 						+ " tokens but expected exactly 1");
 			}
-			_linkRefPtg = (OperandPtg<?>) ptgs[0];
+			_linkRefPtg = (OperandPtg) ptgs[0];
 			if (in.remaining() > 0) {
 				_unknownPostFormulaByte = Byte.valueOf(in.readByte());
 			} else {

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/formula/Area3DPtg.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/formula/Area3DPtg.java?rev=887432&r1=887431&r2=887432&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/formula/Area3DPtg.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/formula/Area3DPtg.java Fri Dec  4 23:05:06
2009
@@ -32,7 +32,7 @@
  * @author avik
  * @author Jason Height (jheight at chariot dot net dot au)
  */
-public final class Area3DPtg extends AreaPtgBase<Area3DPtg> implements WorkbookDependentFormula,
ExternSheetReferenceToken {
+public final class Area3DPtg extends AreaPtgBase implements WorkbookDependentFormula, ExternSheetReferenceToken
{
 	public final static byte sid = 0x3b;
 	private final static int SIZE = 11; // 10 + 1 for Ptg
 

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/formula/AreaPtgBase.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/formula/AreaPtgBase.java?rev=887432&r1=887431&r2=887432&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/formula/AreaPtgBase.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/formula/AreaPtgBase.java Fri Dec  4 23:05:06
2009
@@ -29,7 +29,7 @@
  * @author  andy
  * @author Jason Height (jheight at chariot dot net dot au)
  */
-public abstract class AreaPtgBase<Z extends AreaPtgBase<Z>> extends OperandPtg<Z>
implements AreaI {
+public abstract class AreaPtgBase extends OperandPtg implements AreaI {
 	/**
 	 * TODO - (May-2008) fix subclasses of AreaPtg 'AreaN~' which are used in shared formulas.
 	 * see similar comment in ReferencePtg

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/formula/OperandPtg.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/formula/OperandPtg.java?rev=887432&r1=887431&r2=887432&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/formula/OperandPtg.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/formula/OperandPtg.java Fri Dec  4 23:05:06
2009
@@ -17,11 +17,10 @@
 
 package org.apache.poi.hssf.record.formula;
 
-
 /**
  * @author Josh Micich
  */
-public abstract class OperandPtg<Y extends OperandPtg<Y>> extends Ptg implements
Cloneable {
+public abstract class OperandPtg extends Ptg implements Cloneable {
 
 	/**
 	 * All Operand {@link Ptg}s are classified ('relative', 'value', 'array')
@@ -29,11 +28,9 @@
 	public final boolean isBaseToken() {
 		return false;
 	}
-	public final Y copy() {
+	public final OperandPtg copy() {
 		try {
-			@SuppressWarnings("unchecked")
-			Y result = (Y) clone();
-			return result;
+			return (OperandPtg) clone();
 		} catch (CloneNotSupportedException e) {
 			throw new RuntimeException(e);
 		}

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/formula/Ref3DPtg.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/formula/Ref3DPtg.java?rev=887432&r1=887431&r2=887432&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/formula/Ref3DPtg.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/formula/Ref3DPtg.java Fri Dec  4 23:05:06
2009
@@ -31,7 +31,7 @@
  * @author Libin Roman (Vista Portal LDT. Developer)
  * @author Jason Height (jheight at chariot dot net dot au)
  */
-public final class Ref3DPtg extends RefPtgBase<Ref3DPtg> implements WorkbookDependentFormula,
ExternSheetReferenceToken {
+public final class Ref3DPtg extends RefPtgBase implements WorkbookDependentFormula, ExternSheetReferenceToken
{
     public final static byte sid  = 0x3a;
 
     private final static int  SIZE = 7; // 6 + 1 for Ptg

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/formula/RefPtgBase.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/formula/RefPtgBase.java?rev=887432&r1=887431&r2=887432&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/formula/RefPtgBase.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/formula/RefPtgBase.java Fri Dec  4 23:05:06
2009
@@ -29,7 +29,7 @@
  * @author Andrew C. Oliver (acoliver@apache.org)
  * @author Jason Height (jheight at chariot dot net dot au)
  */
-public abstract class RefPtgBase<Z extends RefPtgBase<Z>> extends OperandPtg<Z>
{
+public abstract class RefPtgBase extends OperandPtg {
 
 	/** The row index - zero based unsigned 16 bit value */
 	private int field_1_row;

Modified: poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java?rev=887432&r1=887431&r2=887432&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java Fri Dec  4 23:05:06
2009
@@ -58,6 +58,7 @@
 import org.apache.poi.hssf.record.formula.Area3DPtg;
 import org.apache.poi.hssf.record.formula.MemFuncPtg;
 import org.apache.poi.hssf.record.formula.NameXPtg;
+import org.apache.poi.hssf.record.formula.OperandPtg;
 import org.apache.poi.hssf.record.formula.Ptg;
 import org.apache.poi.hssf.record.formula.Ref3DPtg;
 import org.apache.poi.hssf.record.formula.SheetNameFormatter;
@@ -678,11 +679,11 @@
                 Ptg ptg = ptgs[i];
 
                 if (ptg instanceof Area3DPtg) {
-                    Area3DPtg a3p = ((Area3DPtg) ptg).copy();
+                    Area3DPtg a3p = (Area3DPtg) ((OperandPtg) ptg).copy();
                     a3p.setExternSheetIndex(newExtSheetIx);
                     ptgs[i] = a3p;
                 } else if (ptg instanceof Ref3DPtg) {
-                    Ref3DPtg r3p = ((Ref3DPtg) ptg).copy();
+                    Ref3DPtg r3p = (Ref3DPtg) ((OperandPtg) ptg).copy();
                     r3p.setExternSheetIndex(newExtSheetIx);
                     ptgs[i] = r3p;
                 }



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


Mime
View raw message