You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2013/10/11 20:03:27 UTC

svn commit: r1531376 - in /lucene/dev/trunk/lucene: CHANGES.txt core/src/java/org/apache/lucene/util/AttributeSource.java

Author: rmuir
Date: Fri Oct 11 18:03:27 2013
New Revision: 1531376

URL: http://svn.apache.org/r1531376
Log:
LUCENE-5275: Change AttributeSource.toString to display the current state of attributes

Modified:
    lucene/dev/trunk/lucene/CHANGES.txt
    lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/AttributeSource.java

Modified: lucene/dev/trunk/lucene/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/CHANGES.txt?rev=1531376&r1=1531375&r2=1531376&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/CHANGES.txt (original)
+++ lucene/dev/trunk/lucene/CHANGES.txt Fri Oct 11 18:03:27 2013
@@ -143,6 +143,9 @@ API Changes:
   with IndexSearcher when an ExecutorService is specified.
   (Ryan Ernst, Mike McCandless, Robert Muir)
 
+* LUCENE-5275: Change AttributeSource.toString() to display the current
+  state of attributes. (Robert Muir)
+
 Optimizations
 
 * LUCENE-5225: The ToParentBlockJoinQuery only keeps tracks of the the child

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/AttributeSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/AttributeSource.java?rev=1531376&r1=1531375&r2=1531376&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/AttributeSource.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/util/AttributeSource.java Fri Oct 11 18:03:27 2013
@@ -501,4 +501,13 @@ public class AttributeSource {
     }
   }
 
+  /**
+   * Returns a string consisting of the class's simple name, the hex representation of the identity hash code,
+   * and the current reflection of all attributes.
+   * @see #reflectAsString(boolean)
+   */
+  @Override
+  public String toString() {
+    return getClass().getSimpleName() + '@' + Integer.toHexString(System.identityHashCode(this)) + " " + reflectAsString(false);
+  }
 }