Use AssertionUtil

This commit is contained in:
Clément Fournier committed 2022-02-27 13:44:38 +01:00
1 parent 067e2f4407
commit e4547df0c0
1 file changed
+7 -5
@@ -4,6 +4,8 @@
package net.sourceforge.pmd.lang.ast;
import static net.sourceforge.pmd.internal.util.AssertionUtil.requireParamNotNull;
import java.util.Objects;
import org.checkerframework.checker.nullness.qual.NonNull;
@@ -53,11 +55,11 @@ public interface Parser {
private final PropertySource propertySource;
public ParserTask(LanguageVersion lv, String filepath, String sourceText, SemanticErrorReporter reporter, ClassLoader auxclasspathClassLoader) {
this.lv = Objects.requireNonNull(lv, "lv was null");
this.filepath = Objects.requireNonNull(filepath, "filepath was null");
this.sourceText = Objects.requireNonNull(sourceText, "sourceText was null");
this.reporter = Objects.requireNonNull(reporter, "reporter was null");
this.auxclasspathClassLoader = Objects.requireNonNull(auxclasspathClassLoader, "auxclasspathClassLoader was null");
this.lv = requireParamNotNull("language version", lv);
this.filepath = requireParamNotNull("filepath", filepath);
this.sourceText = requireParamNotNull("sourceText", sourceText);
this.reporter = requireParamNotNull("reporter", reporter);
this.auxclasspathClassLoader = requireParamNotNull("auxclasspathClassLoader", auxclasspathClassLoader);
this.propertySource = new ParserTaskProperties();
propertySource.definePropertyDescriptor(COMMENT_MARKER);