mirror of https://github.com/apache/lucene.git
LUCENE-8570: Fix possible NPE in the attribute reflection of the Nori's PartOfSpeechAttributeImpl
This commit is contained in:
parent
2459072286
commit
2da72ad05c
|
@ -62,11 +62,12 @@ public class PartOfSpeechAttributeImpl extends AttributeImpl implements PartOfSp
|
|||
|
||||
@Override
|
||||
public void reflectWith(AttributeReflector reflector) {
|
||||
reflector.reflect(PartOfSpeechAttribute.class, "posType", getPOSType().name());
|
||||
Tag leftPOS = getLeftPOS();
|
||||
reflector.reflect(PartOfSpeechAttribute.class, "leftPOS", leftPOS.name() + "(" + leftPOS.description() + ")");
|
||||
Tag rightPOS = getRightPOS();
|
||||
reflector.reflect(PartOfSpeechAttribute.class, "rightPOS", rightPOS.name() + "(" + rightPOS.description() + ")");
|
||||
String posName = getPOSType() == null ? null : getPOSType().name();
|
||||
String rightPOS = getRightPOS() == null ? null : getRightPOS().name() + "(" + getRightPOS().description() + ")";
|
||||
String leftPOS = getLeftPOS() == null ? null : getLeftPOS().name() + "(" + getLeftPOS().description() + ")";
|
||||
reflector.reflect(PartOfSpeechAttribute.class, "posType", posName);
|
||||
reflector.reflect(PartOfSpeechAttribute.class, "leftPOS", leftPOS);
|
||||
reflector.reflect(PartOfSpeechAttribute.class, "rightPOS", rightPOS);
|
||||
reflector.reflect(PartOfSpeechAttribute.class, "morphemes", displayMorphemes(getMorphemes()));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue