Skip to content

Instantly share code, notes, and snippets.

@snicoll
Created January 16, 2014 16:44
Show Gist options
  • Save snicoll/8458387 to your computer and use it in GitHub Desktop.
Save snicoll/8458387 to your computer and use it in GitHub Desktop.
diff --git a/build.gradle b/build.gradle
index 2481d75..9091eef 100644
--- a/build.gradle
+++ b/build.gradle
@@ -37,6 +37,11 @@ configure(allprojects) { project ->
targetCompatibility=1.7
}
+ configurations {
+ animalSniffer
+ javaApiSignature
+ }
+
[compileJava, compileTestJava]*.options*.compilerArgs = [
"-Xlint:serial",
"-Xlint:varargs",
@@ -70,14 +75,45 @@ configure(allprojects) { project ->
repositories {
maven { url "http://repo.springsource.org/libs-release" }
+ mavenCentral()
+ mavenLocal()
}
dependencies {
testCompile("junit:junit:${junitVersion}")
testCompile("org.hamcrest:hamcrest-all:1.3")
testCompile("org.mockito:mockito-core:1.9.5")
+ optional("org.codehaus.mojo:animal-sniffer-annotations:1.10-SNAPSHOT")
+
+ animalSniffer("org.codehaus.mojo:animal-sniffer-ant-tasks:1.10-SNAPSHOT")
+ javaApiSignature("org.codehaus.mojo.signature:java15:1.0@signature")
}
+ // copy the resolved Animal Sniffer signature dependency artifact to a known location and name
+ task copyJavaApiSignature(type: Copy) {
+ from configurations.javaApiSignature
+ into "$buildDir/javaApiSignature/"
+ rename '.*signature', 'javaApi.signature'
+ }
+
+ // prepare the Animal Sniffer signature copy every time (before) we compile
+ compileJava.dependsOn copyJavaApiSignature
+
+ // and then after compilation, run the Animal Sniffer tool
+ compileJava.doLast {
+ ant.taskdef(
+ name: 'animalSniffer',
+ classname: 'org.codehaus.mojo.animal_sniffer.ant.CheckSignatureTask',
+ classpath: configurations.animalSniffer.asPath
+ )
+
+ ant.animalSniffer(
+ signature: "$buildDir/javaApiSignature/javaApi.signature",
+ classpath: sourceSets.main.compileClasspath.asPath) {
+ path( path: sourceSets.main.output.classesDir )
+ }
+ }
+
ext.javadocLinks = [
"http://docs.oracle.com/javase/7/docs/api/",
"http://docs.oracle.com/javaee/6/api/",
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/serviceloader/AbstractServiceLoaderBasedFactoryBean.java b/spring-beans/src/main/java/org/springframework/beans/factory/serviceloader/AbstractServiceLoaderBasedFactoryBean.java
index 27e72ce..89675ca 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/serviceloader/AbstractServiceLoaderBasedFactoryBean.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/serviceloader/AbstractServiceLoaderBasedFactoryBean.java
@@ -18,6 +18,7 @@ package org.springframework.beans.factory.serviceloader;
import java.util.ServiceLoader;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
import org.springframework.beans.factory.BeanClassLoaderAware;
import org.springframework.beans.factory.config.AbstractFactoryBean;
import org.springframework.util.Assert;
@@ -31,6 +32,7 @@ import org.springframework.util.ClassUtils;
* @since 2.5
* @see java.util.ServiceLoader
*/
+@IgnoreJRERequirement // Java6 only
public abstract class AbstractServiceLoaderBasedFactoryBean extends AbstractFactoryBean
implements BeanClassLoaderAware {
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/serviceloader/ServiceFactoryBean.java b/spring-beans/src/main/java/org/springframework/beans/factory/serviceloader/ServiceFactoryBean.java
index 5abbda9..9a0b824 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/serviceloader/ServiceFactoryBean.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/serviceloader/ServiceFactoryBean.java
@@ -19,6 +19,7 @@ package org.springframework.beans.factory.serviceloader;
import java.util.Iterator;
import java.util.ServiceLoader;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
import org.springframework.beans.factory.BeanClassLoaderAware;
/**
@@ -30,6 +31,7 @@ import org.springframework.beans.factory.BeanClassLoaderAware;
* @since 2.5
* @see java.util.ServiceLoader
*/
+@IgnoreJRERequirement // Java6 only
public class ServiceFactoryBean extends AbstractServiceLoaderBasedFactoryBean implements BeanClassLoaderAware {
@Override
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/serviceloader/ServiceListFactoryBean.java b/spring-beans/src/main/java/org/springframework/beans/factory/serviceloader/ServiceListFactoryBean.java
index b23cd70..122a5d6 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/serviceloader/ServiceListFactoryBean.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/serviceloader/ServiceListFactoryBean.java
@@ -20,6 +20,7 @@ import java.util.LinkedList;
import java.util.List;
import java.util.ServiceLoader;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
import org.springframework.beans.factory.BeanClassLoaderAware;
/**
@@ -31,6 +32,7 @@ import org.springframework.beans.factory.BeanClassLoaderAware;
* @since 2.5
* @see java.util.ServiceLoader
*/
+@IgnoreJRERequirement // Java6 only
public class ServiceListFactoryBean extends AbstractServiceLoaderBasedFactoryBean implements BeanClassLoaderAware {
@Override
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/serviceloader/ServiceLoaderFactoryBean.java b/spring-beans/src/main/java/org/springframework/beans/factory/serviceloader/ServiceLoaderFactoryBean.java
index 34f3a1c..d2bd891 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/serviceloader/ServiceLoaderFactoryBean.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/serviceloader/ServiceLoaderFactoryBean.java
@@ -18,6 +18,7 @@ package org.springframework.beans.factory.serviceloader;
import java.util.ServiceLoader;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
import org.springframework.beans.factory.BeanClassLoaderAware;
/**
@@ -28,6 +29,7 @@ import org.springframework.beans.factory.BeanClassLoaderAware;
* @since 2.5
* @see java.util.ServiceLoader
*/
+@IgnoreJRERequirement // Java6 only
public class ServiceLoaderFactoryBean extends AbstractServiceLoaderBasedFactoryBean implements BeanClassLoaderAware {
@Override
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/ConstructorResolver.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/ConstructorResolver.java
index f290d51..4e39a8a 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/ConstructorResolver.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/ConstructorResolver.java
@@ -32,6 +32,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
import org.springframework.beans.BeanMetadataElement;
import org.springframework.beans.BeanWrapper;
import org.springframework.beans.BeanWrapperImpl;
@@ -879,6 +880,7 @@ class ConstructorResolver {
/**
* Inner class to avoid a Java 6 dependency.
*/
+ @IgnoreJRERequirement
private static class ConstructorPropertiesChecker {
public static String[] evaluateAnnotation(Constructor<?> candidate, int paramCount) {
diff --git a/spring-context/src/main/java/org/springframework/context/annotation/CommonAnnotationBeanPostProcessor.java b/spring-context/src/main/java/org/springframework/context/annotation/CommonAnnotationBeanPostProcessor.java
index 7d5fdcd..b8fc78e 100644
--- a/spring-context/src/main/java/org/springframework/context/annotation/CommonAnnotationBeanPostProcessor.java
+++ b/spring-context/src/main/java/org/springframework/context/annotation/CommonAnnotationBeanPostProcessor.java
@@ -44,6 +44,7 @@ import javax.xml.ws.Service;
import javax.xml.ws.WebServiceClient;
import javax.xml.ws.WebServiceRef;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.BeansException;
import org.springframework.beans.PropertyValues;
@@ -508,6 +509,7 @@ public class CommonAnnotationBeanPostProcessor extends InitDestroyAnnotationBean
* Class representing injection information about an annotated field
* or setter method, supporting the @Resource annotation.
*/
+ @IgnoreJRERequirement // Java6 only
private class ResourceElement extends LookupElement {
protected final boolean shareable;
@@ -552,6 +554,7 @@ public class CommonAnnotationBeanPostProcessor extends InitDestroyAnnotationBean
* Class representing injection information about an annotated field
* or setter method, supporting the @WebServiceRef annotation.
*/
+ @IgnoreJRERequirement // Java6 only
private class WebServiceRefElement extends LookupElement {
private final Class<?> elementType;
diff --git a/spring-context/src/main/java/org/springframework/context/support/ResourceBundleMessageSource.java b/spring-context/src/main/java/org/springframework/context/support/ResourceBundleMessageSource.java
index 8d71198..c0906c8 100644
--- a/spring-context/src/main/java/org/springframework/context/support/ResourceBundleMessageSource.java
+++ b/spring-context/src/main/java/org/springframework/context/support/ResourceBundleMessageSource.java
@@ -32,6 +32,7 @@ import java.util.MissingResourceException;
import java.util.PropertyResourceBundle;
import java.util.ResourceBundle;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
import org.springframework.beans.factory.BeanClassLoaderAware;
import org.springframework.core.JdkVersion;
import org.springframework.util.Assert;
@@ -404,6 +405,7 @@ public class ResourceBundleMessageSource extends AbstractMessageSource implement
* @see ResourceBundle#getBundle(String, java.util.Locale, ClassLoader, java.util.ResourceBundle.Control)
* @see MessageSourceControl
*/
+ @IgnoreJRERequirement
private class ControlBasedResourceBundleFactory {
public ResourceBundle getBundle(String basename, Locale locale) {
@@ -417,6 +419,7 @@ public class ResourceBundleMessageSource extends AbstractMessageSource implement
* adding support for custom file encodings, deactivating the fallback to the
* system locale and activating ResourceBundle's native cache, if desired.
*/
+ @IgnoreJRERequirement
private class MessageSourceControl extends ResourceBundle.Control {
@Override
diff --git a/spring-context/src/main/java/org/springframework/format/number/CurrencyFormatter.java b/spring-context/src/main/java/org/springframework/format/number/CurrencyFormatter.java
index c540d74..6169860 100644
--- a/spring-context/src/main/java/org/springframework/format/number/CurrencyFormatter.java
+++ b/spring-context/src/main/java/org/springframework/format/number/CurrencyFormatter.java
@@ -24,6 +24,7 @@ import java.text.ParseException;
import java.util.Currency;
import java.util.Locale;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
import org.springframework.util.ClassUtils;
/**
@@ -88,6 +89,7 @@ public class CurrencyFormatter extends AbstractNumberFormatter {
return decimal;
}
+ @IgnoreJRERequirement // roundingMode is Java6 only
protected NumberFormat getNumberFormat(Locale locale) {
DecimalFormat format = (DecimalFormat) NumberFormat.getCurrencyInstance(locale);
format.setParseBigDecimal(true);
diff --git a/spring-context/src/main/java/org/springframework/jmx/access/MBeanClientInterceptor.java b/spring-context/src/main/java/org/springframework/jmx/access/MBeanClientInterceptor.java
index 3689453..5ce0ba1 100644
--- a/spring-context/src/main/java/org/springframework/jmx/access/MBeanClientInterceptor.java
+++ b/spring-context/src/main/java/org/springframework/jmx/access/MBeanClientInterceptor.java
@@ -52,6 +52,7 @@ import org.aopalliance.intercept.MethodInvocation;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.BeanClassLoaderAware;
import org.springframework.beans.factory.DisposableBean;
@@ -250,6 +251,7 @@ public class MBeanClientInterceptor
* Ensures that an {@code MBeanServerConnection} is configured and attempts
* to detect a local connection if one is not supplied.
*/
+ @IgnoreJRERequirement // checked by JmxUtils.isMXBeanSupportAvailable()
public void prepare() {
synchronized (this.preparationMonitor) {
if (this.server != null) {
diff --git a/spring-context/src/main/java/org/springframework/jmx/support/JmxUtils.java b/spring-context/src/main/java/org/springframework/jmx/support/JmxUtils.java
index 1308f35..f27d727 100644
--- a/spring-context/src/main/java/org/springframework/jmx/support/JmxUtils.java
+++ b/spring-context/src/main/java/org/springframework/jmx/support/JmxUtils.java
@@ -32,6 +32,7 @@ import javax.management.ObjectName;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
import org.springframework.jmx.MBeanServerNotFoundException;
import org.springframework.util.ClassUtils;
import org.springframework.util.ObjectUtils;
@@ -331,6 +332,7 @@ public abstract class JmxUtils {
/**
* Inner class to avoid a Java 6 dependency.
*/
+ @IgnoreJRERequirement
private static class MXBeanChecker {
public static Boolean evaluateMXBeanAnnotation(Class<?> iface) {
diff --git a/spring-context/src/main/java/org/springframework/remoting/support/SimpleHttpServerFactoryBean.java b/spring-context/src/main/java/org/springframework/remoting/support/SimpleHttpServerFactoryBean.java
index 192d5e3..544f010 100644
--- a/spring-context/src/main/java/org/springframework/remoting/support/SimpleHttpServerFactoryBean.java
+++ b/spring-context/src/main/java/org/springframework/remoting/support/SimpleHttpServerFactoryBean.java
@@ -30,6 +30,7 @@ import com.sun.net.httpserver.HttpServer;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.InitializingBean;
@@ -51,6 +52,7 @@ import org.springframework.beans.factory.InitializingBean;
* @see #setPort
* @see #setContexts
*/
+@IgnoreJRERequirement // Sun's HTTP server
public class SimpleHttpServerFactoryBean implements FactoryBean<HttpServer>, InitializingBean, DisposableBean {
protected final Log logger = LogFactory.getLog(getClass());
diff --git a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ForkJoinPoolFactoryBean.java b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ForkJoinPoolFactoryBean.java
index fe30fd1..d7009d1 100644
--- a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ForkJoinPoolFactoryBean.java
+++ b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ForkJoinPoolFactoryBean.java
@@ -18,6 +18,7 @@ package org.springframework.scheduling.concurrent;
import java.util.concurrent.ForkJoinPool;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.InitializingBean;
@@ -36,6 +37,7 @@ import org.springframework.beans.factory.InitializingBean;
* @author Juergen Hoeller
* @since 3.1
*/
+@IgnoreJRERequirement
public class ForkJoinPoolFactoryBean implements FactoryBean<ForkJoinPool>, InitializingBean, DisposableBean {
private int parallelism = Runtime.getRuntime().availableProcessors();
diff --git a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolExecutorFactoryBean.java b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolExecutorFactoryBean.java
index 3f912aa..8d67fd0 100644
--- a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolExecutorFactoryBean.java
+++ b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolExecutorFactoryBean.java
@@ -26,6 +26,7 @@ import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.InitializingBean;
@@ -130,6 +131,7 @@ public class ThreadPoolExecutorFactoryBean extends ExecutorConfigurationSupport
}
+ @IgnoreJRERequirement // allowCoreThreadTimeout is Java6 only
protected ExecutorService initializeExecutor(
ThreadFactory threadFactory, RejectedExecutionHandler rejectedExecutionHandler) {
diff --git a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolTaskExecutor.java b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolTaskExecutor.java
index 31dc69d..2f87d53 100644
--- a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolTaskExecutor.java
+++ b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolTaskExecutor.java
@@ -29,6 +29,7 @@ import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
import org.springframework.core.task.TaskRejectedException;
import org.springframework.scheduling.SchedulingTaskExecutor;
import org.springframework.util.Assert;
@@ -176,6 +177,7 @@ public class ThreadPoolTaskExecutor extends ExecutorConfigurationSupport impleme
}
+ @IgnoreJRERequirement // allowCoreThreadTimeout is Java6 only
protected ExecutorService initializeExecutor(
ThreadFactory threadFactory, RejectedExecutionHandler rejectedExecutionHandler) {
diff --git a/spring-core/src/main/java/org/springframework/core/env/SimpleCommandLineArgsParser.java b/spring-core/src/main/java/org/springframework/core/env/SimpleCommandLineArgsParser.java
index b7ad3c4..5f49ef8 100644
--- a/spring-core/src/main/java/org/springframework/core/env/SimpleCommandLineArgsParser.java
+++ b/spring-core/src/main/java/org/springframework/core/env/SimpleCommandLineArgsParser.java
@@ -16,6 +16,8 @@
package org.springframework.core.env;
+import org.springframework.util.StringUtils;
+
/**
* Parses a {@code String[]} of command line arguments in order to populate a
* {@link CommandLineArgs} object.
@@ -71,7 +73,8 @@ class SimpleCommandLineArgsParser {
else {
optionName = optionText;
}
- if (optionName.isEmpty() || (optionValue != null && optionValue.isEmpty())) {
+ if (StringUtils.isEmpty(optionName)
+ || (optionValue != null && StringUtils.isEmpty(optionValue))) {
throw new IllegalArgumentException("Invalid argument syntax: " + arg);
}
commandLineArgs.addOptionArg(optionName, optionValue);
diff --git a/spring-core/src/main/java/org/springframework/util/DefaultPropertiesPersister.java b/spring-core/src/main/java/org/springframework/util/DefaultPropertiesPersister.java
index 1337a5a..f94f4a3 100644
--- a/spring-core/src/main/java/org/springframework/util/DefaultPropertiesPersister.java
+++ b/spring-core/src/main/java/org/springframework/util/DefaultPropertiesPersister.java
@@ -16,6 +16,8 @@
package org.springframework.util;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
+
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
@@ -70,6 +72,7 @@ public class DefaultPropertiesPersister implements PropertiesPersister {
props.load(is);
}
+ @IgnoreJRERequirement // safe check
public void load(Properties props, Reader reader) throws IOException {
if (loadFromReaderAvailable) {
// On JDK 1.6+
@@ -152,6 +155,7 @@ public class DefaultPropertiesPersister implements PropertiesPersister {
props.store(os, header);
}
+ @IgnoreJRERequirement // safe check
public void store(Properties props, Writer writer, String header) throws IOException {
if (storeToWriterAvailable) {
// On JDK 1.6+
diff --git a/spring-core/src/main/java/org/springframework/util/xml/AbstractStaxContentHandler.java b/spring-core/src/main/java/org/springframework/util/xml/AbstractStaxContentHandler.java
index 46f4d98..e1dfc84 100644
--- a/spring-core/src/main/java/org/springframework/util/xml/AbstractStaxContentHandler.java
+++ b/spring-core/src/main/java/org/springframework/util/xml/AbstractStaxContentHandler.java
@@ -19,6 +19,7 @@ package org.springframework.util.xml;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamException;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
import org.xml.sax.Attributes;
import org.xml.sax.ContentHandler;
import org.xml.sax.SAXException;
@@ -31,6 +32,7 @@ import org.xml.sax.SAXException;
* @author Arjen Poutsma
* @since 3.0
*/
+@IgnoreJRERequirement // Java6 only
abstract class AbstractStaxContentHandler implements ContentHandler {
private SimpleNamespaceContext namespaceContext = new SimpleNamespaceContext();
diff --git a/spring-core/src/main/java/org/springframework/util/xml/AbstractStaxXMLReader.java b/spring-core/src/main/java/org/springframework/util/xml/AbstractStaxXMLReader.java
index feeefd6..e7e1d93 100644
--- a/spring-core/src/main/java/org/springframework/util/xml/AbstractStaxXMLReader.java
+++ b/spring-core/src/main/java/org/springframework/util/xml/AbstractStaxXMLReader.java
@@ -22,6 +22,7 @@ import javax.xml.namespace.QName;
import javax.xml.stream.Location;
import javax.xml.stream.XMLStreamException;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
import org.xml.sax.InputSource;
import org.xml.sax.Locator;
import org.xml.sax.SAXException;
@@ -41,6 +42,7 @@ import org.springframework.util.StringUtils;
* @see #setEntityResolver(org.xml.sax.EntityResolver)
* @see #setErrorHandler(org.xml.sax.ErrorHandler)
*/
+@IgnoreJRERequirement // Java6 only
abstract class AbstractStaxXMLReader extends AbstractXMLReader {
private static final String NAMESPACES_FEATURE_NAME = "http://xml.org/sax/features/namespaces";
@@ -209,6 +211,7 @@ abstract class AbstractStaxXMLReader extends AbstractXMLReader {
* @see Locator
* @see Location
*/
+ @IgnoreJRERequirement // Java6 only
private static class StaxLocator implements Locator {
private Location location;
diff --git a/spring-core/src/main/java/org/springframework/util/xml/AbstractXMLStreamReader.java b/spring-core/src/main/java/org/springframework/util/xml/AbstractXMLStreamReader.java
index e8c8a64..ccdea57 100644
--- a/spring-core/src/main/java/org/springframework/util/xml/AbstractXMLStreamReader.java
+++ b/spring-core/src/main/java/org/springframework/util/xml/AbstractXMLStreamReader.java
@@ -21,6 +21,7 @@ import javax.xml.stream.XMLStreamConstants;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
import org.springframework.util.Assert;
/**
@@ -29,6 +30,7 @@ import org.springframework.util.Assert;
* @author Arjen Poutsma
* @since 3.0
*/
+@IgnoreJRERequirement // Java6 only
abstract class AbstractXMLStreamReader implements XMLStreamReader {
public String getElementText() throws XMLStreamException {
diff --git a/spring-core/src/main/java/org/springframework/util/xml/StaxEventContentHandler.java b/spring-core/src/main/java/org/springframework/util/xml/StaxEventContentHandler.java
index 686ff1a..d2ee511 100644
--- a/spring-core/src/main/java/org/springframework/util/xml/StaxEventContentHandler.java
+++ b/spring-core/src/main/java/org/springframework/util/xml/StaxEventContentHandler.java
@@ -29,6 +29,7 @@ import javax.xml.stream.events.Namespace;
import javax.xml.stream.events.XMLEvent;
import javax.xml.stream.util.XMLEventConsumer;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
import org.xml.sax.Attributes;
import org.xml.sax.Locator;
@@ -43,6 +44,7 @@ import org.springframework.util.StringUtils;
* @see XMLEvent
* @see XMLEventConsumer
*/
+@IgnoreJRERequirement // Java6 only
class StaxEventContentHandler extends AbstractStaxContentHandler {
private final XMLEventFactory eventFactory;
diff --git a/spring-core/src/main/java/org/springframework/util/xml/StaxEventXMLReader.java b/spring-core/src/main/java/org/springframework/util/xml/StaxEventXMLReader.java
index fd43354..efd272f 100644
--- a/spring-core/src/main/java/org/springframework/util/xml/StaxEventXMLReader.java
+++ b/spring-core/src/main/java/org/springframework/util/xml/StaxEventXMLReader.java
@@ -38,6 +38,7 @@ import javax.xml.stream.events.StartDocument;
import javax.xml.stream.events.StartElement;
import javax.xml.stream.events.XMLEvent;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.ext.Locator2;
@@ -58,6 +59,7 @@ import org.springframework.util.StringUtils;
* @see #setEntityResolver(org.xml.sax.EntityResolver)
* @see #setErrorHandler(org.xml.sax.ErrorHandler)
*/
+@IgnoreJRERequirement // Java6 only
class StaxEventXMLReader extends AbstractStaxXMLReader {
private static final String DEFAULT_XML_VERSION = "1.0";
diff --git a/spring-core/src/main/java/org/springframework/util/xml/StaxStreamContentHandler.java b/spring-core/src/main/java/org/springframework/util/xml/StaxStreamContentHandler.java
index 2241e2f..d5c5c4e 100644
--- a/spring-core/src/main/java/org/springframework/util/xml/StaxStreamContentHandler.java
+++ b/spring-core/src/main/java/org/springframework/util/xml/StaxStreamContentHandler.java
@@ -21,6 +21,7 @@ import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
import org.xml.sax.Attributes;
import org.xml.sax.Locator;
@@ -34,6 +35,7 @@ import org.springframework.util.StringUtils;
* @see XMLStreamWriter
* @since 3.0
*/
+@IgnoreJRERequirement // Java6 only
class StaxStreamContentHandler extends AbstractStaxContentHandler {
private final XMLStreamWriter streamWriter;
diff --git a/spring-core/src/main/java/org/springframework/util/xml/StaxStreamXMLReader.java b/spring-core/src/main/java/org/springframework/util/xml/StaxStreamXMLReader.java
index 26394c5..3197564 100644
--- a/spring-core/src/main/java/org/springframework/util/xml/StaxStreamXMLReader.java
+++ b/spring-core/src/main/java/org/springframework/util/xml/StaxStreamXMLReader.java
@@ -22,6 +22,7 @@ import javax.xml.stream.XMLStreamConstants;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.ext.Locator2;
@@ -42,6 +43,7 @@ import org.springframework.util.StringUtils;
* @see #setEntityResolver(org.xml.sax.EntityResolver)
* @see #setErrorHandler(org.xml.sax.ErrorHandler)
*/
+@IgnoreJRERequirement // Java6 only
class StaxStreamXMLReader extends AbstractStaxXMLReader {
private static final String DEFAULT_XML_VERSION = "1.0";
diff --git a/spring-core/src/main/java/org/springframework/util/xml/StaxUtils.java b/spring-core/src/main/java/org/springframework/util/xml/StaxUtils.java
index 41fd3f6..bfdbcfc 100644
--- a/spring-core/src/main/java/org/springframework/util/xml/StaxUtils.java
+++ b/spring-core/src/main/java/org/springframework/util/xml/StaxUtils.java
@@ -27,6 +27,7 @@ import javax.xml.transform.Source;
import javax.xml.transform.stax.StAXResult;
import javax.xml.transform.stax.StAXSource;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
import org.xml.sax.ContentHandler;
import org.xml.sax.XMLReader;
@@ -43,6 +44,7 @@ import org.springframework.util.ClassUtils;
* @author Juergen Hoeller
* @since 3.0
*/
+@IgnoreJRERequirement // safe check
public abstract class StaxUtils {
// JAXP 1.4 is only available on JDK 1.6+
@@ -335,6 +337,7 @@ public abstract class StaxUtils {
/**
* Inner class to avoid a static JAXP 1.4 dependency.
*/
+ @IgnoreJRERequirement // Java6 only
private static class Jaxp14StaxHandler {
private static Source createStaxSource(XMLStreamReader streamReader) {
diff --git a/spring-core/src/main/java/org/springframework/util/xml/XMLEventStreamReader.java b/spring-core/src/main/java/org/springframework/util/xml/XMLEventStreamReader.java
index b8321a0..ba8ef3b 100644
--- a/spring-core/src/main/java/org/springframework/util/xml/XMLEventStreamReader.java
+++ b/spring-core/src/main/java/org/springframework/util/xml/XMLEventStreamReader.java
@@ -16,6 +16,8 @@
package org.springframework.util.xml;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
+
import java.util.Iterator;
import javax.xml.namespace.NamespaceContext;
import javax.xml.namespace.QName;
@@ -38,6 +40,7 @@ import javax.xml.stream.events.XMLEvent;
* @since 3.0
* @see StaxUtils#createEventStreamReader(javax.xml.stream.XMLEventReader)
*/
+@IgnoreJRERequirement // Java6 only
class XMLEventStreamReader extends AbstractXMLStreamReader {
private XMLEvent event;
diff --git a/spring-core/src/main/java/org/springframework/util/xml/XMLEventStreamWriter.java b/spring-core/src/main/java/org/springframework/util/xml/XMLEventStreamWriter.java
index d65c4a3..bb50c70 100644
--- a/spring-core/src/main/java/org/springframework/util/xml/XMLEventStreamWriter.java
+++ b/spring-core/src/main/java/org/springframework/util/xml/XMLEventStreamWriter.java
@@ -29,6 +29,7 @@ import javax.xml.stream.events.EndElement;
import javax.xml.stream.events.Namespace;
import javax.xml.stream.events.StartElement;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
import org.springframework.util.Assert;
/**
@@ -39,6 +40,7 @@ import org.springframework.util.Assert;
* @since 3.0.5
* @see StaxUtils#createEventStreamWriter(javax.xml.stream.XMLEventWriter, javax.xml.stream.XMLEventFactory)
*/
+@IgnoreJRERequirement // Java6 only
class XMLEventStreamWriter implements XMLStreamWriter {
private static final String DEFAULT_ENCODING = "UTF-8";
diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/SqlRowSetResultSetExtractor.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/SqlRowSetResultSetExtractor.java
index 38efce9..e6a3a68 100644
--- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/SqlRowSetResultSetExtractor.java
+++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/SqlRowSetResultSetExtractor.java
@@ -22,6 +22,7 @@ import javax.sql.rowset.CachedRowSet;
import javax.sql.rowset.RowSetFactory;
import javax.sql.rowset.RowSetProvider;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
import org.springframework.core.JdkVersion;
import org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet;
import org.springframework.jdbc.support.rowset.SqlRowSet;
@@ -107,6 +108,7 @@ public class SqlRowSetResultSetExtractor implements ResultSetExtractor<SqlRowSet
/**
* Inner class to avoid a hard dependency on JDBC 4.1 RowSetProvider class.
*/
+ @IgnoreJRERequirement // Java6 only
private static class StandardCachedRowSetFactory implements CachedRowSetFactory {
private final RowSetFactory rowSetFactory;
@@ -129,6 +131,7 @@ public class SqlRowSetResultSetExtractor implements ResultSetExtractor<SqlRowSet
/**
* Inner class to avoid a hard dependency on Sun's CachedRowSetImpl class.
*/
+ @IgnoreJRERequirement
private static class SunCachedRowSetFactory implements CachedRowSetFactory {
public CachedRowSet createCachedRowSet() throws SQLException {
diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/DelegatingDataSource.java b/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/DelegatingDataSource.java
index a4c162d..81f73a3 100644
--- a/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/DelegatingDataSource.java
+++ b/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/DelegatingDataSource.java
@@ -22,6 +22,7 @@ import java.sql.SQLException;
import java.util.logging.Logger;
import javax.sql.DataSource;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.util.Assert;
@@ -110,6 +111,7 @@ public class DelegatingDataSource implements DataSource, InitializingBean {
//---------------------------------------------------------------------
@SuppressWarnings("unchecked")
+ @IgnoreJRERequirement // Java6 only
public <T> T unwrap(Class<T> iface) throws SQLException {
if (iface.isInstance(this)) {
return (T) this;
@@ -117,6 +119,7 @@ public class DelegatingDataSource implements DataSource, InitializingBean {
return getTargetDataSource().unwrap(iface);
}
+ @IgnoreJRERequirement // Java6 only
public boolean isWrapperFor(Class<?> iface) throws SQLException {
return (iface.isInstance(this) || getTargetDataSource().isWrapperFor(iface));
}
diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseFactory.java b/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseFactory.java
index 20a5bfd..525135f 100644
--- a/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseFactory.java
+++ b/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseFactory.java
@@ -25,6 +25,7 @@ import javax.sql.DataSource;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
import org.springframework.jdbc.datasource.init.DatabasePopulator;
import org.springframework.jdbc.datasource.init.DatabasePopulatorUtils;
import org.springframework.util.Assert;
@@ -196,10 +197,12 @@ public class EmbeddedDatabaseFactory {
this.dataSource.setLoginTimeout(seconds);
}
+ @IgnoreJRERequirement // Java6 only
public <T> T unwrap(Class<T> iface) throws SQLException {
return this.dataSource.unwrap(iface);
}
+ @IgnoreJRERequirement // Java6 only
public boolean isWrapperFor(Class<?> iface) throws SQLException {
return this.dataSource.isWrapperFor(iface);
}
diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/lookup/AbstractRoutingDataSource.java b/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/lookup/AbstractRoutingDataSource.java
index f42cbb7..9df0e18 100644
--- a/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/lookup/AbstractRoutingDataSource.java
+++ b/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/lookup/AbstractRoutingDataSource.java
@@ -22,6 +22,7 @@ import java.util.HashMap;
import java.util.Map;
import javax.sql.DataSource;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.jdbc.datasource.AbstractDataSource;
import org.springframework.util.Assert;
@@ -168,6 +169,7 @@ public abstract class AbstractRoutingDataSource extends AbstractDataSource imple
@Override
@SuppressWarnings("unchecked")
+ @IgnoreJRERequirement // Java6 only
public <T> T unwrap(Class<T> iface) throws SQLException {
if (iface.isInstance(this)) {
return (T) this;
@@ -176,6 +178,7 @@ public abstract class AbstractRoutingDataSource extends AbstractDataSource imple
}
@Override
+ @IgnoreJRERequirement // Java6 only
public boolean isWrapperFor(Class<?> iface) throws SQLException {
return (iface.isInstance(this) || determineTargetDataSource().isWrapperFor(iface));
}
diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/support/SQLExceptionSubclassTranslator.java b/spring-jdbc/src/main/java/org/springframework/jdbc/support/SQLExceptionSubclassTranslator.java
index 26b528e..9d058b8 100644
--- a/spring-jdbc/src/main/java/org/springframework/jdbc/support/SQLExceptionSubclassTranslator.java
+++ b/spring-jdbc/src/main/java/org/springframework/jdbc/support/SQLExceptionSubclassTranslator.java
@@ -30,6 +30,7 @@ import java.sql.SQLTransactionRollbackException;
import java.sql.SQLTransientConnectionException;
import java.sql.SQLTransientException;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
import org.springframework.dao.ConcurrencyFailureException;
import org.springframework.dao.DataAccessException;
import org.springframework.dao.DataAccessResourceFailureException;
@@ -56,6 +57,7 @@ import org.springframework.jdbc.BadSqlGrammarException;
* @see java.sql.SQLTransientException
* @see java.sql.SQLRecoverableException
*/
+@IgnoreJRERequirement // java6 only
public class SQLExceptionSubclassTranslator extends AbstractFallbackSQLExceptionTranslator {
public SQLExceptionSubclassTranslator() {
diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/support/lob/DefaultLobHandler.java b/spring-jdbc/src/main/java/org/springframework/jdbc/support/lob/DefaultLobHandler.java
index e570be2..035eee3 100644
--- a/spring-jdbc/src/main/java/org/springframework/jdbc/support/lob/DefaultLobHandler.java
+++ b/spring-jdbc/src/main/java/org/springframework/jdbc/support/lob/DefaultLobHandler.java
@@ -30,6 +30,7 @@ import java.sql.SQLException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
/**
* Default implementation of the {@link LobHandler} interface.
@@ -203,6 +204,7 @@ public class DefaultLobHandler extends AbstractLobHandler {
* Default LobCreator implementation as an inner class.
* Can be subclassed in DefaultLobHandler extensions.
*/
+ @IgnoreJRERequirement // Java6 only
protected class DefaultLobCreator implements LobCreator {
public void setBlobAsBytes(PreparedStatement ps, int paramIndex, byte[] content)
diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/support/lob/TemporaryLobCreator.java b/spring-jdbc/src/main/java/org/springframework/jdbc/support/lob/TemporaryLobCreator.java
index f8c5266..70c30d2 100644
--- a/spring-jdbc/src/main/java/org/springframework/jdbc/support/lob/TemporaryLobCreator.java
+++ b/spring-jdbc/src/main/java/org/springframework/jdbc/support/lob/TemporaryLobCreator.java
@@ -29,6 +29,7 @@ import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
import org.springframework.dao.DataAccessResourceFailureException;
import org.springframework.util.FileCopyUtils;
@@ -46,6 +47,7 @@ import org.springframework.util.FileCopyUtils;
* @see java.sql.Connection#createBlob()
* @see java.sql.Connection#createClob()
*/
+@IgnoreJRERequirement // java6 only
public class TemporaryLobCreator implements LobCreator {
protected static final Log logger = LogFactory.getLog(TemporaryLobCreator.class);
diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/support/nativejdbc/Jdbc4NativeJdbcExtractor.java b/spring-jdbc/src/main/java/org/springframework/jdbc/support/nativejdbc/Jdbc4NativeJdbcExtractor.java
index b011339..34dc698 100644
--- a/spring-jdbc/src/main/java/org/springframework/jdbc/support/nativejdbc/Jdbc4NativeJdbcExtractor.java
+++ b/spring-jdbc/src/main/java/org/springframework/jdbc/support/nativejdbc/Jdbc4NativeJdbcExtractor.java
@@ -16,6 +16,8 @@
package org.springframework.jdbc.support.nativejdbc;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
+
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.PreparedStatement;
@@ -44,6 +46,7 @@ import java.sql.Statement;
* @see org.springframework.jdbc.core.JdbcTemplate#setNativeJdbcExtractor
* @see org.springframework.jdbc.support.lob.OracleLobHandler#setNativeJdbcExtractor
*/
+@IgnoreJRERequirement
public class Jdbc4NativeJdbcExtractor extends NativeJdbcExtractorAdapter {
private Class<? extends Connection> connectionType = Connection.class;
diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/support/xml/Jdbc4SqlXmlHandler.java b/spring-jdbc/src/main/java/org/springframework/jdbc/support/xml/Jdbc4SqlXmlHandler.java
index 13f0363..d593d3d 100644
--- a/spring-jdbc/src/main/java/org/springframework/jdbc/support/xml/Jdbc4SqlXmlHandler.java
+++ b/spring-jdbc/src/main/java/org/springframework/jdbc/support/xml/Jdbc4SqlXmlHandler.java
@@ -27,6 +27,7 @@ import javax.xml.transform.Source;
import javax.xml.transform.dom.DOMResult;
import javax.xml.transform.dom.DOMSource;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
import org.w3c.dom.Document;
import org.springframework.dao.DataAccessResourceFailureException;
@@ -44,6 +45,7 @@ import org.springframework.dao.DataAccessResourceFailureException;
* @see java.sql.ResultSet#getSQLXML
* @see java.sql.PreparedStatement#setSQLXML
*/
+@IgnoreJRERequirement // Java6 only
public class Jdbc4SqlXmlHandler implements SqlXmlHandler {
//-------------------------------------------------------------------------
@@ -139,6 +141,7 @@ public class Jdbc4SqlXmlHandler implements SqlXmlHandler {
/**
* Internal base class for {@link SqlXmlValue} implementations.
*/
+ @IgnoreJRERequirement // Java6 only
private static abstract class AbstractJdbc4SqlXmlValue implements SqlXmlValue {
private SQLXML xmlObject;
diff --git a/spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java b/spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java
index bbf7754..6c8a074 100644
--- a/spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java
+++ b/spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java
@@ -69,6 +69,7 @@ import javax.xml.validation.SchemaFactory;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
import org.w3c.dom.ls.LSResourceResolver;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
@@ -120,6 +121,7 @@ import org.springframework.util.xml.StaxUtils;
* @see #setUnmarshallerListener(javax.xml.bind.Unmarshaller.Listener)
* @see #setAdapters(XmlAdapter[])
*/
+@IgnoreJRERequirement // Java6 only
public class Jaxb2Marshaller implements MimeMarshaller, MimeUnmarshaller, GenericMarshaller, GenericUnmarshaller,
BeanClassLoaderAware, InitializingBean {
@@ -872,6 +874,7 @@ public class Jaxb2Marshaller implements MimeMarshaller, MimeUnmarshaller, Generi
}
+ @IgnoreJRERequirement // Java6 only
private static class Jaxb2AttachmentMarshaller extends AttachmentMarshaller {
private final MimeContainer mimeContainer;
@@ -925,7 +928,7 @@ public class Jaxb2Marshaller implements MimeMarshaller, MimeUnmarshaller, Generi
}
}
-
+ @IgnoreJRERequirement // Java6 only
private static class Jaxb2AttachmentUnmarshaller extends AttachmentUnmarshaller {
private final MimeContainer mimeContainer;
diff --git a/spring-web/src/main/java/org/springframework/http/converter/xml/AbstractJaxb2HttpMessageConverter.java b/spring-web/src/main/java/org/springframework/http/converter/xml/AbstractJaxb2HttpMessageConverter.java
index 3a0bce5..967265e 100644
--- a/spring-web/src/main/java/org/springframework/http/converter/xml/AbstractJaxb2HttpMessageConverter.java
+++ b/spring-web/src/main/java/org/springframework/http/converter/xml/AbstractJaxb2HttpMessageConverter.java
@@ -23,6 +23,7 @@ import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
import org.springframework.http.converter.HttpMessageConversionException;
import org.springframework.util.Assert;
@@ -33,6 +34,7 @@ import org.springframework.util.Assert;
* @author Arjen Poutsma
* @since 3.0
*/
+@IgnoreJRERequirement // Java6 only
public abstract class AbstractJaxb2HttpMessageConverter<T> extends AbstractXmlHttpMessageConverter<T> {
private final ConcurrentMap<Class, JAXBContext> jaxbContexts = new ConcurrentHashMap<Class, JAXBContext>(64);
diff --git a/spring-web/src/main/java/org/springframework/http/converter/xml/Jaxb2CollectionHttpMessageConverter.java b/spring-web/src/main/java/org/springframework/http/converter/xml/Jaxb2CollectionHttpMessageConverter.java
index cfbf6b6..64e4fb8 100644
--- a/spring-web/src/main/java/org/springframework/http/converter/xml/Jaxb2CollectionHttpMessageConverter.java
+++ b/spring-web/src/main/java/org/springframework/http/converter/xml/Jaxb2CollectionHttpMessageConverter.java
@@ -37,6 +37,7 @@ import javax.xml.stream.XMLStreamReader;
import javax.xml.transform.Result;
import javax.xml.transform.Source;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpInputMessage;
import org.springframework.http.MediaType;
@@ -54,6 +55,7 @@ import org.springframework.http.converter.HttpMessageNotReadableException;
* @author Arjen Poutsma
* @since 3.2
*/
+@IgnoreJRERequirement // Java6 only
public class Jaxb2CollectionHttpMessageConverter<T extends Collection>
extends AbstractJaxb2HttpMessageConverter<T> implements GenericHttpMessageConverter<T> {
diff --git a/spring-web/src/main/java/org/springframework/http/converter/xml/Jaxb2RootElementHttpMessageConverter.java b/spring-web/src/main/java/org/springframework/http/converter/xml/Jaxb2RootElementHttpMessageConverter.java
index 89d5bd0..e0ef7bd 100644
--- a/spring-web/src/main/java/org/springframework/http/converter/xml/Jaxb2RootElementHttpMessageConverter.java
+++ b/spring-web/src/main/java/org/springframework/http/converter/xml/Jaxb2RootElementHttpMessageConverter.java
@@ -29,6 +29,7 @@ import javax.xml.bind.annotation.XmlType;
import javax.xml.transform.Result;
import javax.xml.transform.Source;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
@@ -47,6 +48,7 @@ import org.springframework.util.ClassUtils;
* @author Arjen Poutsma
* @since 3.0
*/
+@IgnoreJRERequirement // Java6 only
public class Jaxb2RootElementHttpMessageConverter extends AbstractJaxb2HttpMessageConverter<Object> {
@Override
diff --git a/spring-web/src/main/java/org/springframework/http/converter/xml/SourceHttpMessageConverter.java b/spring-web/src/main/java/org/springframework/http/converter/xml/SourceHttpMessageConverter.java
index 15b7d8e..85a520c 100644
--- a/spring-web/src/main/java/org/springframework/http/converter/xml/SourceHttpMessageConverter.java
+++ b/spring-web/src/main/java/org/springframework/http/converter/xml/SourceHttpMessageConverter.java
@@ -37,6 +37,7 @@ import javax.xml.transform.sax.SAXSource;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
import org.w3c.dom.Document;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
@@ -143,6 +144,7 @@ public class SourceHttpMessageConverter<T extends Source> extends AbstractHttpMe
}
}
+ @IgnoreJRERequirement // Java6 only
private Source readStAXSource(InputStream body) {
try {
XMLInputFactory inputFactory = XMLInputFactory.newFactory();
diff --git a/spring-web/src/main/java/org/springframework/remoting/caucho/SimpleBurlapServiceExporter.java b/spring-web/src/main/java/org/springframework/remoting/caucho/SimpleBurlapServiceExporter.java
index aed4137..dc4e9da 100644
--- a/spring-web/src/main/java/org/springframework/remoting/caucho/SimpleBurlapServiceExporter.java
+++ b/spring-web/src/main/java/org/springframework/remoting/caucho/SimpleBurlapServiceExporter.java
@@ -22,6 +22,7 @@ import java.io.IOException;
import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
import org.springframework.util.FileCopyUtils;
/**
@@ -45,6 +46,7 @@ import org.springframework.util.FileCopyUtils;
* @see SimpleHessianServiceExporter
* @see org.springframework.remoting.httpinvoker.SimpleHttpInvokerServiceExporter
*/
+@IgnoreJRERequirement // Sun's HTTP server
public class SimpleBurlapServiceExporter extends BurlapExporter implements HttpHandler {
/**
diff --git a/spring-web/src/main/java/org/springframework/remoting/caucho/SimpleHessianServiceExporter.java b/spring-web/src/main/java/org/springframework/remoting/caucho/SimpleHessianServiceExporter.java
index d0e49e9..c9484f0 100644
--- a/spring-web/src/main/java/org/springframework/remoting/caucho/SimpleHessianServiceExporter.java
+++ b/spring-web/src/main/java/org/springframework/remoting/caucho/SimpleHessianServiceExporter.java
@@ -22,6 +22,7 @@ import java.io.IOException;
import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
import org.springframework.util.FileCopyUtils;
/**
@@ -45,6 +46,7 @@ import org.springframework.util.FileCopyUtils;
* @see SimpleBurlapServiceExporter
* @see org.springframework.remoting.httpinvoker.SimpleHttpInvokerServiceExporter
*/
+@IgnoreJRERequirement // Sun's HTTP server
public class SimpleHessianServiceExporter extends HessianExporter implements HttpHandler {
/**
diff --git a/spring-web/src/main/java/org/springframework/remoting/httpinvoker/SimpleHttpInvokerServiceExporter.java b/spring-web/src/main/java/org/springframework/remoting/httpinvoker/SimpleHttpInvokerServiceExporter.java
index 084a4e6..2388767 100644
--- a/spring-web/src/main/java/org/springframework/remoting/httpinvoker/SimpleHttpInvokerServiceExporter.java
+++ b/spring-web/src/main/java/org/springframework/remoting/httpinvoker/SimpleHttpInvokerServiceExporter.java
@@ -25,6 +25,7 @@ import java.io.OutputStream;
import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
import org.springframework.remoting.rmi.RemoteInvocationSerializingExporter;
import org.springframework.remoting.support.RemoteInvocation;
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.SimpleBurlapServiceExporter
*/
+@IgnoreJRERequirement // Sun's HTTP server
public class SimpleHttpInvokerServiceExporter extends RemoteInvocationSerializingExporter
implements HttpHandler {
diff --git a/spring-web/src/main/java/org/springframework/remoting/jaxws/AbstractJaxWsServiceExporter.java b/spring-web/src/main/java/org/springframework/remoting/jaxws/AbstractJaxWsServiceExporter.java
index 5a2f3ba..e16ec00 100644
--- a/spring-web/src/main/java/org/springframework/remoting/jaxws/AbstractJaxWsServiceExporter.java
+++ b/spring-web/src/main/java/org/springframework/remoting/jaxws/AbstractJaxWsServiceExporter.java
@@ -27,6 +27,7 @@ import javax.xml.ws.Endpoint;
import javax.xml.ws.WebServiceFeature;
import javax.xml.ws.WebServiceProvider;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
@@ -54,6 +55,7 @@ import org.springframework.util.ReflectionUtils;
* @see SimpleJaxWsServiceExporter
* @see SimpleHttpServerJaxWsServiceExporter
*/
+@IgnoreJRERequirement // Java6 only
public abstract class AbstractJaxWsServiceExporter implements BeanFactoryAware, InitializingBean, DisposableBean {
private Map<String, Object> endpointProperties;
@@ -212,6 +214,7 @@ public abstract class AbstractJaxWsServiceExporter implements BeanFactoryAware,
* Inner class in order to avoid a hard-coded JAX-WS 2.2 dependency.
* JAX-WS 2.0 and 2.1 didn't have WebServiceFeatures for endpoints yet...
*/
+ @IgnoreJRERequirement // Java6 only
private class FeatureEndpointProvider {
public Endpoint createEndpoint(String bindingType, Object implementor, Object[] features) {
diff --git a/spring-web/src/main/java/org/springframework/remoting/jaxws/JaxWsPortClientInterceptor.java b/spring-web/src/main/java/org/springframework/remoting/jaxws/JaxWsPortClientInterceptor.java
index 9efd206..761da4c 100644
--- a/spring-web/src/main/java/org/springframework/remoting/jaxws/JaxWsPortClientInterceptor.java
+++ b/spring-web/src/main/java/org/springframework/remoting/jaxws/JaxWsPortClientInterceptor.java
@@ -34,6 +34,7 @@ import javax.xml.ws.soap.SOAPFaultException;
import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
import org.springframework.aop.support.AopUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.BeanClassLoaderAware;
@@ -62,6 +63,7 @@ import org.springframework.util.StringUtils;
* @see org.springframework.remoting.RemoteAccessException
* @see org.springframework.jndi.JndiObjectFactoryBean
*/
+@IgnoreJRERequirement // Java6 only
public class JaxWsPortClientInterceptor extends LocalJaxWsServiceFactory
implements MethodInterceptor, BeanClassLoaderAware, InitializingBean {
@@ -538,6 +540,7 @@ public class JaxWsPortClientInterceptor extends LocalJaxWsServiceFactory
* Inner class in order to avoid a hard-coded JAX-WS 2.1 dependency.
* JAX-WS 2.0, as used in Java EE 5, didn't have WebServiceFeatures yet...
*/
+ @IgnoreJRERequirement // Java6 only
private class FeaturePortProvider {
public Object getPortStub(Service service, QName portQName, Object[] features) {
diff --git a/spring-web/src/main/java/org/springframework/remoting/jaxws/JaxWsSoapFaultException.java b/spring-web/src/main/java/org/springframework/remoting/jaxws/JaxWsSoapFaultException.java
index 65ff59c..85236b7 100644
--- a/spring-web/src/main/java/org/springframework/remoting/jaxws/JaxWsSoapFaultException.java
+++ b/spring-web/src/main/java/org/springframework/remoting/jaxws/JaxWsSoapFaultException.java
@@ -20,6 +20,7 @@ import javax.xml.namespace.QName;
import javax.xml.soap.SOAPFault;
import javax.xml.ws.soap.SOAPFaultException;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
import org.springframework.remoting.soap.SoapFaultException;
/**
@@ -30,6 +31,7 @@ import org.springframework.remoting.soap.SoapFaultException;
* @since 2.5
*/
@SuppressWarnings("serial")
+@IgnoreJRERequirement // Java6 only
public class JaxWsSoapFaultException extends SoapFaultException {
/**
diff --git a/spring-web/src/main/java/org/springframework/remoting/jaxws/LocalJaxWsServiceFactory.java b/spring-web/src/main/java/org/springframework/remoting/jaxws/LocalJaxWsServiceFactory.java
index 7f95b3a..b0c0809 100644
--- a/spring-web/src/main/java/org/springframework/remoting/jaxws/LocalJaxWsServiceFactory.java
+++ b/spring-web/src/main/java/org/springframework/remoting/jaxws/LocalJaxWsServiceFactory.java
@@ -23,6 +23,7 @@ import javax.xml.namespace.QName;
import javax.xml.ws.Service;
import javax.xml.ws.handler.HandlerResolver;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
import org.springframework.core.io.Resource;
import org.springframework.util.Assert;
@@ -132,6 +133,7 @@ public class LocalJaxWsServiceFactory {
* @see #setServiceName
* @see #setWsdlDocumentUrl
*/
+ @IgnoreJRERequirement // checked
public Service createJaxWsService() {
Assert.notNull(this.serviceName, "No service name specified");
Service service = (this.wsdlDocumentUrl != null ?
diff --git a/spring-web/src/main/java/org/springframework/remoting/jaxws/SimpleHttpServerJaxWsServiceExporter.java b/spring-web/src/main/java/org/springframework/remoting/jaxws/SimpleHttpServerJaxWsServiceExporter.java
index 5b30a33..a13022a 100644
--- a/spring-web/src/main/java/org/springframework/remoting/jaxws/SimpleHttpServerJaxWsServiceExporter.java
+++ b/spring-web/src/main/java/org/springframework/remoting/jaxws/SimpleHttpServerJaxWsServiceExporter.java
@@ -28,6 +28,7 @@ import com.sun.net.httpserver.HttpContext;
import com.sun.net.httpserver.HttpServer;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
/**
* Simple exporter for JAX-WS services, autodetecting annotated service beans
@@ -46,6 +47,7 @@ import org.apache.commons.logging.LogFactory;
* @see javax.xml.ws.Endpoint#publish(Object)
* @see SimpleJaxWsServiceExporter
*/
+@IgnoreJRERequirement // Java6 only and Sun's HTTP server
public class SimpleHttpServerJaxWsServiceExporter extends AbstractJaxWsServiceExporter {
protected final Log logger = LogFactory.getLog(getClass());
diff --git a/spring-web/src/main/java/org/springframework/remoting/jaxws/SimpleJaxWsServiceExporter.java b/spring-web/src/main/java/org/springframework/remoting/jaxws/SimpleJaxWsServiceExporter.java
index 08c47e6..018ee7e 100644
--- a/spring-web/src/main/java/org/springframework/remoting/jaxws/SimpleJaxWsServiceExporter.java
+++ b/spring-web/src/main/java/org/springframework/remoting/jaxws/SimpleJaxWsServiceExporter.java
@@ -16,6 +16,8 @@
package org.springframework.remoting.jaxws;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
+
import javax.jws.WebService;
import javax.xml.ws.Endpoint;
import javax.xml.ws.WebServiceProvider;
@@ -42,6 +44,7 @@ import javax.xml.ws.WebServiceProvider;
* @see javax.xml.ws.Endpoint#publish(String)
* @see SimpleHttpServerJaxWsServiceExporter
*/
+@IgnoreJRERequirement // Java6 only
public class SimpleJaxWsServiceExporter extends AbstractJaxWsServiceExporter {
public static final String DEFAULT_BASE_ADDRESS = "http://localhost:8080/";
diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/resource/ResourceHttpRequestHandler.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/resource/ResourceHttpRequestHandler.java
index 120e511..248ec02 100644
--- a/spring-webmvc/src/main/java/org/springframework/web/servlet/resource/ResourceHttpRequestHandler.java
+++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/resource/ResourceHttpRequestHandler.java
@@ -28,6 +28,7 @@ import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
@@ -256,6 +257,7 @@ public class ResourceHttpRequestHandler extends WebContentGenerator implements H
/**
* Inner class to avoid hard-coded JAF dependency.
*/
+ @IgnoreJRERequirement
private static class ActivationMediaTypeFactory {
private static final FileTypeMap fileTypeMap;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment