You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mi...@apache.org on 2020/07/27 15:18:41 UTC

[lucene-solr] branch branch_8x updated: LUCENE-9424: add a performance warning to AttributeSource.captureState javadocs

This is an automated email from the ASF dual-hosted git repository.

mikemccand pushed a commit to branch branch_8x
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/branch_8x by this push:
     new 295b5af  LUCENE-9424: add a performance warning to AttributeSource.captureState javadocs
295b5af is described below

commit 295b5afcb3af4e65d4ce46291501712b97172dbf
Author: Mike McCandless <mi...@apache.org>
AuthorDate: Mon Jul 27 11:11:35 2020 -0400

    LUCENE-9424: add a performance warning to AttributeSource.captureState javadocs
---
 lucene/CHANGES.txt                                               | 6 ++++++
 lucene/core/src/java/org/apache/lucene/util/AttributeSource.java | 2 ++
 2 files changed, 8 insertions(+)

diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index c828405..4e420e0 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -33,6 +33,12 @@ Bug Fixes
 ---------------------
 (No changes)
 
+Documentation
+---------------------
+
+* LUCENE-9424: Add a performance warning to AttributeSource.captureState javadocs (Haoyu Zhai)
+
+
 Other
 ---------------------
 (No changes)
diff --git a/lucene/core/src/java/org/apache/lucene/util/AttributeSource.java b/lucene/core/src/java/org/apache/lucene/util/AttributeSource.java
index e962fed..fe4e4f1 100644
--- a/lucene/core/src/java/org/apache/lucene/util/AttributeSource.java
+++ b/lucene/core/src/java/org/apache/lucene/util/AttributeSource.java
@@ -292,6 +292,8 @@ public class AttributeSource {
   /**
    * Captures the state of all Attributes. The return value can be passed to
    * {@link #restoreState} to restore the state of this or another AttributeSource.
+   * 
+   * Be careful, this method comes with a cost of deep copying all attributes in the source.
    */
   public final State captureState() {
     final State state = this.getCurrentState();