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: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org