提交 bd85c916 编写于 作者: S Stephane Nicoll

Integrate animal sniffer

Animal sniffer provides tools to assist verifying that classes
compiled with a newer JDK are compatible with an older JDK.

This integratesthe latest version of the tool (1.11) that
permits the use of custom annotations. Added @UsesJava7,
@UsesJava8 and @UsesSunHttpServer and annotated the few places
where we rely on a specific environment.

The verification process can be invoked by running the 'sniff'
task.

Issue: SPR-11604

polishing
上级 e84f61bb
...@@ -30,6 +30,7 @@ configure(allprojects) { project -> ...@@ -30,6 +30,7 @@ configure(allprojects) { project ->
ext.tiles3Version = "3.0.3" ext.tiles3Version = "3.0.3"
ext.tomcatVersion = "8.0.5" ext.tomcatVersion = "8.0.5"
ext.xstreamVersion = "1.4.7" ext.xstreamVersion = "1.4.7"
ext.snifferVersion = "1.11"
ext.gradleScriptDir = "${rootProject.projectDir}/gradle" ext.gradleScriptDir = "${rootProject.projectDir}/gradle"
...@@ -38,6 +39,11 @@ configure(allprojects) { project -> ...@@ -38,6 +39,11 @@ configure(allprojects) { project ->
apply plugin: "test-source-set-dependencies" apply plugin: "test-source-set-dependencies"
apply from: "${gradleScriptDir}/ide.gradle" apply from: "${gradleScriptDir}/ide.gradle"
configurations {
sniffer
javaApiSignature
}
compileJava.options*.compilerArgs = [ compileJava.options*.compilerArgs = [
"-Xlint:serial", "-Xlint:varargs", "-Xlint:cast", "-Xlint:classfile", "-Xlint:serial", "-Xlint:varargs", "-Xlint:cast", "-Xlint:classfile",
"-Xlint:dep-ann", "-Xlint:divzero", "-Xlint:empty", "-Xlint:finally", "-Xlint:dep-ann", "-Xlint:divzero", "-Xlint:empty", "-Xlint:finally",
...@@ -89,6 +95,47 @@ configure(allprojects) { project -> ...@@ -89,6 +95,47 @@ configure(allprojects) { project ->
exclude group:'org.hamcrest', module:'hamcrest-core' exclude group:'org.hamcrest', module:'hamcrest-core'
} }
testCompile("org.hamcrest:hamcrest-all:1.3") testCompile("org.hamcrest:hamcrest-all:1.3")
testCompile("org.mockito:mockito-core:1.9.5")
sniffer("org.codehaus.mojo:animal-sniffer-ant-tasks:${snifferVersion}")
javaApiSignature("org.codehaus.mojo.signature:java16:1.1@signature") // As from Java6_18
}
task copyJavaApiSignature(type: Copy) {
ext.to = file("$buildDir/javaApiSignature/")
description "Copy the resolved Animal Sniffer signature dependency artifact to a known location and name"
from configurations.javaApiSignature
into to
rename '.*signature', 'javaApi.signature'
}
task sniff {
group = "Verification"
description = "Checks the Java API signatures"
dependsOn compileJava
dependsOn copyJavaApiSignature
inputs.dir sourceSets.main.output.classesDir
inputs.dir copyJavaApiSignature.to
outputs.upToDateWhen { true }
doLast {
ant.taskdef(
name: 'animalSniffer',
classname: 'org.codehaus.mojo.animal_sniffer.ant.CheckSignatureTask',
classpath: configurations.sniffer.asPath
)
ant.animalSniffer(
signature: "$buildDir/javaApiSignature/javaApi.signature",
classpath: sourceSets.main.compileClasspath.asPath) {
path(path: sourceSets.main.output.classesDir)
annotation(className: "org.springframework.core.UsesJava7")
annotation(className: "org.springframework.core.UsesJava8")
annotation(className: "org.springframework.core.UsesSunHttpServer")
}
}
} }
ext.javadocLinks = [ ext.javadocLinks = [
......
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2014 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -19,6 +19,8 @@ package org.springframework.beans.propertyeditors; ...@@ -19,6 +19,8 @@ package org.springframework.beans.propertyeditors;
import java.beans.PropertyEditorSupport; import java.beans.PropertyEditorSupport;
import java.time.ZoneId; import java.time.ZoneId;
import org.springframework.core.UsesJava8;
/** /**
* Editor for {@code java.time.ZoneId}, translating zone ID Strings into {@code ZoneId} * Editor for {@code java.time.ZoneId}, translating zone ID Strings into {@code ZoneId}
* objects. Exposes the {@code TimeZone} ID as a text representation. * objects. Exposes the {@code TimeZone} ID as a text representation.
...@@ -28,6 +30,7 @@ import java.time.ZoneId; ...@@ -28,6 +30,7 @@ import java.time.ZoneId;
* @see java.time.ZoneId * @see java.time.ZoneId
* @see TimeZoneEditor * @see TimeZoneEditor
*/ */
@UsesJava8
public class ZoneIdEditor extends PropertyEditorSupport { public class ZoneIdEditor extends PropertyEditorSupport {
@Override @Override
......
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2014 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
......
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2014 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -24,6 +24,7 @@ import java.util.TimeZone; ...@@ -24,6 +24,7 @@ import java.util.TimeZone;
import org.springframework.context.i18n.LocaleContext; import org.springframework.context.i18n.LocaleContext;
import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.context.i18n.TimeZoneAwareLocaleContext; import org.springframework.context.i18n.TimeZoneAwareLocaleContext;
import org.springframework.core.UsesJava8;
/** /**
* A context that holds user-specific <code>java.time</code> (JSR-310) settings * A context that holds user-specific <code>java.time</code> (JSR-310) settings
...@@ -34,6 +35,7 @@ import org.springframework.context.i18n.TimeZoneAwareLocaleContext; ...@@ -34,6 +35,7 @@ import org.springframework.context.i18n.TimeZoneAwareLocaleContext;
* @since 4.0 * @since 4.0
* @see DateTimeContextHolder * @see DateTimeContextHolder
*/ */
@UsesJava8
public class DateTimeContext { public class DateTimeContext {
private Chronology chronology; private Chronology chronology;
......
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2014 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -19,6 +19,7 @@ package org.springframework.format.datetime.standard; ...@@ -19,6 +19,7 @@ package org.springframework.format.datetime.standard;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.Locale; import java.util.Locale;
import org.springframework.core.UsesJava8;
import org.springframework.core.NamedThreadLocal; import org.springframework.core.NamedThreadLocal;
/** /**
...@@ -27,6 +28,7 @@ import org.springframework.core.NamedThreadLocal; ...@@ -27,6 +28,7 @@ import org.springframework.core.NamedThreadLocal;
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 4.0 * @since 4.0
*/ */
@UsesJava8
public final class DateTimeContextHolder { public final class DateTimeContextHolder {
private static final ThreadLocal<DateTimeContext> dateTimeContextHolder = private static final ThreadLocal<DateTimeContext> dateTimeContextHolder =
......
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2014 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -26,6 +26,7 @@ import java.time.chrono.ChronoZonedDateTime; ...@@ -26,6 +26,7 @@ import java.time.chrono.ChronoZonedDateTime;
import java.util.Calendar; import java.util.Calendar;
import java.util.GregorianCalendar; import java.util.GregorianCalendar;
import org.springframework.core.UsesJava8;
import org.springframework.core.convert.converter.Converter; import org.springframework.core.convert.converter.Converter;
import org.springframework.core.convert.converter.ConverterRegistry; import org.springframework.core.convert.converter.ConverterRegistry;
import org.springframework.format.datetime.DateFormatterRegistrar; import org.springframework.format.datetime.DateFormatterRegistrar;
...@@ -42,6 +43,7 @@ import org.springframework.format.datetime.DateFormatterRegistrar; ...@@ -42,6 +43,7 @@ import org.springframework.format.datetime.DateFormatterRegistrar;
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 4.0.1 * @since 4.0.1
*/ */
@UsesJava8
final class DateTimeConverters { final class DateTimeConverters {
/** /**
...@@ -83,7 +85,7 @@ final class DateTimeConverters { ...@@ -83,7 +85,7 @@ final class DateTimeConverters {
} }
} }
@UsesJava8
private static class LocalDateTimeToLocalDateConverter implements Converter<LocalDateTime, LocalDate> { private static class LocalDateTimeToLocalDateConverter implements Converter<LocalDateTime, LocalDate> {
@Override @Override
...@@ -92,7 +94,7 @@ final class DateTimeConverters { ...@@ -92,7 +94,7 @@ final class DateTimeConverters {
} }
} }
@UsesJava8
private static class LocalDateTimeToLocalTimeConverter implements Converter<LocalDateTime, LocalTime> { private static class LocalDateTimeToLocalTimeConverter implements Converter<LocalDateTime, LocalTime> {
@Override @Override
...@@ -101,7 +103,7 @@ final class DateTimeConverters { ...@@ -101,7 +103,7 @@ final class DateTimeConverters {
} }
} }
@UsesJava8
private static class ZonedDateTimeToLocalDateConverter implements Converter<ZonedDateTime, LocalDate> { private static class ZonedDateTimeToLocalDateConverter implements Converter<ZonedDateTime, LocalDate> {
@Override @Override
...@@ -110,7 +112,7 @@ final class DateTimeConverters { ...@@ -110,7 +112,7 @@ final class DateTimeConverters {
} }
} }
@UsesJava8
private static class ZonedDateTimeToLocalTimeConverter implements Converter<ZonedDateTime, LocalTime> { private static class ZonedDateTimeToLocalTimeConverter implements Converter<ZonedDateTime, LocalTime> {
@Override @Override
...@@ -119,7 +121,7 @@ final class DateTimeConverters { ...@@ -119,7 +121,7 @@ final class DateTimeConverters {
} }
} }
@UsesJava8
private static class ZonedDateTimeToLocalDateTimeConverter implements Converter<ZonedDateTime, LocalDateTime> { private static class ZonedDateTimeToLocalDateTimeConverter implements Converter<ZonedDateTime, LocalDateTime> {
@Override @Override
...@@ -128,7 +130,7 @@ final class DateTimeConverters { ...@@ -128,7 +130,7 @@ final class DateTimeConverters {
} }
} }
@UsesJava8
private static class ZonedDateTimeToOffsetDateTimeConverter implements Converter<ZonedDateTime, OffsetDateTime> { private static class ZonedDateTimeToOffsetDateTimeConverter implements Converter<ZonedDateTime, OffsetDateTime> {
@Override @Override
...@@ -137,7 +139,7 @@ final class DateTimeConverters { ...@@ -137,7 +139,7 @@ final class DateTimeConverters {
} }
} }
@UsesJava8
private static class ZonedDateTimeToInstantConverter implements Converter<ZonedDateTime, Instant> { private static class ZonedDateTimeToInstantConverter implements Converter<ZonedDateTime, Instant> {
@Override @Override
...@@ -147,6 +149,7 @@ final class DateTimeConverters { ...@@ -147,6 +149,7 @@ final class DateTimeConverters {
} }
} }
@UsesJava8
private static class OffsetDateTimeToLocalDateConverter implements Converter<OffsetDateTime, LocalDate> { private static class OffsetDateTimeToLocalDateConverter implements Converter<OffsetDateTime, LocalDate> {
@Override @Override
...@@ -155,7 +158,7 @@ final class DateTimeConverters { ...@@ -155,7 +158,7 @@ final class DateTimeConverters {
} }
} }
@UsesJava8
private static class OffsetDateTimeToLocalTimeConverter implements Converter<OffsetDateTime, LocalTime> { private static class OffsetDateTimeToLocalTimeConverter implements Converter<OffsetDateTime, LocalTime> {
@Override @Override
...@@ -164,7 +167,7 @@ final class DateTimeConverters { ...@@ -164,7 +167,7 @@ final class DateTimeConverters {
} }
} }
@UsesJava8
private static class OffsetDateTimeToLocalDateTimeConverter implements Converter<OffsetDateTime, LocalDateTime> { private static class OffsetDateTimeToLocalDateTimeConverter implements Converter<OffsetDateTime, LocalDateTime> {
@Override @Override
...@@ -173,7 +176,7 @@ final class DateTimeConverters { ...@@ -173,7 +176,7 @@ final class DateTimeConverters {
} }
} }
@UsesJava8
private static class OffsetDateTimeToZonedDateTimeConverter implements Converter<OffsetDateTime, ZonedDateTime> { private static class OffsetDateTimeToZonedDateTimeConverter implements Converter<OffsetDateTime, ZonedDateTime> {
@Override @Override
...@@ -182,7 +185,7 @@ final class DateTimeConverters { ...@@ -182,7 +185,7 @@ final class DateTimeConverters {
} }
} }
@UsesJava8
private static class OffsetDateTimeToInstantConverter implements Converter<OffsetDateTime, Instant> { private static class OffsetDateTimeToInstantConverter implements Converter<OffsetDateTime, Instant> {
@Override @Override
...@@ -191,7 +194,7 @@ final class DateTimeConverters { ...@@ -191,7 +194,7 @@ final class DateTimeConverters {
} }
} }
@UsesJava8
private static class CalendarToZonedDateTimeConverter implements Converter<Calendar, ZonedDateTime> { private static class CalendarToZonedDateTimeConverter implements Converter<Calendar, ZonedDateTime> {
@Override @Override
...@@ -200,7 +203,7 @@ final class DateTimeConverters { ...@@ -200,7 +203,7 @@ final class DateTimeConverters {
} }
} }
@UsesJava8
private static class CalendarToOffsetDateTimeConverter implements Converter<Calendar, OffsetDateTime> { private static class CalendarToOffsetDateTimeConverter implements Converter<Calendar, OffsetDateTime> {
@Override @Override
...@@ -209,7 +212,7 @@ final class DateTimeConverters { ...@@ -209,7 +212,7 @@ final class DateTimeConverters {
} }
} }
@UsesJava8
private static class CalendarToLocalDateConverter implements Converter<Calendar, LocalDate> { private static class CalendarToLocalDateConverter implements Converter<Calendar, LocalDate> {
@Override @Override
...@@ -218,7 +221,7 @@ final class DateTimeConverters { ...@@ -218,7 +221,7 @@ final class DateTimeConverters {
} }
} }
@UsesJava8
private static class CalendarToLocalTimeConverter implements Converter<Calendar, LocalTime> { private static class CalendarToLocalTimeConverter implements Converter<Calendar, LocalTime> {
@Override @Override
...@@ -227,7 +230,7 @@ final class DateTimeConverters { ...@@ -227,7 +230,7 @@ final class DateTimeConverters {
} }
} }
@UsesJava8
private static class CalendarToLocalDateTimeConverter implements Converter<Calendar, LocalDateTime> { private static class CalendarToLocalDateTimeConverter implements Converter<Calendar, LocalDateTime> {
@Override @Override
...@@ -236,7 +239,7 @@ final class DateTimeConverters { ...@@ -236,7 +239,7 @@ final class DateTimeConverters {
} }
} }
@UsesJava8
private static class CalendarToInstantConverter implements Converter<Calendar, Instant> { private static class CalendarToInstantConverter implements Converter<Calendar, Instant> {
@Override @Override
...@@ -247,6 +250,7 @@ final class DateTimeConverters { ...@@ -247,6 +250,7 @@ final class DateTimeConverters {
} }
@UsesJava8
private static class LongToInstantConverter implements Converter<Long, Instant> { private static class LongToInstantConverter implements Converter<Long, Instant> {
@Override @Override
...@@ -256,6 +260,7 @@ final class DateTimeConverters { ...@@ -256,6 +260,7 @@ final class DateTimeConverters {
} }
@UsesJava8
private static class InstantToLongConverter implements Converter<Instant, Long> { private static class InstantToLongConverter implements Converter<Instant, Long> {
@Override @Override
......
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2014 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -20,6 +20,7 @@ import java.time.format.DateTimeFormatter; ...@@ -20,6 +20,7 @@ import java.time.format.DateTimeFormatter;
import java.time.format.FormatStyle; import java.time.format.FormatStyle;
import java.util.TimeZone; import java.util.TimeZone;
import org.springframework.core.UsesJava8;
import org.springframework.format.annotation.DateTimeFormat.ISO; import org.springframework.format.annotation.DateTimeFormat.ISO;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
...@@ -42,6 +43,7 @@ import org.springframework.util.StringUtils; ...@@ -42,6 +43,7 @@ import org.springframework.util.StringUtils;
* @see #setDateTimeStyle * @see #setDateTimeStyle
* @see DateTimeFormatterFactoryBean * @see DateTimeFormatterFactoryBean
*/ */
@UsesJava8
public class DateTimeFormatterFactory { public class DateTimeFormatterFactory {
private String pattern; private String pattern;
......
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2014 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -28,6 +28,7 @@ import java.time.format.FormatStyle; ...@@ -28,6 +28,7 @@ import java.time.format.FormatStyle;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import org.springframework.core.UsesJava8;
import org.springframework.format.FormatterRegistrar; import org.springframework.format.FormatterRegistrar;
import org.springframework.format.FormatterRegistry; import org.springframework.format.FormatterRegistry;
import org.springframework.format.annotation.DateTimeFormat.ISO; import org.springframework.format.annotation.DateTimeFormat.ISO;
...@@ -46,6 +47,7 @@ import org.springframework.format.annotation.DateTimeFormat.ISO; ...@@ -46,6 +47,7 @@ import org.springframework.format.annotation.DateTimeFormat.ISO;
* @see org.springframework.format.datetime.DateFormatterRegistrar * @see org.springframework.format.datetime.DateFormatterRegistrar
* @see org.springframework.format.datetime.joda.DateTimeFormatterFactoryBean * @see org.springframework.format.datetime.joda.DateTimeFormatterFactoryBean
*/ */
@UsesJava8
public class DateTimeFormatterRegistrar implements FormatterRegistrar { public class DateTimeFormatterRegistrar implements FormatterRegistrar {
private static enum Type {DATE, TIME, DATE_TIME} private static enum Type {DATE, TIME, DATE_TIME}
......
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2014 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -20,6 +20,7 @@ import java.text.ParseException; ...@@ -20,6 +20,7 @@ import java.text.ParseException;
import java.time.Instant; import java.time.Instant;
import java.util.Locale; import java.util.Locale;
import org.springframework.core.UsesJava8;
import org.springframework.format.Formatter; import org.springframework.format.Formatter;
/** /**
...@@ -31,6 +32,7 @@ import org.springframework.format.Formatter; ...@@ -31,6 +32,7 @@ import org.springframework.format.Formatter;
* @since 4.0 * @since 4.0
* @see java.time.Instant#parse * @see java.time.Instant#parse
*/ */
@UsesJava8
public class InstantFormatter implements Formatter<Instant> { public class InstantFormatter implements Formatter<Instant> {
@Override @Override
......
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2014 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -27,6 +27,7 @@ import java.time.format.DateTimeFormatter; ...@@ -27,6 +27,7 @@ import java.time.format.DateTimeFormatter;
import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalAccessor;
import java.util.Locale; import java.util.Locale;
import org.springframework.core.UsesJava8;
import org.springframework.format.Parser; import org.springframework.format.Parser;
/** /**
...@@ -43,6 +44,7 @@ import org.springframework.format.Parser; ...@@ -43,6 +44,7 @@ import org.springframework.format.Parser;
* @see java.time.OffsetDateTime#parse(CharSequence, java.time.format.DateTimeFormatter) * @see java.time.OffsetDateTime#parse(CharSequence, java.time.format.DateTimeFormatter)
* @see java.time.OffsetTime#parse(CharSequence, java.time.format.DateTimeFormatter) * @see java.time.OffsetTime#parse(CharSequence, java.time.format.DateTimeFormatter)
*/ */
@UsesJava8
public final class TemporalAccessorParser implements Parser<TemporalAccessor> { public final class TemporalAccessorParser implements Parser<TemporalAccessor> {
private final Class<? extends TemporalAccessor> temporalAccessorType; private final Class<? extends TemporalAccessor> temporalAccessorType;
......
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2014 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -20,6 +20,7 @@ import java.time.format.DateTimeFormatter; ...@@ -20,6 +20,7 @@ import java.time.format.DateTimeFormatter;
import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalAccessor;
import java.util.Locale; import java.util.Locale;
import org.springframework.core.UsesJava8;
import org.springframework.format.Printer; import org.springframework.format.Printer;
/** /**
...@@ -31,6 +32,7 @@ import org.springframework.format.Printer; ...@@ -31,6 +32,7 @@ import org.springframework.format.Printer;
* @see DateTimeContextHolder#getFormatter * @see DateTimeContextHolder#getFormatter
* @see java.time.format.DateTimeFormatter#format(java.time.temporal.TemporalAccessor) * @see java.time.format.DateTimeFormatter#format(java.time.temporal.TemporalAccessor)
*/ */
@UsesJava8
public final class TemporalAccessorPrinter implements Printer<TemporalAccessor> { public final class TemporalAccessorPrinter implements Printer<TemporalAccessor> {
private final DateTimeFormatter formatter; private final DateTimeFormatter formatter;
......
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2014 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -33,6 +33,7 @@ import org.apache.commons.logging.LogFactory; ...@@ -33,6 +33,7 @@ import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.DisposableBean; import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.FactoryBean; import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.InitializingBean;
import org.springframework.core.UsesSunHttpServer;
/** /**
* {@link org.springframework.beans.factory.FactoryBean} that creates a simple * {@link org.springframework.beans.factory.FactoryBean} that creates a simple
...@@ -51,6 +52,7 @@ import org.springframework.beans.factory.InitializingBean; ...@@ -51,6 +52,7 @@ import org.springframework.beans.factory.InitializingBean;
* @see #setPort * @see #setPort
* @see #setContexts * @see #setContexts
*/ */
@UsesSunHttpServer
public class SimpleHttpServerFactoryBean implements FactoryBean<HttpServer>, InitializingBean, DisposableBean { public class SimpleHttpServerFactoryBean implements FactoryBean<HttpServer>, InitializingBean, DisposableBean {
protected final Log logger = LogFactory.getLog(getClass()); protected final Log logger = LogFactory.getLog(getClass());
......
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2014 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -22,6 +22,7 @@ import java.util.concurrent.TimeUnit; ...@@ -22,6 +22,7 @@ import java.util.concurrent.TimeUnit;
import org.springframework.beans.factory.DisposableBean; import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.FactoryBean; import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.InitializingBean;
import org.springframework.core.UsesJava7;
/** /**
* A Spring {@link FactoryBean} that builds and exposes a preconfigured {@link ForkJoinPool}. * A Spring {@link FactoryBean} that builds and exposes a preconfigured {@link ForkJoinPool}.
...@@ -37,6 +38,7 @@ import org.springframework.beans.factory.InitializingBean; ...@@ -37,6 +38,7 @@ import org.springframework.beans.factory.InitializingBean;
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 3.1 * @since 3.1
*/ */
@UsesJava7
public class ForkJoinPoolFactoryBean implements FactoryBean<ForkJoinPool>, InitializingBean, DisposableBean { public class ForkJoinPoolFactoryBean implements FactoryBean<ForkJoinPool>, InitializingBean, DisposableBean {
private boolean commonPool = false; private boolean commonPool = false;
......
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2014 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -28,6 +28,7 @@ import java.lang.reflect.Parameter; ...@@ -28,6 +28,7 @@ import java.lang.reflect.Parameter;
* @since 4.0 * @since 4.0
* @see java.lang.reflect.Parameter#getName() * @see java.lang.reflect.Parameter#getName()
*/ */
@UsesJava8
public class StandardReflectionParameterNameDiscoverer implements ParameterNameDiscoverer { public class StandardReflectionParameterNameDiscoverer implements ParameterNameDiscoverer {
@Override @Override
......
/*
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.core;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
* Indicate that the annotated element uses Java7 specific constructs
* and therefore requires a Java7 environment.
*
* @author Stephane Nicoll
*/
@Retention(java.lang.annotation.RetentionPolicy.CLASS)
@Documented
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.TYPE})
public @interface UsesJava7 {
}
/*
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.core;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
* Indicate that the annotated element uses Java8 specific constructs
* and therefore requires a Java8 environment.
*
* @author Stephane Nicoll
* @since 4.1
*/
@Retention(java.lang.annotation.RetentionPolicy.CLASS)
@Documented
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.TYPE})
public @interface UsesJava8 {
}
/*
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.core;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
* Indicate that the annotated element uses the Http Server available in
* {@code com.sun.*} classes, which is only available on a Sun/Oracle JVM.
*
* @author Stephane Nicoll
* @since 4.1
*/
@Retention(java.lang.annotation.RetentionPolicy.CLASS)
@Documented
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.TYPE})
public @interface UsesSunHttpServer {
}
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2014 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -19,6 +19,7 @@ package org.springframework.core.convert.support; ...@@ -19,6 +19,7 @@ package org.springframework.core.convert.support;
import java.time.ZoneId; import java.time.ZoneId;
import java.util.TimeZone; import java.util.TimeZone;
import org.springframework.core.UsesJava8;
import org.springframework.core.convert.converter.Converter; import org.springframework.core.convert.converter.Converter;
/** /**
...@@ -34,6 +35,7 @@ import org.springframework.core.convert.converter.Converter; ...@@ -34,6 +35,7 @@ import org.springframework.core.convert.converter.Converter;
* @since 4.0 * @since 4.0
* @see TimeZone#getTimeZone(java.time.ZoneId) * @see TimeZone#getTimeZone(java.time.ZoneId)
*/ */
@UsesJava8
final class ZoneIdToTimeZoneConverter implements Converter<ZoneId, TimeZone> { final class ZoneIdToTimeZoneConverter implements Converter<ZoneId, TimeZone> {
@Override @Override
......
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2014 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -20,6 +20,7 @@ import java.time.ZonedDateTime; ...@@ -20,6 +20,7 @@ import java.time.ZonedDateTime;
import java.util.Calendar; import java.util.Calendar;
import java.util.GregorianCalendar; import java.util.GregorianCalendar;
import org.springframework.core.UsesJava8;
import org.springframework.core.convert.converter.Converter; import org.springframework.core.convert.converter.Converter;
/** /**
...@@ -35,6 +36,7 @@ import org.springframework.core.convert.converter.Converter; ...@@ -35,6 +36,7 @@ import org.springframework.core.convert.converter.Converter;
* @since 4.0.1 * @since 4.0.1
* @see java.util.GregorianCalendar#from(java.time.ZonedDateTime) * @see java.util.GregorianCalendar#from(java.time.ZonedDateTime)
*/ */
@UsesJava8
final class ZonedDateTimeToCalendarConverter implements Converter<ZonedDateTime, Calendar> { final class ZonedDateTimeToCalendarConverter implements Converter<ZonedDateTime, Calendar> {
@Override @Override
......
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2014 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -28,6 +28,7 @@ import java.nio.file.OpenOption; ...@@ -28,6 +28,7 @@ import java.nio.file.OpenOption;
import java.nio.file.Path; import java.nio.file.Path;
import java.nio.file.Paths; import java.nio.file.Paths;
import org.springframework.core.UsesJava8;
import org.springframework.util.Assert; import org.springframework.util.Assert;
/** /**
...@@ -39,6 +40,7 @@ import org.springframework.util.Assert; ...@@ -39,6 +40,7 @@ import org.springframework.util.Assert;
* @since 4.0 * @since 4.0
* @see java.nio.file.Path * @see java.nio.file.Path
*/ */
@UsesJava8
public class PathResource extends AbstractResource implements WritableResource { public class PathResource extends AbstractResource implements WritableResource {
private final Path path; private final Path path;
......
...@@ -22,6 +22,7 @@ import javax.sql.rowset.CachedRowSet; ...@@ -22,6 +22,7 @@ import javax.sql.rowset.CachedRowSet;
import javax.sql.rowset.RowSetFactory; import javax.sql.rowset.RowSetFactory;
import javax.sql.rowset.RowSetProvider; import javax.sql.rowset.RowSetProvider;
import org.springframework.core.UsesJava7;
import org.springframework.core.JdkVersion; import org.springframework.core.JdkVersion;
import org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet; import org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet;
import org.springframework.jdbc.support.rowset.SqlRowSet; import org.springframework.jdbc.support.rowset.SqlRowSet;
...@@ -109,6 +110,7 @@ public class SqlRowSetResultSetExtractor implements ResultSetExtractor<SqlRowSet ...@@ -109,6 +110,7 @@ public class SqlRowSetResultSetExtractor implements ResultSetExtractor<SqlRowSet
/** /**
* Inner class to avoid a hard dependency on JDBC 4.1 RowSetProvider class. * Inner class to avoid a hard dependency on JDBC 4.1 RowSetProvider class.
*/ */
@UsesJava7
private static class StandardCachedRowSetFactory implements CachedRowSetFactory { private static class StandardCachedRowSetFactory implements CachedRowSetFactory {
private final RowSetFactory rowSetFactory; private final RowSetFactory rowSetFactory;
......
...@@ -34,6 +34,7 @@ import javax.sql.DataSource; ...@@ -34,6 +34,7 @@ import javax.sql.DataSource;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.springframework.core.UsesJava7;
import org.springframework.jdbc.CannotGetJdbcConnectionException; import org.springframework.jdbc.CannotGetJdbcConnectionException;
import org.springframework.jdbc.datasource.DataSourceUtils; import org.springframework.jdbc.datasource.DataSourceUtils;
import org.springframework.util.ClassUtils; import org.springframework.util.ClassUtils;
...@@ -134,6 +135,7 @@ public abstract class JdbcUtils { ...@@ -134,6 +135,7 @@ public abstract class JdbcUtils {
* @return the value object * @return the value object
* @throws SQLException if thrown by the JDBC API * @throws SQLException if thrown by the JDBC API
*/ */
@UsesJava7 // guard use of JDBC 4.1 (safe with 1.6)
public static Object getResultSetValue(ResultSet rs, int index, Class<?> requiredType) throws SQLException { public static Object getResultSetValue(ResultSet rs, int index, Class<?> requiredType) throws SQLException {
if (requiredType == null) { if (requiredType == null) {
return getResultSetValue(rs, index); return getResultSetValue(rs, index);
......
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2014 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -22,6 +22,7 @@ import java.io.IOException; ...@@ -22,6 +22,7 @@ import java.io.IOException;
import com.sun.net.httpserver.HttpExchange; import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler; import com.sun.net.httpserver.HttpHandler;
import org.springframework.core.UsesSunHttpServer;
import org.springframework.util.FileCopyUtils; import org.springframework.util.FileCopyUtils;
/** /**
...@@ -48,6 +49,7 @@ import org.springframework.util.FileCopyUtils; ...@@ -48,6 +49,7 @@ import org.springframework.util.FileCopyUtils;
* and is effectively retired (in contrast to its sibling Hessian) * and is effectively retired (in contrast to its sibling Hessian)
*/ */
@Deprecated @Deprecated
@UsesSunHttpServer
public class SimpleBurlapServiceExporter extends BurlapExporter implements HttpHandler { public class SimpleBurlapServiceExporter extends BurlapExporter implements HttpHandler {
/** /**
......
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2014 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -22,6 +22,7 @@ import java.io.IOException; ...@@ -22,6 +22,7 @@ import java.io.IOException;
import com.sun.net.httpserver.HttpExchange; import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler; import com.sun.net.httpserver.HttpHandler;
import org.springframework.core.UsesSunHttpServer;
import org.springframework.util.FileCopyUtils; import org.springframework.util.FileCopyUtils;
/** /**
...@@ -44,6 +45,7 @@ import org.springframework.util.FileCopyUtils; ...@@ -44,6 +45,7 @@ import org.springframework.util.FileCopyUtils;
* @see org.springframework.remoting.caucho.HessianProxyFactoryBean * @see org.springframework.remoting.caucho.HessianProxyFactoryBean
* @see org.springframework.remoting.httpinvoker.SimpleHttpInvokerServiceExporter * @see org.springframework.remoting.httpinvoker.SimpleHttpInvokerServiceExporter
*/ */
@UsesSunHttpServer
public class SimpleHessianServiceExporter extends HessianExporter implements HttpHandler { public class SimpleHessianServiceExporter extends HessianExporter implements HttpHandler {
/** /**
......
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2014 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -25,6 +25,7 @@ import java.io.OutputStream; ...@@ -25,6 +25,7 @@ import java.io.OutputStream;
import com.sun.net.httpserver.HttpExchange; import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler; import com.sun.net.httpserver.HttpHandler;
import org.springframework.core.UsesSunHttpServer;
import org.springframework.remoting.rmi.RemoteInvocationSerializingExporter; import org.springframework.remoting.rmi.RemoteInvocationSerializingExporter;
import org.springframework.remoting.support.RemoteInvocation; import org.springframework.remoting.support.RemoteInvocation;
import org.springframework.remoting.support.RemoteInvocationResult; import org.springframework.remoting.support.RemoteInvocationResult;
...@@ -51,6 +52,7 @@ import org.springframework.remoting.support.RemoteInvocationResult; ...@@ -51,6 +52,7 @@ import org.springframework.remoting.support.RemoteInvocationResult;
* @see org.springframework.remoting.caucho.SimpleHessianServiceExporter * @see org.springframework.remoting.caucho.SimpleHessianServiceExporter
* @see org.springframework.remoting.caucho.SimpleBurlapServiceExporter * @see org.springframework.remoting.caucho.SimpleBurlapServiceExporter
*/ */
@UsesSunHttpServer
public class SimpleHttpInvokerServiceExporter extends RemoteInvocationSerializingExporter public class SimpleHttpInvokerServiceExporter extends RemoteInvocationSerializingExporter
implements HttpHandler { implements HttpHandler {
......
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2014 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -34,6 +34,7 @@ import org.springframework.beans.factory.DisposableBean; ...@@ -34,6 +34,7 @@ import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.ListableBeanFactory; import org.springframework.beans.factory.ListableBeanFactory;
import org.springframework.beans.factory.config.ConfigurableBeanFactory; import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.core.UsesJava7;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import org.springframework.util.ClassUtils; import org.springframework.util.ClassUtils;
...@@ -189,6 +190,7 @@ public abstract class AbstractJaxWsServiceExporter implements BeanFactoryAware, ...@@ -189,6 +190,7 @@ public abstract class AbstractJaxWsServiceExporter implements BeanFactoryAware,
* @see Endpoint#create(Object) * @see Endpoint#create(Object)
* @see Endpoint#create(String, Object) * @see Endpoint#create(String, Object)
*/ */
@UsesJava7 // Endpoint#create with WebServiceFeature[]
protected Endpoint createEndpoint(Object bean) { protected Endpoint createEndpoint(Object bean) {
if (this.endpointFeatures != null || this.webServiceFeatures != null) { if (this.endpointFeatures != null || this.webServiceFeatures != null) {
WebServiceFeature[] endpointFeaturesToUse = this.endpointFeatures; WebServiceFeature[] endpointFeaturesToUse = this.endpointFeatures;
......
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2014 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -24,6 +24,7 @@ import javax.xml.ws.Service; ...@@ -24,6 +24,7 @@ import javax.xml.ws.Service;
import javax.xml.ws.WebServiceFeature; import javax.xml.ws.WebServiceFeature;
import javax.xml.ws.handler.HandlerResolver; import javax.xml.ws.handler.HandlerResolver;
import org.springframework.core.UsesJava7;
import org.springframework.core.io.Resource; import org.springframework.core.io.Resource;
import org.springframework.util.Assert; import org.springframework.util.Assert;
...@@ -146,6 +147,7 @@ public class LocalJaxWsServiceFactory { ...@@ -146,6 +147,7 @@ public class LocalJaxWsServiceFactory {
* @see #setServiceName * @see #setServiceName
* @see #setWsdlDocumentUrl * @see #setWsdlDocumentUrl
*/ */
@UsesJava7 // Service#create with WebServiceFeature[]
public Service createJaxWsService() { public Service createJaxWsService() {
Assert.notNull(this.serviceName, "No service name specified"); Assert.notNull(this.serviceName, "No service name specified");
Service service; Service service;
......
/* /*
* Copyright 2002-2009 the original author or authors. * Copyright 2002-2014 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -28,6 +28,7 @@ import com.sun.net.httpserver.HttpContext; ...@@ -28,6 +28,7 @@ import com.sun.net.httpserver.HttpContext;
import com.sun.net.httpserver.HttpServer; import com.sun.net.httpserver.HttpServer;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.springframework.core.UsesSunHttpServer;
/** /**
* Simple exporter for JAX-WS services, autodetecting annotated service beans * Simple exporter for JAX-WS services, autodetecting annotated service beans
...@@ -46,6 +47,7 @@ import org.apache.commons.logging.LogFactory; ...@@ -46,6 +47,7 @@ import org.apache.commons.logging.LogFactory;
* @see javax.xml.ws.Endpoint#publish(Object) * @see javax.xml.ws.Endpoint#publish(Object)
* @see SimpleJaxWsServiceExporter * @see SimpleJaxWsServiceExporter
*/ */
@UsesSunHttpServer
public class SimpleHttpServerJaxWsServiceExporter extends AbstractJaxWsServiceExporter { public class SimpleHttpServerJaxWsServiceExporter extends AbstractJaxWsServiceExporter {
protected final Log logger = LogFactory.getLog(getClass()); protected final Log logger = LogFactory.getLog(getClass());
......
...@@ -27,6 +27,7 @@ import javax.servlet.ServletRequest; ...@@ -27,6 +27,7 @@ import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
import org.springframework.core.UsesJava8;
import org.springframework.core.MethodParameter; import org.springframework.core.MethodParameter;
import org.springframework.http.HttpMethod; import org.springframework.http.HttpMethod;
import org.springframework.web.bind.support.WebDataBinderFactory; import org.springframework.web.bind.support.WebDataBinderFactory;
...@@ -133,6 +134,7 @@ public class ServletRequestMethodArgumentResolver implements HandlerMethodArgume ...@@ -133,6 +134,7 @@ public class ServletRequestMethodArgumentResolver implements HandlerMethodArgume
/** /**
* Inner class to avoid a hard-coded dependency on Java 8's {@link java.time.ZoneId}. * Inner class to avoid a hard-coded dependency on Java 8's {@link java.time.ZoneId}.
*/ */
@UsesJava8
private static class ZoneIdResolver { private static class ZoneIdResolver {
public static Object resolveZoneId(HttpServletRequest request) { public static Object resolveZoneId(HttpServletRequest request) {
......
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2014 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -33,6 +33,7 @@ import javax.websocket.Extension; ...@@ -33,6 +33,7 @@ import javax.websocket.Extension;
import javax.websocket.HandshakeResponse; import javax.websocket.HandshakeResponse;
import javax.websocket.WebSocketContainer; import javax.websocket.WebSocketContainer;
import org.springframework.core.UsesJava7;
import org.springframework.core.task.AsyncListenableTaskExecutor; import org.springframework.core.task.AsyncListenableTaskExecutor;
import org.springframework.core.task.TaskExecutor; import org.springframework.core.task.TaskExecutor;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
...@@ -145,6 +146,7 @@ public class StandardWebSocketClient extends AbstractWebSocketClient { ...@@ -145,6 +146,7 @@ public class StandardWebSocketClient extends AbstractWebSocketClient {
return result; return result;
} }
@UsesJava7
private InetAddress getLocalHost() { private InetAddress getLocalHost() {
try { try {
return InetAddress.getLocalHost(); return InetAddress.getLocalHost();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册