package-info for repackaged libraries (and other polishing)

This commit is contained in:
Juergen Hoeller 2017-04-06 14:10:46 +02:00
parent 75dd8d9c06
commit 67ea4b3a05
14 changed files with 45 additions and 40 deletions

View File

@ -0,0 +1,4 @@
/**
* The core AOP Alliance advice marker.
*/
package org.aopalliance.aop;

View File

@ -0,0 +1,4 @@
/**
* The AOP Alliance reflective interception abstraction.
*/
package org.aopalliance.intercept;

View File

@ -0,0 +1,4 @@
/**
* Spring's variant of the AOP Alliance interfaces.
*/
package org.aopalliance;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2017 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.
@ -39,10 +39,11 @@ public class CacheNamespaceHandler extends NamespaceHandlerSupport {
static final String DEFAULT_CACHE_MANAGER_BEAN_NAME = "cacheManager"; static final String DEFAULT_CACHE_MANAGER_BEAN_NAME = "cacheManager";
static String extractCacheManager(Element element) { static String extractCacheManager(Element element) {
return (element.hasAttribute(CacheNamespaceHandler.CACHE_MANAGER_ATTRIBUTE) ? element return (element.hasAttribute(CacheNamespaceHandler.CACHE_MANAGER_ATTRIBUTE) ?
.getAttribute(CacheNamespaceHandler.CACHE_MANAGER_ATTRIBUTE) element.getAttribute(CacheNamespaceHandler.CACHE_MANAGER_ATTRIBUTE) :
: CacheNamespaceHandler.DEFAULT_CACHE_MANAGER_BEAN_NAME); CacheNamespaceHandler.DEFAULT_CACHE_MANAGER_BEAN_NAME);
} }
static BeanDefinition parseKeyGenerator(Element element, BeanDefinition def) { static BeanDefinition parseKeyGenerator(Element element, BeanDefinition def) {
@ -53,9 +54,11 @@ public class CacheNamespaceHandler extends NamespaceHandlerSupport {
return def; return def;
} }
@Override @Override
public void init() { public void init() {
registerBeanDefinitionParser("annotation-driven", new AnnotationDrivenCacheBeanDefinitionParser()); registerBeanDefinitionParser("annotation-driven", new AnnotationDrivenCacheBeanDefinitionParser());
registerBeanDefinitionParser("advice", new CacheAdviceParser()); registerBeanDefinitionParser("advice", new CacheAdviceParser());
} }
} }

View File

