Browse Source

Polishing

pull/30068/head
Sam Brannen 2 years ago
parent
commit
56523d5014
  1. 2
      spring-aop/src/main/java/org/springframework/aop/framework/ReflectiveMethodInvocation.java
  2. 3
      spring-core-test/src/main/java/org/springframework/aot/agent/HintType.java
  3. 3
      spring-core-test/src/main/java/org/springframework/aot/agent/InstrumentedBridgeMethods.java
  4. 8
      spring-core-test/src/main/java/org/springframework/aot/agent/RecordedInvocation.java
  5. 2
      spring-core-test/src/main/java/org/springframework/core/test/tools/ClassFile.java
  6. 1
      spring-core-test/src/main/java/org/springframework/core/test/tools/ClassFiles.java
  7. 1
      spring-core-test/src/main/java/org/springframework/core/test/tools/CompileWithForkedClassLoaderClassLoader.java
  8. 1
      spring-core-test/src/main/java/org/springframework/core/test/tools/DynamicClassLoader.java
  9. 1
      spring-core-test/src/main/java/org/springframework/core/test/tools/DynamicFile.java
  10. 1
      spring-core-test/src/main/java/org/springframework/core/test/tools/DynamicFileAssert.java
  11. 1
      spring-core-test/src/main/java/org/springframework/core/test/tools/DynamicFiles.java
  12. 1
      spring-core-test/src/main/java/org/springframework/core/test/tools/DynamicJavaFileManager.java
  13. 1
      spring-core-test/src/main/java/org/springframework/core/test/tools/ResourceFile.java
  14. 5
      spring-core-test/src/main/java/org/springframework/core/test/tools/ResourceFileAssert.java
  15. 3
      spring-core-test/src/main/java/org/springframework/core/test/tools/SourceFile.java
  16. 3
      spring-core-test/src/main/java/org/springframework/core/test/tools/SourceFileAssert.java
  17. 2
      spring-core/src/main/java/org/springframework/core/annotation/AnnotationAwareOrderComparator.java
  18. 2
      spring-core/src/main/java/org/springframework/core/codec/Decoder.java
  19. 2
      spring-core/src/main/java/org/springframework/core/convert/support/ObjectToOptionalConverter.java

2
spring-aop/src/main/java/org/springframework/aop/framework/ReflectiveMethodInvocation.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2021 the original author or authors.
* Copyright 2002-2023 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.

3
spring-core-test/src/main/java/org/springframework/aot/agent/HintType.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-2023 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.
@ -16,7 +16,6 @@ @@ -16,7 +16,6 @@
package org.springframework.aot.agent;
import org.springframework.aot.hint.JavaSerializationHint;
import org.springframework.aot.hint.JdkProxyHint;
import org.springframework.aot.hint.ReflectionHints;

