Skip to content

Commit 3cd40e2

Browse files
committed
Update getSupportedSourceVersion() logic
Use SourceVersion.latestSupported() rather than @SupportedSourceVersion since we might build with an earlier JDK. Fixes gh-2302
1 parent 4c6907d commit 3cd40e2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessor.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
import javax.annotation.processing.Processor;
3535
import javax.annotation.processing.RoundEnvironment;
3636
import javax.annotation.processing.SupportedAnnotationTypes;
37-
import javax.annotation.processing.SupportedSourceVersion;
3837
import javax.lang.model.SourceVersion;
3938
import javax.lang.model.element.AnnotationMirror;
4039
import javax.lang.model.element.AnnotationValue;
@@ -66,7 +65,6 @@
6665
* @since 1.2.0
6766
*/
6867
@SupportedAnnotationTypes({ "*" })
69-
@SupportedSourceVersion(SourceVersion.RELEASE_8)
7068
public class ConfigurationMetadataAnnotationProcessor extends AbstractProcessor {
7169

7270
static final String CONFIGURATION_PROPERTIES_ANNOTATION = "org.springframework.boot."
@@ -101,6 +99,11 @@ protected String nestedConfigurationPropertyAnnotation() {
10199
return NESTED_CONFIGURATION_PROPERTY_ANNOTATION;
102100
}
103101

102+
@Override
103+
public SourceVersion getSupportedSourceVersion() {
104+
return SourceVersion.latestSupported();
105+
}
106+
104107
@Override
105108
public synchronized void init(ProcessingEnvironment env) {
106109
super.init(env);

0 commit comments

Comments
 (0)