mirror of
https://github.com/google/nomulus
synced 2026-04-13 21:17:14 +00:00
Upgrade to Java 25 (#3000)
Error-prone introduced many more checks in Java 25. We fixed a few
and suppressed most. A follow-up bug is opened to clean this up.
An ai agent should be able to clean up most of it.
This PR is created with gemini-cli. Summary of experience:
* The good: AI caught most compatibility issues, and with permission,
suppressed them through compiler flags and errorprone options.
It also caught many versio references in scripts.
* Where it didn't shine:
- It did not find and update the target version spec in the custome
VKey annotation processor source file.
- It did not flag eclipse-temurin:21 docker image for upgrade.
- When running into failure, its first instinct is to disable checks
e.g., -Werror instead of fixing them.
This commit is contained in:
@@ -34,7 +34,6 @@ import java.util.Set;
|
||||
import javax.annotation.processing.AbstractProcessor;
|
||||
import javax.annotation.processing.RoundEnvironment;
|
||||
import javax.annotation.processing.SupportedAnnotationTypes;
|
||||
import javax.annotation.processing.SupportedSourceVersion;
|
||||
import javax.lang.model.SourceVersion;
|
||||
import javax.lang.model.element.AnnotationMirror;
|
||||
import javax.lang.model.element.AnnotationValue;
|
||||
@@ -50,13 +49,20 @@ import javax.lang.model.util.Types;
|
||||
|
||||
/** Processor to generate {@link AttributeConverter} for {@code VKey} type. */
|
||||
@SupportedAnnotationTypes("google.registry.persistence.WithVKey")
|
||||
@SupportedSourceVersion(SourceVersion.RELEASE_21)
|
||||
public class VKeyProcessor extends AbstractProcessor {
|
||||
|
||||
private static final String CONVERTER_CLASS_NAME_TEMP = "VKeyConverter_%s";
|
||||
|
||||
private static final String VKEY_TYPE_METHOD_NAME = "value";
|
||||
|
||||
@Override
|
||||
public SourceVersion getSupportedSourceVersion() {
|
||||
// Do not hardcode version. If JDK is not the same version, a warning is generated
|
||||
// and breaks the build if `-Werror` is set. This is Safe because this class is a
|
||||
// code generator, and can only cause build errors.
|
||||
return SourceVersion.latestSupported();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
|
||||
annotations.forEach(
|
||||
|
||||
Reference in New Issue
Block a user