gaobinlong commented on code in PR #15842:
URL: https://github.com/apache/lucene/pull/15842#discussion_r3026060612
##########
lucene/analysis/common/src/java/org/apache/lucene/analysis/compound/hyphenation/PatternParser.java:
##########
@@ -202,11 +202,11 @@ protected String getExceptionWord(ArrayList<?> ex) {
StringBuilder res = new StringBuilder();
for (int i = 0; i < ex.size(); i++) {
Object item = ex.get(i);
- if (item instanceof String) {
- res.append((String) item);
+ if (item instanceof String s) {
+ res.append(s);
} else {
- if (((Hyphen) item).noBreak != null) {
- res.append(((Hyphen) item).noBreak);
+ if (item instanceof Hyphen h && h.noBreak != null) {
Review Comment:
Thanks, reverted that back.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]