Browse Source

Polishing

pull/25011/head
Juergen Hoeller 6 years ago
parent
commit
5eb8430688
  1. 3
      spring-context/src/main/java/org/springframework/context/annotation/DeferredImportSelector.java
  2. 3
      spring-context/src/main/java/org/springframework/context/annotation/ImportSelector.java
  3. 8
      spring-jdbc/src/main/java/org/springframework/jdbc/datasource/init/DatabasePopulatorUtils.java
  4. 7
      spring-web/src/main/java/org/springframework/http/codec/json/AbstractJackson2Decoder.java
  5. 11
      spring-web/src/main/java/org/springframework/http/codec/json/AbstractJackson2Encoder.java
  6. 3
      spring-web/src/main/java/org/springframework/http/codec/json/Jackson2Tokenizer.java

3
spring-context/src/main/java/org/springframework/context/annotation/DeferredImportSelector.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2019 the original author or authors. * Copyright 2002-2020 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.
@ -51,6 +51,7 @@ public interface DeferredImportSelector extends ImportSelector {
/** /**
* Interface used to group results from different import selectors. * Interface used to group results from different import selectors.
* @since 5.0
*/ */
interface Group { interface Group {

3
spring-context/src/main/java/org/springframework/context/annotation/ImportSelector.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2020 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.
@ -50,6 +50,7 @@ public interface ImportSelector {
/** /**
* Select and return the names of which class(es) should be imported based on * Select and return the names of which class(es) should be imported based on
* the {@link AnnotationMetadata} of the importing @{@link Configuration} class. * the {@link AnnotationMetadata} of the importing @{@link Configuration} class.
* @return the class names, or an empty array if none
*/ */
String[] selectImports(AnnotationMetadata importingClassMetadata); String[] selectImports(AnnotationMetadata importingClassMetadata);

8
spring-jdbc/src/main/java/org/springframework/jdbc/datasource/init/DatabasePopulatorUtils.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2017 the original author or authors. * Copyright 2002-2020 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.
@ -51,10 +51,10 @@ public abstract class DatabasePopulatorUtils {
DataSourceUtils.releaseConnection(connection, dataSource); DataSourceUtils.releaseConnection(connection, dataSource);
} }
} }
catch (ScriptException ex) {
throw ex;
}
catch (Throwable ex) { catch (Throwable ex) {
if (ex instanceof ScriptException) {
throw (ScriptException) ex;
}
throw new UncategorizedScriptException("Failed to execute database script", ex); throw new UncategorizedScriptException("Failed to execute database script", ex);
} }
} }

7
spring-web/src/main/java/org/springframework/http/codec/json/AbstractJackson2Decoder.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2018 the original author or authors. * Copyright 2002-2020 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.
@ -128,7 +128,7 @@ public abstract class AbstractJackson2Decoder extends Jackson2CodecSupport imple
} }
// HttpMessageDecoder... // HttpMessageDecoder
@Override @Override
public Map<String, Object> getDecodeHints(ResolvableType actualType, ResolvableType elementType, public Map<String, Object> getDecodeHints(ResolvableType actualType, ResolvableType elementType,
@ -142,7 +142,8 @@ public abstract class AbstractJackson2Decoder extends Jackson2CodecSupport imple
return getMimeTypes(); return getMimeTypes();
} }
// Jackson2CodecSupport ...
// Jackson2CodecSupport
@Override @Override
protected <A extends Annotation> A getAnnotation(MethodParameter parameter, Class<A> annotType) { protected <A extends Annotation> A getAnnotation(MethodParameter parameter, Class<A> annotType) {

11
spring-web/src/main/java/org/springframework/http/codec/json/AbstractJackson2Encoder.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2018 the original author or authors. * Copyright 2002-2020 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.
@ -170,7 +170,7 @@ public abstract class AbstractJackson2Encoder extends Jackson2CodecSupport imple
return buffer; return buffer;
} }
protected ObjectWriter customizeWriter(ObjectWriter writer, @Nullable MimeType mimeType, protected ObjectWriter customizeWriter(ObjectWriter writer, @Nullable MimeType mimeType,
ResolvableType elementType, @Nullable Map<String, Object> hints) { ResolvableType elementType, @Nullable Map<String, Object> hints) {
@ -196,7 +196,7 @@ public abstract class AbstractJackson2Encoder extends Jackson2CodecSupport imple
} }
// HttpMessageEncoder... // HttpMessageEncoder
@Override @Override
public List<MimeType> getEncodableMimeTypes() { public List<MimeType> getEncodableMimeTypes() {
@ -215,11 +215,12 @@ public abstract class AbstractJackson2Encoder extends Jackson2CodecSupport imple
return (actualType != null ? getHints(actualType) : Collections.emptyMap()); return (actualType != null ? getHints(actualType) : Collections.emptyMap());
} }
// Jackson2CodecSupport ...
// Jackson2CodecSupport
@Override @Override
protected <A extends Annotation> A getAnnotation(MethodParameter parameter, Class<A> annotType) { protected <A extends Annotation> A getAnnotation(MethodParameter parameter, Class<A> annotType) {
return parameter.getMethodAnnotation(annotType); return parameter.getMethodAnnotation(annotType);
} }
} }

3
spring-web/src/main/java/org/springframework/http/codec/json/Jackson2Tokenizer.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2019 the original author or authors. * Copyright 2002-2020 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.
@ -142,7 +142,6 @@ class Jackson2Tokenizer {
result.add(this.tokenBuffer); result.add(this.tokenBuffer);
this.tokenBuffer = new TokenBuffer(this.parser); this.tokenBuffer = new TokenBuffer(this.parser);
} }
} }
private void processTokenArray(JsonToken token, List<TokenBuffer> result) throws IOException { private void processTokenArray(JsonToken token, List<TokenBuffer> result) throws IOException {

Loading…
Cancel
Save