private void validate()

in maven-resolver-impl/src/main/java/org/eclipse/aether/impl/scope/BuildScopeQuery.java [41:51]


        private void validate(ProjectPath projectPath, BuildPath buildPath) {
            if ((this == ALL) && (projectPath != null || buildPath != null)) {
                throw new IllegalArgumentException(this.name() + " requires no parameter");
            } else if (this == BY_PROJECT_PATH && (projectPath == null || buildPath != null)) {
                throw new IllegalArgumentException(this.name() + " requires project path parameter only");
            } else if (this == BY_BUILD_PATH && (projectPath != null || buildPath == null)) {
                throw new IllegalArgumentException(this.name() + " requires build path parameter only");
            } else if ((this == SELECT || this == SINGLETON) && (projectPath == null || buildPath == null)) {
                throw new IllegalArgumentException(this.name() + " requires both parameters");
            }
        }