poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ser...@apache.org
Subject svn commit: r1142835 - /poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Range.java
Date Mon, 04 Jul 2011 22:36:27 GMT
Author: sergey
Date: Mon Jul  4 22:36:27 2011
New Revision: 1142835

URL: http://svn.apache.org/viewvc?rev=1142835&view=rev
Log:
fix warning about generics

Modified:
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Range.java

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Range.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Range.java?rev=1142835&r1=1142834&r2=1142835&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Range.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Range.java Mon Jul  4 22:36:27
2011
@@ -22,23 +22,23 @@ import org.apache.poi.util.LittleEndian;
 import org.apache.poi.hwpf.HWPFDocument;
 import org.apache.poi.hwpf.HWPFDocumentCore;
 
+import org.apache.poi.hwpf.model.CHPX;
 import org.apache.poi.hwpf.model.CPSplitCalculator;
 import org.apache.poi.hwpf.model.FileInformationBlock;
-import org.apache.poi.hwpf.model.PropertyNode;
-import org.apache.poi.hwpf.model.StyleSheet;
-import org.apache.poi.hwpf.model.CHPX;
+import org.apache.poi.hwpf.model.ListTables;
 import org.apache.poi.hwpf.model.PAPX;
+import org.apache.poi.hwpf.model.PropertyNode;
 import org.apache.poi.hwpf.model.SEPX;
+import org.apache.poi.hwpf.model.StyleSheet;
 import org.apache.poi.hwpf.model.TextPiece;
-import org.apache.poi.hwpf.model.ListTables;
 
 import org.apache.poi.hwpf.sprm.CharacterSprmCompressor;
 import org.apache.poi.hwpf.sprm.ParagraphSprmCompressor;
 import org.apache.poi.hwpf.sprm.SprmBuffer;
 
+import java.lang.ref.WeakReference;
 import java.util.List;
 import java.util.NoSuchElementException;
-import java.lang.ref.WeakReference;
 
 /**
  * This class is the central class of the HWPF object model. All properties that
@@ -64,7 +64,7 @@ public class Range { // TODO -instantiab
 	public static final int TYPE_UNDEFINED = 6;
 
 	/** Needed so inserts and deletes will ripple up through containing Ranges */
-	private WeakReference _parent;
+	private WeakReference<Range> _parent;
 
 	/** The starting character offset of this range. */
 	protected int _start;
@@ -148,7 +148,7 @@ public class Range { // TODO -instantiab
 		_paragraphs = _doc.getParagraphTable().getParagraphs();
 		_characters = _doc.getCharacterTable().getTextRuns();
 		_text = _doc.getTextTable().getTextPieces();
-		_parent = new WeakReference(null);
+		_parent = new WeakReference<Range>(null);
 
 		sanityCheckStartEnd();
 	}
@@ -171,7 +171,7 @@ public class Range { // TODO -instantiab
 		_paragraphs = parent._paragraphs;
 		_characters = parent._characters;
 		_text = parent._text;
-		_parent = new WeakReference(parent);
+		_parent = new WeakReference<Range>(parent);
 
 		sanityCheckStartEnd();
 	}
@@ -195,7 +195,7 @@ public class Range { // TODO -instantiab
 		_paragraphs = parent._paragraphs;
 		_characters = parent._characters;
 		_text = parent._text;
-		_parent = new WeakReference(parent);
+		_parent = new WeakReference<Range>(parent);
 
 		switch (idxType) {
 			case TYPE_PARAGRAPH:
@@ -1079,7 +1079,7 @@ public class Range { // TODO -instantiab
 		_end += length;
 
 		reset();
-		Range parent = (Range) _parent.get();
+		Range parent = _parent.get();
 		if (parent != null) {
 			parent.adjustForInsert(length);
 		}



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


Mime
View raw message