poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r1591838 - /poi/trunk/src/java/org/apache/poi/hssf/record/aggregates/CFRecordsAggregate.java
Date Fri, 02 May 2014 09:15:24 GMT
Author: nick
Date: Fri May  2 09:15:23 2014
New Revision: 1591838

URL: http://svn.apache.org/r1591838
Log:
Generics warnings fixes

Modified:
    poi/trunk/src/java/org/apache/poi/hssf/record/aggregates/CFRecordsAggregate.java

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/aggregates/CFRecordsAggregate.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/aggregates/CFRecordsAggregate.java?rev=1591838&r1=1591837&r2=1591838&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/aggregates/CFRecordsAggregate.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/aggregates/CFRecordsAggregate.java Fri May
 2 09:15:23 2014
@@ -24,19 +24,16 @@ import org.apache.poi.hssf.model.RecordS
 import org.apache.poi.hssf.record.CFHeaderRecord;
 import org.apache.poi.hssf.record.CFRuleRecord;
 import org.apache.poi.hssf.record.Record;
+import org.apache.poi.ss.formula.FormulaShifter;
 import org.apache.poi.ss.formula.ptg.AreaErrPtg;
 import org.apache.poi.ss.formula.ptg.AreaPtg;
-import org.apache.poi.ss.formula.FormulaShifter;
 import org.apache.poi.ss.formula.ptg.Ptg;
 import org.apache.poi.ss.util.CellRangeAddress;
 
 /**
  * CFRecordsAggregate - aggregates Conditional Formatting records CFHeaderRecord 
  * and number of up to three CFRuleRecord records together to simplify
- * access to them.  
- * 
- * @author Dmitriy Kumshayev
- *
+ * access to them.
  */
 public final class CFRecordsAggregate extends RecordAggregate {
 	/** Excel allows up to 3 conditional formating rules */
@@ -45,7 +42,7 @@ public final class CFRecordsAggregate ex
 	private final CFHeaderRecord header;
 
 	/** List of CFRuleRecord objects */
-	private final List rules;
+	private final List<CFRuleRecord> rules;
 
 	private CFRecordsAggregate(CFHeaderRecord pHeader, CFRuleRecord[] pRules) {
 		if(pHeader == null) {
@@ -62,7 +59,7 @@ public final class CFRecordsAggregate ex
 			throw new RuntimeException("Mismatch number of rules");
 		}
 		header = pHeader;
-		rules = new ArrayList(3);
+		rules = new ArrayList<CFRuleRecord>(3);
 		for (int i = 0; i < pRules.length; i++) {
 			rules.add(pRules[i]);
 		}
@@ -124,7 +121,7 @@ public final class CFRecordsAggregate ex
 	}
 	public CFRuleRecord getRule(int idx) {
 		checkRuleIndex(idx);
-		return (CFRuleRecord) rules.get(idx);
+		return rules.get(idx);
 	}
 	public void setRule(int idx, CFRuleRecord r) {
 		if (r == null) {
@@ -162,7 +159,7 @@ public final class CFRecordsAggregate ex
 		}
 		for(int i=0; i<rules.size(); i++)
 		{
-			CFRuleRecord cfRule = (CFRuleRecord)rules.get(i);
+			CFRuleRecord cfRule = rules.get(i);
 			buffer.append(cfRule.toString());
 		}
 		buffer.append("[/CF]\n");
@@ -172,7 +169,7 @@ public final class CFRecordsAggregate ex
 	public void visitContainedRecords(RecordVisitor rv) {
 		rv.visitRecord(header);
 		for(int i=0; i<rules.size(); i++) {
-			CFRuleRecord rule = (CFRuleRecord)rules.get(i);
+			CFRuleRecord rule = rules.get(i);
 			rv.visitRecord(rule);
 		}
 	}
@@ -183,7 +180,7 @@ public final class CFRecordsAggregate ex
 	public boolean updateFormulasAfterCellShift(FormulaShifter shifter, int currentExternSheetIx)
{
 		CellRangeAddress[] cellRanges = header.getCellRanges();
 		boolean changed = false;
-		List temp = new ArrayList();
+		List<CellRangeAddress> temp = new ArrayList<CellRangeAddress>();
 		for (int i = 0; i < cellRanges.length; i++) {
 			CellRangeAddress craOld = cellRanges[i];
 			CellRangeAddress craNew = shiftRange(shifter, craOld, currentExternSheetIx);
@@ -208,7 +205,7 @@ public final class CFRecordsAggregate ex
 		}
 		
 		for(int i=0; i<rules.size(); i++) {
-			CFRuleRecord rule = (CFRuleRecord)rules.get(i);
+			CFRuleRecord rule = rules.get(i);
 			Ptg[] ptgs;
 			ptgs = rule.getParsedExpression1();
 			if (ptgs != null && shifter.adjustFormula(ptgs, currentExternSheetIx)) {



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


Mime
View raw message