Remove JP-specific validators
This commit is contained in:
parent
76b3e99286
commit
3635d041dc
5 changed files with 0 additions and 520 deletions
|
|
@ -1,110 +0,0 @@
|
|||
package org.fedoraproject.javapackages.validator.validators.jp;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.fedoraproject.javadeptools.rpm.RpmFile;
|
||||
import org.fedoraproject.javapackages.validator.Decorated;
|
||||
import org.fedoraproject.javapackages.validator.TmtTest;
|
||||
import org.fedoraproject.javapackages.validator.validators.BytecodeVersionJarValidator;
|
||||
|
||||
@TmtTest("/java/jp/bytecode_version")
|
||||
public class BytecodeVersionJarValidatorJP extends BytecodeVersionJarValidator {
|
||||
private Set<String> packagesReqVersion8 = Set.of(new String[] {
|
||||
"maven",
|
||||
"apache-commons-cli",
|
||||
"apache-commons-codec",
|
||||
"apache-commons-io",
|
||||
"apache-commons-lang3",
|
||||
"atinject",
|
||||
"cdi-api",
|
||||
"google-guice",
|
||||
"guava",
|
||||
"httpcomponents-client",
|
||||
"httpcomponents-core",
|
||||
"jakarta-annotations",
|
||||
"jansi",
|
||||
"jsr-305",
|
||||
"maven-resolver",
|
||||
"maven-shared-utils",
|
||||
"maven-wagon",
|
||||
"plexus-cipher",
|
||||
"plexus-classworlds",
|
||||
"plexus-containers",
|
||||
"plexus-interpolation",
|
||||
"plexus-sec-dispatcher",
|
||||
"plexus-utils",
|
||||
"sisu",
|
||||
"slf4j",
|
||||
|
||||
"ant",
|
||||
"antlr",
|
||||
"apache-commons-net",
|
||||
"bcel",
|
||||
"bsf",
|
||||
"jakarta-activation1",
|
||||
"jakarta-mail",
|
||||
"jakarta-oro",
|
||||
"jdepend",
|
||||
"jsch",
|
||||
"jzlib",
|
||||
"regexp",
|
||||
"xalan-j2",
|
||||
"xerces-j2",
|
||||
"xml-commons-apis",
|
||||
"xml-commons-resolver",
|
||||
});
|
||||
|
||||
@Override
|
||||
public void validate(RpmFile rpm, Path jarPath, Map<Path, Short> classVersions) {
|
||||
for (var entry : classVersions.entrySet()) {
|
||||
Path classPath = entry.getKey();
|
||||
int version = entry.getValue();
|
||||
int maxAllowedVersion = 17;
|
||||
int expected;
|
||||
|
||||
if (classPath.endsWith("module-info.class") || classPath.endsWith("package-info.class")) {
|
||||
// pass
|
||||
} else if (classPath.startsWith("META-INF/versions")) {
|
||||
// JEP 238: Multi-Release JAR Files
|
||||
// https://openjdk.org/jeps/238
|
||||
|
||||
if (version > 44 + (expected = Short.parseShort(classPath.getName(2).toString()))) {
|
||||
fail("{0}: {1}: {2}: class bytecode version is {3} which is larger than {4}",
|
||||
Decorated.rpm(rpm),
|
||||
Decorated.custom(jarPath, DECORATION_JAR),
|
||||
Decorated.struct(classPath),
|
||||
Decorated.actual(version),
|
||||
Decorated.expected(expected));
|
||||
continue;
|
||||
} else {
|
||||
// pass
|
||||
}
|
||||
} else if (packagesReqVersion8.contains(rpm.getInfo().getPackageName()) && version > 44 + 8) {
|
||||
fail("{0}: {1}: {2}: class bytecode version is {3} which is larger than {4} (package is required to have a bytecode version compatible with JVM 8)",
|
||||
Decorated.rpm(rpm),
|
||||
Decorated.custom(jarPath, DECORATION_JAR),
|
||||
Decorated.struct(classPath),
|
||||
Decorated.actual(version),
|
||||
Decorated.expected(44 + 8));
|
||||
continue;
|
||||
} else if (version > 44 + maxAllowedVersion) {
|
||||
fail("{0}: {1}: {2}: class bytecode version is {3} which is larger than {4} (all packages should have bytecode version compatible with JVM {5})",
|
||||
Decorated.rpm(rpm),
|
||||
Decorated.custom(jarPath, DECORATION_JAR),
|
||||
Decorated.struct(classPath),
|
||||
Decorated.actual(version),
|
||||
Decorated.expected(44 + maxAllowedVersion),
|
||||
Decorated.plain(maxAllowedVersion));
|
||||
continue;
|
||||
}
|
||||
|
||||
pass("{0}: {1}: {2}: class bytecode version: {3}",
|
||||
Decorated.rpm(rpm),
|
||||
Decorated.custom(jarPath, DECORATION_JAR),
|
||||
Decorated.struct(classPath),
|
||||
Decorated.actual(version));
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue