Port to new JPV interface
This commit is contained in:
parent
fa83b8fa59
commit
bd21d85bf2
6 changed files with 36 additions and 28 deletions
|
|
@ -4,9 +4,11 @@ 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.helpers.BytecodeVersionJarValidator;
|
||||
import org.fedoraproject.javapackages.validator.spi.Decorated;
|
||||
import org.fedoraproject.javapackages.validator.util.BytecodeVersionJarValidator;
|
||||
import org.fedoraproject.javapackages.validator.util.Common;
|
||||
|
||||
import io.kojan.javadeptools.rpm.RpmPackage;
|
||||
|
||||
public class BytecodeVersionJarValidatorJP extends BytecodeVersionJarValidator {
|
||||
@Override
|
||||
|
|
@ -60,7 +62,7 @@ public class BytecodeVersionJarValidatorJP extends BytecodeVersionJarValidator {
|
|||
});
|
||||
|
||||
@Override
|
||||
public void validate(RpmFile rpm, Path jarPath, Map<Path, Version> classVersions) {
|
||||
public void validate(RpmPackage rpm, Path jarPath, Map<Path, Version> classVersions) {
|
||||
for (var entry : classVersions.entrySet()) {
|
||||
Path classPath = entry.getKey();
|
||||
int version = entry.getValue().major();
|
||||
|
|
@ -84,7 +86,7 @@ public class BytecodeVersionJarValidatorJP extends BytecodeVersionJarValidator {
|
|||
} else {
|
||||
// pass
|
||||
}
|
||||
} else if (packagesReqVersion8.contains(rpm.getInfo().getPackageName()) && version > 44 + 8) {
|
||||
} else if (packagesReqVersion8.contains(Common.getPackageName(rpm.getInfo())) && 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),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue