Browse Source
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 polishingpull/535/head
30 changed files with 247 additions and 40 deletions
@ -0,0 +1,35 @@
@@ -0,0 +1,35 @@
|
||||
/* |
||||
* 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 { |
||||
|
||||
} |
||||
@ -0,0 +1,36 @@
@@ -0,0 +1,36 @@
|
||||
/* |
||||
* 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 { |
||||
|
||||
} |
||||
@ -0,0 +1,36 @@
@@ -0,0 +1,36 @@
|
||||
/* |
||||
* 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 { |
||||
|
||||
} |
||||
Loading…
Reference in new issue