krickert commented on code in PR #1150:
URL: https://github.com/apache/opennlp/pull/1150#discussion_r3593789628
##########
opennlp-extensions/opennlp-spellcheck/src/main/java/opennlp/spellcheck/normalizer/SpellCheckingCharSequenceNormalizer.java:
##########
@@ -152,15 +157,21 @@ private SpellCheckingCharSequenceNormalizer(Builder b) {
* @return a new {@link Builder} seeded with sensible defaults
*/
public static Builder builder(SpellChecker spellChecker) {
- return new Builder(Objects.requireNonNull(spellChecker, "spellChecker must
not be null"));
+ if (spellChecker == null) {
+ throw new IllegalArgumentException("spellChecker must not be null");
+ }
+ return new Builder(spellChecker);
}
/**
* @param model the loaded model whose engine to wrap; must not be {@code
null}
* @return a new {@link Builder} seeded with sensible defaults
*/
public static Builder builder(SymSpellModel model) {
- return new Builder(Objects.requireNonNull(model, "model must not be
null").getSymSpell());
+ if (model == null) {
+ throw new IllegalArgumentException("model must not be null");
Review Comment:
Fixed
##########
opennlp-extensions/opennlp-spellcheck/src/main/java/opennlp/spellcheck/normalizer/SpellCheckingCharSequenceNormalizer.java:
##########
@@ -344,7 +355,10 @@ private Builder(SpellChecker spellChecker) {
* @return this builder
*/
public Builder mode(Mode value) {
- this.mode = Objects.requireNonNull(value, "mode must not be null");
+ if (value == null) {
+ throw new IllegalArgumentException("mode must not be null");
Review Comment:
Fixed
--
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]