lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r1045081 - /lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/standard/StandardPostingsReader.java
Date Mon, 13 Dec 2010 11:52:28 GMT
Author: mikemccand
Date: Mon Dec 13 11:52:28 2010
New Revision: 1045081

URL: http://svn.apache.org/viewvc?rev=1045081&view=rev
Log:
LUCENE-2674: avoid Object.clone in Standard codec's term state

Modified:
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/standard/StandardPostingsReader.java

Modified: lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/standard/StandardPostingsReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/standard/StandardPostingsReader.java?rev=1045081&r1=1045080&r2=1045081&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/standard/StandardPostingsReader.java
(original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/standard/StandardPostingsReader.java
Mon Dec 13 11:52:28 2010
@@ -82,16 +82,15 @@ public class StandardPostingsReader exte
     maxSkipLevels = termsIn.readInt();
   }
 
-  private static class DocTermState extends TermState {
+  // Must keep final because we do non-standard clone
+  private final static class DocTermState extends TermState {
     long freqOffset;
     long proxOffset;
     int skipOffset;
 
     public Object clone() {
-      DocTermState other = (DocTermState) super.clone();
-      other.freqOffset = freqOffset;
-      other.proxOffset = proxOffset;
-      other.skipOffset = skipOffset;
+      DocTermState other = new DocTermState();
+      other.copy(this);
       return other;
     }
 



Mime
View raw message