3
spring-core-test/src/main/java/org/springframework/aot/agent/InstrumentedBridgeMethods.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-2023 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.
@ -33,7 +33,6 @@ import java.util.stream.Stream; @@ -33,7 +33,6 @@ import java.util.stream.Stream;
import org.springframework.lang.Nullable;
/**
* Instrumented version of JDK methods to be used by bytecode rewritten by the {@link RuntimeHintsAgent}.
* <p>Methods implemented here follow a specific naming pattern "lowercase type name + bridged method name",

8
spring-core-test/src/main/java/org/springframework/aot/agent/RecordedInvocation.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-2023 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.
@ -176,13 +176,13 @@ public final class RecordedInvocation { @@ -176,13 +176,13 @@ public final class RecordedInvocation {
@Override
public String toString() {
if(isStatic()) {
return String.format("<%s> invocation of <%s> with arguments %s",
if (isStatic()) {
return "<%s> invocation of <%s> with arguments %s".formatted(
getHintType().hintClassName(), getMethodReference(), getArguments());
}
else {
Class<?> instanceType = (getInstance() instanceof Class<?>) ? getInstance() : getInstance().getClass();
return String.format("<%s> invocation of <%s> on type <%s> with arguments %s",
return "<%s> invocation of <%s> on type <%s> with arguments %s".formatted(
getHintType().hintClassName(), getMethodReference(), instanceType.getCanonicalName(), getArguments());
}
}

2
spring-core-test/src/main/java/org/springframework/core/test/tools/ClassFile.java

@ -36,11 +36,13 @@ public final class ClassFile { @@ -36,11 +36,13 @@ public final class ClassFile {
private final byte[] content;
private ClassFile(String name, byte[] content) {
this.name = name;
this.content = content;
}
/**
* Return the fully qualified name of the class.
* @return the class name

1
spring-core-test/src/main/java/org/springframework/core/test/tools/ClassFiles.java

@ -35,6 +35,7 @@ public final class ClassFiles implements Iterable<ClassFile> { @@ -35,6 +35,7 @@ public final class ClassFiles implements Iterable<ClassFile> {
private static final ClassFiles NONE = new ClassFiles(Collections.emptyMap());
private final Map<String, ClassFile> files;
private ClassFiles(Map<String, ClassFile> files) {

1
spring-core-test/src/main/java/org/springframework/core/test/tools/CompileWithForkedClassLoaderClassLoader.java

@ -45,6 +45,7 @@ final class CompileWithForkedClassLoaderClassLoader extends ClassLoader { @@ -45,6 +45,7 @@ final class CompileWithForkedClassLoaderClassLoader extends ClassLoader {
this.testClassLoader = testClassLoader;
}
// Invoked reflectively by DynamicClassLoader
@SuppressWarnings("unused")
void setClassResourceLookup(Function<String, byte[]> classResourceLookup) {

1
spring-core-test/src/main/java/org/springframework/core/test/tools/DynamicClassLoader.java

@ -93,7 +93,6 @@ public class DynamicClassLoader extends ClassLoader { @@ -93,7 +93,6 @@ public class DynamicClassLoader extends ClassLoader {
}
private Class<?> defineClass(String name, byte[] bytes) {
if (this.defineClassMethod != null) {
return (Class<?>) ReflectionUtils.invokeMethod(this.defineClassMethod,

1
spring-core-test/src/main/java/org/springframework/core/test/tools/DynamicFile.java

@ -32,7 +32,6 @@ import org.springframework.util.Assert; @@ -32,7 +32,6 @@ import org.springframework.util.Assert;
*/
public abstract sealed class DynamicFile permits SourceFile, ResourceFile {
private final String path;
private final String content;

1
spring-core-test/src/main/java/org/springframework/core/test/tools/DynamicFileAssert.java

@ -39,6 +39,7 @@ public class DynamicFileAssert<A extends DynamicFileAssert<A, F>, F extends Dyna @@ -39,6 +39,7 @@ public class DynamicFileAssert<A extends DynamicFileAssert<A, F>, F extends Dyna
super(actual, selfType);
}
/**
* Verify that the actual content is equal to the given one.
* @param content the expected content of the file

1
spring-core-test/src/main/java/org/springframework/core/test/tools/DynamicFiles.java

@ -37,7 +37,6 @@ import org.springframework.lang.Nullable; @@ -37,7 +37,6 @@ import org.springframework.lang.Nullable;
*/
final class DynamicFiles<F extends DynamicFile> implements Iterable<F> {
private static final DynamicFiles<?> NONE = new DynamicFiles<>(Collections.emptyMap());

1
spring-core-test/src/main/java/org/springframework/core/test/tools/DynamicJavaFileManager.java

@ -63,6 +63,7 @@ class DynamicJavaFileManager extends ForwardingJavaFileManager<JavaFileManager> @@ -63,6 +63,7 @@ class DynamicJavaFileManager extends ForwardingJavaFileManager<JavaFileManager>
this.classLoader = classLoader;
}
@Override
public ClassLoader getClassLoader(Location location) {
return this.classLoader;

1
spring-core-test/src/main/java/org/springframework/core/test/tools/ResourceFile.java

@ -33,7 +33,6 @@ import org.springframework.util.FileCopyUtils; @@ -33,7 +33,6 @@ import org.springframework.util.FileCopyUtils;
*/
public final class ResourceFile extends DynamicFile implements AssertProvider<ResourceFileAssert> {
private ResourceFile(String path, String content) {
super(path, content);
}

5
spring-core-test/src/main/java/org/springframework/core/test/tools/ResourceFileAssert.java

@ -22,13 +22,10 @@ package org.springframework.core.test.tools; @@ -22,13 +22,10 @@ package org.springframework.core.test.tools;
* @author Phillip Webb
* @since 6.0
*/
public class ResourceFileAssert
extends DynamicFileAssert<ResourceFileAssert, ResourceFile> {
public class ResourceFileAssert extends DynamicFileAssert<ResourceFileAssert, ResourceFile> {
ResourceFileAssert(ResourceFile actual) {
super(actual, ResourceFileAssert.class);
}
}

3
spring-core-test/src/main/java/org/springframework/core/test/tools/SourceFile.java

@ -61,6 +61,7 @@ public final class SourceFile extends DynamicFile implements AssertProvider<Sour @@ -61,6 +61,7 @@ public final class SourceFile extends DynamicFile implements AssertProvider<Sour
this.className = className;
}
/**
* Factory method to create a new {@link SourceFile} by looking up source
* for the given test {@code Class}.
@ -227,6 +228,4 @@ public final class SourceFile extends DynamicFile implements AssertProvider<Sour @@ -227,6 +228,4 @@ public final class SourceFile extends DynamicFile implements AssertProvider<Sour
return new SourceFileAssert(this);
}
}

3
spring-core-test/src/main/java/org/springframework/core/test/tools/SourceFileAssert.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-2023 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.
@ -24,7 +24,6 @@ package org.springframework.core.test.tools; @@ -24,7 +24,6 @@ package org.springframework.core.test.tools;
*/
public class SourceFileAssert extends DynamicFileAssert<SourceFileAssert, SourceFile> {
SourceFileAssert(SourceFile actual) {
super(actual, SourceFileAssert.class);
}

2
spring-core/src/main/java/org/springframework/core/annotation/AnnotationAwareOrderComparator.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-2023 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.

2
spring-core/src/main/java/org/springframework/core/codec/Decoder.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2021 the original author or authors.
* Copyright 2002-2023 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.

2
spring-core/src/main/java/org/springframework/core/convert/support/ObjectToOptionalConverter.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2023 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.

Loading…
Cancel
Save