Update getSupportedSourceVersion() logic
Use SourceVersion.latestSupported() rather than @SupportedSourceVersion since we might build with an earlier JDK. Fixes gh-2302
This commit is contained in:
parent
4c6907d5d8
commit
3cd40e2488
|
@ -34,7 +34,6 @@ import javax.annotation.processing.ProcessingEnvironment;
|
||||||
import javax.annotation.processing.Processor;
|
import javax.annotation.processing.Processor;
|
||||||
import javax.annotation.processing.RoundEnvironment;
|
import javax.annotation.processing.RoundEnvironment;
|
||||||
import javax.annotation.processing.SupportedAnnotationTypes;
|
import javax.annotation.processing.SupportedAnnotationTypes;
|
||||||
import javax.annotation.processing.SupportedSourceVersion;
|
|
||||||
import javax.lang.model.SourceVersion;
|
import javax.lang.model.SourceVersion;
|
||||||
import javax.lang.model.element.AnnotationMirror;
|
import javax.lang.model.element.AnnotationMirror;
|
||||||
import javax.lang.model.element.AnnotationValue;
|
import javax.lang.model.element.AnnotationValue;
|
||||||
|
@ -66,7 +65,6 @@ import org.springframework.boot.configurationprocessor.metadata.JsonMarshaller;
|
||||||
* @since 1.2.0
|
* @since 1.2.0
|
||||||
*/
|
*/
|
||||||
@SupportedAnnotationTypes({ "*" })
|
@SupportedAnnotationTypes({ "*" })
|
||||||
@SupportedSourceVersion(SourceVersion.RELEASE_8)
|
|
||||||
public class ConfigurationMetadataAnnotationProcessor extends AbstractProcessor {
|
public class ConfigurationMetadataAnnotationProcessor extends AbstractProcessor {
|
||||||
|
|
||||||
static final String CONFIGURATION_PROPERTIES_ANNOTATION = "org.springframework.boot."
|
static final String CONFIGURATION_PROPERTIES_ANNOTATION = "org.springframework.boot."
|
||||||
|
@ -101,6 +99,11 @@ public class ConfigurationMetadataAnnotationProcessor extends AbstractProcessor
|
||||||
return NESTED_CONFIGURATION_PROPERTY_ANNOTATION;
|
return NESTED_CONFIGURATION_PROPERTY_ANNOTATION;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SourceVersion getSupportedSourceVersion() {
|
||||||
|
return SourceVersion.latestSupported();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public synchronized void init(ProcessingEnvironment env) {
|
public synchronized void init(ProcessingEnvironment env) {
|
||||||
super.init(env);
|
super.init(env);
|
||||||
|
|
Loading…
Reference in New Issue