You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by GitBox <gi...@apache.org> on 2019/07/16 09:53:50 UTC

[GitHub] [lucene-solr] romseygeek commented on a change in pull request #786: LUCENE-8916: GraphTokenStreamFiniteStrings preserves all incoming attributes

romseygeek commented on a change in pull request #786: LUCENE-8916: GraphTokenStreamFiniteStrings preserves all incoming attributes
URL: https://github.com/apache/lucene-solr/pull/786#discussion_r303822204
 
 

 ##########
 File path: lucene/core/src/test/org/apache/lucene/util/graph/TestGraphTokenStreamFiniteStrings.java
 ##########
 @@ -44,13 +48,13 @@ private void assertTokenStream(TokenStream ts, String[] terms, int[] increments)
     assertNotNull(terms);
     assertNotNull(increments);
     assertEquals(terms.length, increments.length);
-    BytesTermAttribute termAtt = ts.getAttribute(BytesTermAttribute.class);
+    CharTermAttribute termAtt = ts.getAttribute(CharTermAttribute.class);
     PositionIncrementAttribute incrAtt = ts.getAttribute(PositionIncrementAttribute.class);
     int offset = 0;
     while (ts.incrementToken()) {
       // verify term and increment
       assert offset < terms.length;
-      assertEquals(terms[offset], termAtt.getBytesRef().utf8ToString());
+      assertEquals(terms[offset], termAtt.toString());
 
 Review comment:
   It needs to change from `BytesTermAttribute` to something else - I could change it to a `TermToBytesRefAttribute`, but `CharTermAttribute` seemed simpler and involves less byte-wrangling

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org