@ -390,7 +390,7 @@ public @interface Configuration {
/** /**
* Explicitly specify the name of the Spring bean definition associated * Explicitly specify the name of the Spring bean definition associated
* with this Configuration class. If left unspecified (the common case), * with this Configuration class. If left unspecified (the common case),
* a bean name will be automatically generated. * a bean name will be automatically generated.
* <p>The custom name applies only if the Configuration class is picked up via * <p>The custom name applies only if the Configuration class is picked up via
* component scanning or supplied directly to a {@link AnnotationConfigApplicationContext}. * component scanning or supplied directly to a {@link AnnotationConfigApplicationContext}.

View File

@ -355,6 +355,7 @@ public class LocalValidatorFactoryBean extends SpringValidatorAdapter
@Override @Override
public ParameterNameProvider getParameterNameProvider() { public ParameterNameProvider getParameterNameProvider() {
Assert.notNull(this.validatorFactory, "No target ValidatorFactory set");
return this.validatorFactory.getParameterNameProvider(); return this.validatorFactory.getParameterNameProvider();
} }

View File

@ -1,6 +1,6 @@
/** /**
* Spring's repackaging of * Spring's repackaging of
* <a href="http://asm.ow2.org">org.objectweb.asm 5.0</a> * <a href="http://asm.ow2.org">ASM</a>
* (for internal use only). * (for internal use only).
* *
* <p>This repackaging technique avoids any potential conflicts with * <p>This repackaging technique avoids any potential conflicts with
@ -8,8 +8,6 @@
* libraries and frameworks. * libraries and frameworks.
* *
* <p>As this repackaging happens at the class file level, sources * <p>As this repackaging happens at the class file level, sources
* and javadocs are not available here. See the original ObjectWeb * and javadocs are not available here.
* <a href="http://asm.ow2.org/asm50/javadoc/user">ASM 5.0 javadocs</a>
* for details when working with these classes.
*/ */
package org.springframework.asm; package org.springframework.asm;

View File

@ -1,6 +1,6 @@
/** /**
* Spring's repackaging of * Spring's repackaging of
* <a href="http://cglib.sourceforge.net">net.sf.cglib 3.2</a> * <a href="http://cglib.sourceforge.net">CGLIB</a>
* (for internal use only). * (for internal use only).
* *
* <p>This repackaging technique avoids any potential conflicts with * <p>This repackaging technique avoids any potential conflicts with
@ -8,8 +8,6 @@
* libraries and frameworks. * libraries and frameworks.
* *
* <p>As this repackaging happens at the class file level, sources * <p>As this repackaging happens at the class file level, sources
* and javadocs are not available here. See the original * and javadocs are not available here.
* <a href="http://cglib.sourceforge.net/apidocs">CGLIB 3.2 javadocs</a>
* for details when working with these classes.
*/ */
package org.springframework.cglib; package org.springframework.cglib;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2016 the original author or authors. * Copyright 2002-2017 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.
@ -239,18 +239,21 @@ public class ObjectUtilsTests {
} }
@Test @Test
@Deprecated
public void hashCodeWithBooleanFalse() { public void hashCodeWithBooleanFalse() {
int expected = Boolean.FALSE.hashCode(); int expected = Boolean.FALSE.hashCode();
assertEquals(expected, ObjectUtils.hashCode(false)); assertEquals(expected, ObjectUtils.hashCode(false));
} }
@Test @Test
@Deprecated
public void hashCodeWithBooleanTrue() { public void hashCodeWithBooleanTrue() {
int expected = Boolean.TRUE.hashCode(); int expected = Boolean.TRUE.hashCode();
assertEquals(expected, ObjectUtils.hashCode(true)); assertEquals(expected, ObjectUtils.hashCode(true));
} }
@Test @Test
@Deprecated
public void hashCodeWithDouble() { public void hashCodeWithDouble() {
double dbl = 9830.43; double dbl = 9830.43;
int expected = (new Double(dbl)).hashCode(); int expected = (new Double(dbl)).hashCode();
@ -258,6 +261,7 @@ public class ObjectUtilsTests {
} }
@Test @Test
@Deprecated
public void hashCodeWithFloat() { public void hashCodeWithFloat() {
float flt = 34.8f; float flt = 34.8f;
int expected = (new Float(flt)).hashCode(); int expected = (new Float(flt)).hashCode();
@ -265,6 +269,7 @@ public class ObjectUtilsTests {
} }
@Test @Test
@Deprecated
public void hashCodeWithLong() { public void hashCodeWithLong() {
long lng = 883l; long lng = 883l;
int expected = (new Long(lng)).hashCode(); int expected = (new Long(lng)).hashCode();

View File

@ -199,7 +199,7 @@ public abstract class ScriptUtils {
} }
if (!inSingleQuote && !inDoubleQuote) { if (!inSingleQuote && !inDoubleQuote) {
if (script.startsWith(separator, i)) { if (script.startsWith(separator, i)) {
// we've reached the end of the current statement // We've reached the end of the current statement
if (sb.length() > 0) { if (sb.length() > 0) {
statements.add(sb.toString()); statements.add(sb.toString());
sb = new StringBuilder(); sb = new StringBuilder();
@ -208,32 +208,31 @@ public abstract class ScriptUtils {
continue; continue;
} }
else if (script.startsWith(commentPrefix, i)) { else if (script.startsWith(commentPrefix, i)) {
// skip over any content from the start of the comment to the EOL // Skip over any content from the start of the comment to the EOL
int indexOfNextNewline = script.indexOf("\n", i); int indexOfNextNewline = script.indexOf("\n", i);
if (indexOfNextNewline > i) { if (indexOfNextNewline > i) {
i = indexOfNextNewline; i = indexOfNextNewline;
continue; continue;
} }
else { else {
// if there's no EOL, we must be at the end // If there's no EOL, we must be at the end of the script, so stop here.
// of the script, so stop here.
break; break;
} }
} }
else if (script.startsWith(blockCommentStartDelimiter, i)) { else if (script.startsWith(blockCommentStartDelimiter, i)) {
// skip over any block comments // Skip over any block comments
int indexOfCommentEnd = script.indexOf(blockCommentEndDelimiter, i); int indexOfCommentEnd = script.indexOf(blockCommentEndDelimiter, i);
if (indexOfCommentEnd > i) { if (indexOfCommentEnd > i) {
i = indexOfCommentEnd + blockCommentEndDelimiter.length() - 1; i = indexOfCommentEnd + blockCommentEndDelimiter.length() - 1;
continue; continue;
} }
else { else {
throw new ScriptParseException(String.format("Missing block comment end delimiter [%s].", throw new ScriptParseException(
blockCommentEndDelimiter), resource); "Missing block comment end delimiter: " + blockCommentEndDelimiter, resource);
} }
} }
else if (c == ' ' || c == '\n' || c == '\t') { else if (c == ' ' || c == '\n' || c == '\t') {
// avoid multiple adjacent whitespace characters // Avoid multiple adjacent whitespace characters
if (sb.length() > 0 && sb.charAt(sb.length() - 1) != ' ') { if (sb.length() > 0 && sb.charAt(sb.length() - 1) != ' ') {
c = ' '; c = ' ';
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2016 the original author or authors. * Copyright 2002-2017 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.
@ -396,12 +396,7 @@ public class FormHttpMessageConverter implements HttpMessageConverter<MultiValue
* or a newly built {@link HttpEntity} wrapper for that part * or a newly built {@link HttpEntity} wrapper for that part
*/ */
protected HttpEntity<?> getHttpEntity(Object part) { protected HttpEntity<?> getHttpEntity(Object part) {
if (part instanceof HttpEntity) { return (part instanceof HttpEntity ? (HttpEntity<?>) part : new HttpEntity<>(part));
return (HttpEntity<?>) part;
}
else {
return new HttpEntity<>(part);
}
} }
/** /**
@ -416,7 +411,7 @@ public class FormHttpMessageConverter implements HttpMessageConverter<MultiValue
if (part instanceof Resource) { if (part instanceof Resource) {
Resource resource = (Resource) part; Resource resource = (Resource) part;
String filename = resource.getFilename(); String filename = resource.getFilename();
if (this.multipartCharset != null) { if (filename != null && this.multipartCharset != null) {
filename = MimeDelegate.encode(filename, this.multipartCharset.name()); filename = MimeDelegate.encode(filename, this.multipartCharset.name());
} }
return filename; return filename;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2015 the original author or authors. * Copyright 2002-2017 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.
@ -47,9 +47,6 @@ public abstract class GsonBuilderUtils {
* {@link GsonBuilder#registerTypeHierarchyAdapter(Class, Object)} which * {@link GsonBuilder#registerTypeHierarchyAdapter(Class, Object)} which
* serializes a {@code byte[]} property to and from a Base64-encoded String * serializes a {@code byte[]} property to and from a Base64-encoded String
* instead of a JSON array. * instead of a JSON array.
* <p><strong>NOTE:</strong> Use of this option requires the presence of the
* Apache Commons Codec library on the classpath when running on Java 6 or 7.
* On Java 8, the standard {@link java.util.Base64} facility is used instead.
*/ */
public static GsonBuilder gsonBuilderWithBase64EncodedByteArrays() { public static GsonBuilder gsonBuilderWithBase64EncodedByteArrays() {
GsonBuilder builder = new GsonBuilder(); GsonBuilder builder = new GsonBuilder();

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2014 the original author or authors. * Copyright 2002-2017 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,7 +24,6 @@ import com.google.gson.GsonBuilder;
import org.springframework.beans.factory.FactoryBean; import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.InitializingBean;
/** /**
* A {@link FactoryBean} for creating a Google Gson 2.x {@link Gson} instance. * A {@link FactoryBean} for creating a Google Gson 2.x {@link Gson} instance.
* *
@ -54,9 +53,6 @@ public class GsonFactoryBean implements FactoryBean<Gson>, InitializingBean {
* registered via {@link GsonBuilder#registerTypeHierarchyAdapter(Class, Object)} * registered via {@link GsonBuilder#registerTypeHierarchyAdapter(Class, Object)}
* which serializes a {@code byte[]} property to and from a Base64-encoded String * which serializes a {@code byte[]} property to and from a Base64-encoded String
* instead of a JSON array. * instead of a JSON array.
* <p><strong>NOTE:</strong> Use of this option requires the presence of the
* Apache Commons Codec library on the classpath when running on Java 6 or 7.
* On Java 8, the standard {@link java.util.Base64} facility is used instead.
* @see GsonBuilderUtils#gsonBuilderWithBase64EncodedByteArrays() * @see GsonBuilderUtils#gsonBuilderWithBase64EncodedByteArrays()
*/ */
public void setBase64EncodeByteArrays(boolean base64EncodeByteArrays) { public void setBase64EncodeByteArrays(boolean base64EncodeByteArrays) {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2016 the original author or authors. * Copyright 2002-2017 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.
@ -230,6 +230,7 @@ public class Jaxb2CollectionHttpMessageConverter<T extends Collection>
@Override @Override
public void write(T t, Type type, MediaType contentType, HttpOutputMessage outputMessage) public void write(T t, Type type, MediaType contentType, HttpOutputMessage outputMessage)
throws IOException, HttpMessageNotWritableException { throws IOException, HttpMessageNotWritableException {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }