language stringclasses 1
value | owner stringlengths 2 15 | repo stringlengths 2 21 | sha stringlengths 45 45 | message stringlengths 7 36.3k | path stringlengths 1 199 | patch stringlengths 15 102k | is_multipart bool 2
classes |
|---|---|---|---|---|---|---|---|
Other | spring-projects | spring-framework | 653dc5951d24fc2c5560cb38314f536a67c3bbbf.json | Add module to support testing of generated code
Add a new unpublished `spring-core-test` module to support testing of
generated code. The module include a `TestCompiler` class which can be
used to dynamically compile generated Java code. It also include an
AssertJ friendly `SourceFile` class which uses qdox to provide... | spring-core-test/src/test/java/org/springframework/aot/test/generator/file/SourceFileTests.java | @@ -0,0 +1,138 @@
+/*
+ * Copyright 2002-2022 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
... | true |
Other | spring-projects | spring-framework | 653dc5951d24fc2c5560cb38314f536a67c3bbbf.json | Add module to support testing of generated code
Add a new unpublished `spring-core-test` module to support testing of
generated code. The module include a `TestCompiler` class which can be
used to dynamically compile generated Java code. It also include an
AssertJ friendly `SourceFile` class which uses qdox to provide... | spring-core-test/src/test/java/org/springframework/aot/test/generator/file/SourceFilesTests.java | @@ -0,0 +1,135 @@
+/*
+ * Copyright 2002-2022 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
... | true |
Other | spring-projects | spring-framework | ec6a19fc6b37ef03d2667100a2ee9de1488c902d.json | Add BeanFactoryContribution for bean registrations
This commits adds an implementation that takes care of contributing
code for each bean definition in the bean factory, invoking
BeanRegistrationContributionProvider to determine the best candidate to
use.
Closes gh-28088 | spring-beans/src/main/java/org/springframework/beans/factory/generator/BeanDefinitionGenerationException.java | @@ -0,0 +1,62 @@
+/*
+ * Copyright 2002-2022 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+... | true |
Other | spring-projects | spring-framework | ec6a19fc6b37ef03d2667100a2ee9de1488c902d.json | Add BeanFactoryContribution for bean registrations
This commits adds an implementation that takes care of contributing
code for each bean definition in the bean factory, invoking
BeanRegistrationContributionProvider to determine the best candidate to
use.
Closes gh-28088 | spring-beans/src/main/java/org/springframework/beans/factory/generator/BeanDefinitionsContribution.java | @@ -0,0 +1,111 @@
+/*
+ * Copyright 2002-2022 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
... | true |
Other | spring-projects | spring-framework | ec6a19fc6b37ef03d2667100a2ee9de1488c902d.json | Add BeanFactoryContribution for bean registrations
This commits adds an implementation that takes care of contributing
code for each bean definition in the bean factory, invoking
BeanRegistrationContributionProvider to determine the best candidate to
use.
Closes gh-28088 | spring-beans/src/main/java/org/springframework/beans/factory/generator/BeanRegistrationContributionNotFoundException.java | @@ -0,0 +1,37 @@
+/*
+ * Copyright 2002-2022 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+... | true |
Other | spring-projects | spring-framework | ec6a19fc6b37ef03d2667100a2ee9de1488c902d.json | Add BeanFactoryContribution for bean registrations
This commits adds an implementation that takes care of contributing
code for each bean definition in the bean factory, invoking
BeanRegistrationContributionProvider to determine the best candidate to
use.
Closes gh-28088 | spring-beans/src/test/java/org/springframework/beans/factory/generator/BeanDefinitionsContributionTests.java | @@ -0,0 +1,122 @@
+/*
+ * Copyright 2002-2022 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
... | true |
Other | spring-projects | spring-framework | fd191d165bb6c886d8c3720c96240441f89d75cd.json | Add GeneratedType infrastructure
This commit adds an infrastructure for code that generate types with the
need to write to another package if privileged access is required. An
abstraction around types where methods can be easily added is also
available as part of this commit.
Closes gh-28149 | spring-core/src/main/java/org/springframework/aot/generator/DefaultGeneratedTypeContext.java | @@ -0,0 +1,92 @@
+/*
+ * Copyright 2002-2022 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+... | true |
Other | spring-projects | spring-framework | fd191d165bb6c886d8c3720c96240441f89d75cd.json | Add GeneratedType infrastructure
This commit adds an infrastructure for code that generate types with the
need to write to another package if privileged access is required. An
abstraction around types where methods can be easily added is also
available as part of this commit.
Closes gh-28149 | spring-core/src/main/java/org/springframework/aot/generator/GeneratedType.java | @@ -0,0 +1,125 @@
+/*
+ * Copyright 2002-2022 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
... | true |
Other | spring-projects | spring-framework | fd191d165bb6c886d8c3720c96240441f89d75cd.json | Add GeneratedType infrastructure
This commit adds an infrastructure for code that generate types with the
need to write to another package if privileged access is required. An
abstraction around types where methods can be easily added is also
available as part of this commit.
Closes gh-28149 | spring-core/src/main/java/org/springframework/aot/generator/GeneratedTypeContext.java | @@ -0,0 +1,52 @@
+/*
+ * Copyright 2002-2022 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+... | true |
Other | spring-projects | spring-framework | fd191d165bb6c886d8c3720c96240441f89d75cd.json | Add GeneratedType infrastructure
This commit adds an infrastructure for code that generate types with the
need to write to another package if privileged access is required. An
abstraction around types where methods can be easily added is also
available as part of this commit.
Closes gh-28149 | spring-core/src/test/java/org/springframework/aot/generator/DefaultGeneratedTypeContextTests.java | @@ -0,0 +1,100 @@
+/*
+ * Copyright 2002-2022 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
... | true |
Other | spring-projects | spring-framework | fd191d165bb6c886d8c3720c96240441f89d75cd.json | Add GeneratedType infrastructure
This commit adds an infrastructure for code that generate types with the
need to write to another package if privileged access is required. An
abstraction around types where methods can be easily added is also
available as part of this commit.
Closes gh-28149 | spring-core/src/test/java/org/springframework/aot/generator/GeneratedTypeTests.java | @@ -0,0 +1,129 @@
+/*
+ * Copyright 2002-2022 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
... | true |
Other | spring-projects | spring-framework | c541bde513443862e24e372c83f33e8c511d8903.json | Simplify the generation of inner bean definitions
See gh-28047 | spring-beans/src/main/java/org/springframework/beans/factory/generator/BeanParameterGenerator.java | @@ -24,7 +24,6 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
-import java.util.function.BiConsumer;
import java.util.function.Function;
import java.util.function.Supplier;
import java.util.stream.Collectors;
@@ -52,23 +51,23 @@ public final class BeanParameterGenerator {
private final ... | true |
Other | spring-projects | spring-framework | c541bde513443862e24e372c83f33e8c511d8903.json | Simplify the generation of inner bean definitions
See gh-28047 | spring-beans/src/test/java/org/springframework/beans/factory/generator/BeanParameterGeneratorTests.java | @@ -40,6 +40,7 @@
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.core.ResolvableType;
import org.springframework.core.io.ResourceLoader;
+import org.springframework.javapoet.CodeBlock;
import org.springframework.javapoet.support.CodeSnippet;
import org.springframewo... | true |
Other | spring-projects | spring-framework | 97986b368a42f858a8f6ee84e2ca4a79f17e7410.json | Harmonize use of generate
This commit harmonizes the use of the "generate" keyword for anything
related to code generation. Previously, there was a mix of "generate"
and "write."
See gh-28047 | spring-beans/src/main/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessor.java | @@ -838,7 +838,7 @@ public void applyTo(CodeContribution contribution) {
boolean isRequired = isRequired(element);
Member member = element.getMember();
analyzeMember(contribution, member);
- contribution.statements().addStatement(this.generator.writeInjection(member, isRequired));
+ contribution.st... | true |
Other | spring-projects | spring-framework | 97986b368a42f858a8f6ee84e2ca4a79f17e7410.json | Harmonize use of generate
This commit harmonizes the use of the "generate" keyword for anything
related to code generation. Previously, there was a mix of "generate"
and "write."
See gh-28047 | spring-beans/src/main/java/org/springframework/beans/factory/generator/BeanParameterGenerator.java | @@ -43,7 +43,7 @@
import org.springframework.util.ObjectUtils;
/**
- * Support for writing parameters.
+ * Support for generating parameters.
*
* @author Stephane Nicoll
* @since 6.0
@@ -52,16 +52,16 @@ public final class BeanParameterGenerator {
private final ResolvableTypeGenerator typeGenerator = new R... | true |
Other | spring-projects | spring-framework | 97986b368a42f858a8f6ee84e2ca4a79f17e7410.json | Harmonize use of generate
This commit harmonizes the use of the "generate" keyword for anything
related to code generation. Previously, there was a mix of "generate"
and "write."
See gh-28047 | spring-beans/src/main/java/org/springframework/beans/factory/generator/DefaultBeanInstantiationGenerator.java | @@ -33,7 +33,7 @@
import org.springframework.util.ClassUtils;
/**
- * Write the necessary statements to instantiate a bean.
+ * Generate the necessary statements to instantiate a bean.
*
* @author Stephane Nicoll
* @see BeanInstantiationContribution
@@ -64,18 +64,18 @@ class DefaultBeanInstantiationGenerator ... | true |
Other | spring-projects | spring-framework | 97986b368a42f858a8f6ee84e2ca4a79f17e7410.json | Harmonize use of generate
This commit harmonizes the use of the "generate" keyword for anything
related to code generation. Previously, there was a mix of "generate"
and "write."
See gh-28047 | spring-beans/src/main/java/org/springframework/beans/factory/generator/InjectionGenerator.java | @@ -37,8 +37,8 @@
import org.springframework.util.ReflectionUtils;
/**
- * Generate the necessary code to {@link #writeInstantiation(Executable)
- * create a bean instance} or {@link #writeInjection(Member, boolean)
+ * Generate the necessary code to {@link #generateInstantiation(Executable)
+ * create a bean insta... | true |
Other | spring-projects | spring-framework | 97986b368a42f858a8f6ee84e2ca4a79f17e7410.json | Harmonize use of generate
This commit harmonizes the use of the "generate" keyword for anything
related to code generation. Previously, there was a mix of "generate"
and "write."
See gh-28047 | spring-beans/src/test/java/org/springframework/beans/factory/generator/BeanParameterGeneratorTests.java | @@ -41,6 +41,7 @@
import org.springframework.core.ResolvableType;
import org.springframework.core.io.ResourceLoader;
import org.springframework.javapoet.support.CodeSnippet;
+import org.springframework.lang.Nullable;
import org.springframework.util.ReflectionUtils;
import static org.assertj.core.api.Assertions.a... | true |
Other | spring-projects | spring-framework | 97986b368a42f858a8f6ee84e2ca4a79f17e7410.json | Harmonize use of generate
This commit harmonizes the use of the "generate" keyword for anything
related to code generation. Previously, there was a mix of "generate"
and "write."
See gh-28047 | spring-beans/src/test/java/org/springframework/beans/factory/generator/InjectionGeneratorTests.java | @@ -45,119 +45,119 @@ class InjectionGeneratorTests {
private final ProtectedAccess protectedAccess = new ProtectedAccess();
@Test
- void writeInstantiationForConstructorWithNoArgUseShortcut() {
+ void generateInstantiationForConstructorWithNoArgUseShortcut() {
Constructor<?> constructor = SimpleBean.class.get... | true |
Other | spring-projects | spring-framework | 572d0173703e15a80e76eac2ad0bea9c56f35326.json | Add missing package-info
See gh-28047 | spring-beans/src/main/java/org/springframework/beans/factory/generator/package-info.java | @@ -0,0 +1,9 @@
+/**
+ * Support for generating code that represents the state of a bean factory.
+ */
+@NonNullApi
+@NonNullFields
+package org.springframework.beans.factory.generator;
+
+import org.springframework.lang.NonNullApi;
+import org.springframework.lang.NonNullFields; | false |
Other | spring-projects | spring-framework | 1be3eecb2a088af4c5b9bc44c8a68cc724074be3.json | Replace KotlinBodySpec with extensions function
Prior to this commit, the ResponseSpec::expectBody extension function
returned a special KotlinBodySpec, due to
https://youtrack.jetbrains.com/issue/KT-5464.
Now that KT-5464 has been fixed in Kotlin 1.6, we have no need for
KotlinBodySpec, so this commit replaces it wi... | spring-test/src/main/kotlin/org/springframework/test/web/reactive/server/WebTestClientExtensions.kt | @@ -19,7 +19,6 @@ package org.springframework.test.web.reactive.server
import kotlinx.coroutines.flow.Flow
import org.reactivestreams.Publisher
import org.springframework.core.ParameterizedTypeReference
-import org.springframework.test.util.AssertionErrors.assertEquals
import org.springframework.test.web.reactive.s... | false |
Other | spring-projects | spring-framework | a2f02dbfc04d5d7463612848067bdde26c84b743.json | Improve documentation for TestContext events
This commit improves the documentation for test execution events,
especially with regard to the fact that, by default, a
BeforeTestClassEvent is not published for the first test class using a
particular ApplicationContext.
This commit also introduces tests that verify the ... | spring-test/src/main/java/org/springframework/test/context/event/EventPublishingTestExecutionListener.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2019 the original author or authors.
+ * Copyright 2002-2022 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.
@@ -17,16 +17,12 @@
package org.springframewor... | true |
Other | spring-projects | spring-framework | a2f02dbfc04d5d7463612848067bdde26c84b743.json | Improve documentation for TestContext events
This commit improves the documentation for test execution events,
especially with regard to the fact that, by default, a
BeforeTestClassEvent is not published for the first test class using a
particular ApplicationContext.
This commit also introduces tests that verify the ... | spring-test/src/main/java/org/springframework/test/context/event/annotation/AfterTestClass.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2019 the original author or authors.
+ * Copyright 2002-2022 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.
@@ -49,6 +49,8 @@
* <p>The {@code EventPublis... | true |
Other | spring-projects | spring-framework | a2f02dbfc04d5d7463612848067bdde26c84b743.json | Improve documentation for TestContext events
This commit improves the documentation for test execution events,
especially with regard to the fact that, by default, a
BeforeTestClassEvent is not published for the first test class using a
particular ApplicationContext.
This commit also introduces tests that verify the ... | spring-test/src/main/java/org/springframework/test/context/event/annotation/AfterTestExecution.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2019 the original author or authors.
+ * Copyright 2002-2022 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.
@@ -49,6 +49,8 @@
* <p>The {@code EventPublis... | true |
Other | spring-projects | spring-framework | a2f02dbfc04d5d7463612848067bdde26c84b743.json | Improve documentation for TestContext events
This commit improves the documentation for test execution events,
especially with regard to the fact that, by default, a
BeforeTestClassEvent is not published for the first test class using a
particular ApplicationContext.
This commit also introduces tests that verify the ... | spring-test/src/main/java/org/springframework/test/context/event/annotation/AfterTestMethod.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2019 the original author or authors.
+ * Copyright 2002-2022 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.
@@ -49,6 +49,8 @@
* <p>The {@code EventPublis... | true |
Other | spring-projects | spring-framework | a2f02dbfc04d5d7463612848067bdde26c84b743.json | Improve documentation for TestContext events
This commit improves the documentation for test execution events,
especially with regard to the fact that, by default, a
BeforeTestClassEvent is not published for the first test class using a
particular ApplicationContext.
This commit also introduces tests that verify the ... | spring-test/src/main/java/org/springframework/test/context/event/annotation/BeforeTestClass.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2019 the original author or authors.
+ * Copyright 2002-2022 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.
@@ -49,6 +49,8 @@
* <p>The {@code EventPublis... | true |
Other | spring-projects | spring-framework | a2f02dbfc04d5d7463612848067bdde26c84b743.json | Improve documentation for TestContext events
This commit improves the documentation for test execution events,
especially with regard to the fact that, by default, a
BeforeTestClassEvent is not published for the first test class using a
particular ApplicationContext.
This commit also introduces tests that verify the ... | spring-test/src/main/java/org/springframework/test/context/event/annotation/BeforeTestExecution.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2019 the original author or authors.
+ * Copyright 2002-2022 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.
@@ -49,6 +49,8 @@
* <p>The {@code EventPublis... | true |
Other | spring-projects | spring-framework | a2f02dbfc04d5d7463612848067bdde26c84b743.json | Improve documentation for TestContext events
This commit improves the documentation for test execution events,
especially with regard to the fact that, by default, a
BeforeTestClassEvent is not published for the first test class using a
particular ApplicationContext.
This commit also introduces tests that verify the ... | spring-test/src/main/java/org/springframework/test/context/event/annotation/BeforeTestMethod.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2019 the original author or authors.
+ * Copyright 2002-2022 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.
@@ -49,6 +49,8 @@
* <p>The {@code EventPublis... | true |
Other | spring-projects | spring-framework | a2f02dbfc04d5d7463612848067bdde26c84b743.json | Improve documentation for TestContext events
This commit improves the documentation for test execution events,
especially with regard to the fact that, by default, a
BeforeTestClassEvent is not published for the first test class using a
particular ApplicationContext.
This commit also introduces tests that verify the ... | spring-test/src/main/java/org/springframework/test/context/event/annotation/PrepareTestInstance.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2019 the original author or authors.
+ * Copyright 2002-2022 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.
@@ -49,6 +49,8 @@
* <p>The {@code EventPublis... | true |
Other | spring-projects | spring-framework | a2f02dbfc04d5d7463612848067bdde26c84b743.json | Improve documentation for TestContext events
This commit improves the documentation for test execution events,
especially with regard to the fact that, by default, a
BeforeTestClassEvent is not published for the first test class using a
particular ApplicationContext.
This commit also introduces tests that verify the ... | spring-test/src/main/java/org/springframework/test/context/event/annotation/package-info.java | @@ -1,4 +1,4 @@
/**
- * Test event annotations for the <em>Spring TestContext Framework</em>.
+ * Test execution event annotations for the <em>Spring TestContext Framework</em>.
*/
package org.springframework.test.context.event.annotation; | true |
Other | spring-projects | spring-framework | a2f02dbfc04d5d7463612848067bdde26c84b743.json | Improve documentation for TestContext events
This commit improves the documentation for test execution events,
especially with regard to the fact that, by default, a
BeforeTestClassEvent is not published for the first test class using a
particular ApplicationContext.
This commit also introduces tests that verify the ... | spring-test/src/test/java/org/springframework/test/context/event/EagerTestExecutionEventPublishingTests.java | @@ -0,0 +1,190 @@
+/*
+ * Copyright 2002-2022 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
... | true |
Other | spring-projects | spring-framework | a2f02dbfc04d5d7463612848067bdde26c84b743.json | Improve documentation for TestContext events
This commit improves the documentation for test execution events,
especially with regard to the fact that, by default, a
BeforeTestClassEvent is not published for the first test class using a
particular ApplicationContext.
This commit also introduces tests that verify the ... | src/docs/asciidoc/testing.adoc | @@ -2672,15 +2672,35 @@ test's `ApplicationContext` can listen to the following events published by the
* `AfterTestMethodEvent`
* `AfterTestClassEvent`
-NOTE: These events are only published if the `ApplicationContext` has already been loaded.
-
These events may be consumed for various reasons, such as resetting ... | true |
Other | spring-projects | spring-framework | bc973d70016602e62ce9d8b9f8c712b05e67d69d.json | Fix broken link to "CORS WebFilter" in ref docs | src/docs/asciidoc/web/webflux.adoc | @@ -676,8 +676,7 @@ Spring WebFlux provides fine-grained support for CORS configuration through anno
controllers. However, when you use it with Spring Security, we advise relying on the built-in
`CorsFilter`, which must be ordered ahead of Spring Security's chain of filters.
-See the section on <<webflux-cors>> and... | false |
Other | spring-projects | spring-framework | 66e9095ee9b9293a1879f47326ca5c666f7414dc.json | Fix links and tests broken during merge
See gh-28083 | spring-beans/src/main/java/org/springframework/beans/factory/support/RootBeanDefinition.java | @@ -461,7 +461,7 @@ public Set<Member> getExternallyManagedConfigMembers() {
/**
* Register an externally managed configuration initialization method —
* for example, a method annotated with JSR-250's
- * {@link javax.annotation.PostConstruct} annotation.
+ * {@link jakarta.annotation.PostConstruct} ann... | true |
Other | spring-projects | spring-framework | 66e9095ee9b9293a1879f47326ca5c666f7414dc.json | Fix links and tests broken during merge
See gh-28083 | spring-context/src/test/java/org/springframework/context/annotation/InitDestroyMethodLifecycleTests.java | @@ -19,9 +19,8 @@
import java.util.ArrayList;
import java.util.List;
-import javax.annotation.PostConstruct;
-import javax.annotation.PreDestroy;
-
+import jakarta.annotation.PostConstruct;
+import jakarta.annotation.PreDestroy;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.Disposa... | true |
Other | spring-projects | spring-framework | 66e9095ee9b9293a1879f47326ca5c666f7414dc.json | Fix links and tests broken during merge
See gh-28083 | spring-context/src/test/java/org/springframework/context/annotation/Spr3775InitDestroyLifecycleTests.java | @@ -1,259 +0,0 @@
-/*
- * Copyright 2002-2022 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
... | true |
Other | spring-projects | spring-framework | af14eea1ef76576acd07ba90cd0a656bd6b31969.json | Introduce tests for gh-28083 | spring-context/src/test/java/org/springframework/context/annotation/Spr3775InitDestroyLifecycleTests.java | @@ -149,6 +149,30 @@ public void testJsr250AnnotationsWithShadowedMethods() {
bean.destroyMethods);
}
+ @Test
+ public void testJsr250AnnotationsWithCustomPrivateInitDestroyMethods() {
+ Class<?> beanClass = CustomAnnotatedPrivateInitDestroyBean.class;
+ DefaultListableBeanFactory beanFactory = createBeanFac... | false |
Other | spring-projects | spring-framework | 3efedef161038bff3e5d88f5ab36f3527f468b1f.json | Add ErrorResponse and ErrorResponseException
ErrorResponse represents a complete error response with status, headers,
and an RFC 7807 ProblemDetail body.
ErrorResponseException implements ErrorResponse and is usable on its
own or as a base class. ResponseStatusException extends
ErrorResponseException and now also su... | spring-web/src/main/java/org/springframework/web/ErrorResponse.java | @@ -0,0 +1,71 @@
+/*
+ * Copyright 2002-2022 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+... | true |
Other | spring-projects | spring-framework | 3efedef161038bff3e5d88f5ab36f3527f468b1f.json | Add ErrorResponse and ErrorResponseException
ErrorResponse represents a complete error response with status, headers,
and an RFC 7807 ProblemDetail body.
ErrorResponseException implements ErrorResponse and is usable on its
own or as a base class. ResponseStatusException extends
ErrorResponseException and now also su... | spring-web/src/main/java/org/springframework/web/ErrorResponseException.java | @@ -0,0 +1,156 @@
+/*
+ * Copyright 2002-2022 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
... | true |
Other | spring-projects | spring-framework | 3efedef161038bff3e5d88f5ab36f3527f468b1f.json | Add ErrorResponse and ErrorResponseException
ErrorResponse represents a complete error response with status, headers,
and an RFC 7807 ProblemDetail body.
ErrorResponseException implements ErrorResponse and is usable on its
own or as a base class. ResponseStatusException extends
ErrorResponseException and now also su... | spring-web/src/main/java/org/springframework/web/server/MethodNotAllowedException.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2021 the original author or authors.
+ * Copyright 2002-2022 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.
@@ -58,11 +58,11 @@ public MethodNotAllowedExce... | true |
Other | spring-projects | spring-framework | 3efedef161038bff3e5d88f5ab36f3527f468b1f.json | Add ErrorResponse and ErrorResponseException
ErrorResponse represents a complete error response with status, headers,
and an RFC 7807 ProblemDetail body.
ErrorResponseException implements ErrorResponse and is usable on its
own or as a base class. ResponseStatusException extends
ErrorResponseException and now also su... | spring-web/src/main/java/org/springframework/web/server/NotAcceptableStatusException.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2021 the original author or authors.
+ * Copyright 2002-2022 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.
@@ -54,11 +54,11 @@ public NotAcceptableStatusE... | true |
Other | spring-projects | spring-framework | 3efedef161038bff3e5d88f5ab36f3527f468b1f.json | Add ErrorResponse and ErrorResponseException
ErrorResponse represents a complete error response with status, headers,
and an RFC 7807 ProblemDetail body.
ErrorResponseException implements ErrorResponse and is usable on its
own or as a base class. ResponseStatusException extends
ErrorResponseException and now also su... | spring-web/src/main/java/org/springframework/web/server/ResponseStatusException.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2021 the original author or authors.
+ * Copyright 2002-2022 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.
@@ -17,23 +17,21 @@
package org.springframewor... | true |
Other | spring-projects | spring-framework | 3efedef161038bff3e5d88f5ab36f3527f468b1f.json | Add ErrorResponse and ErrorResponseException
ErrorResponse represents a complete error response with status, headers,
and an RFC 7807 ProblemDetail body.
ErrorResponseException implements ErrorResponse and is usable on its
own or as a base class. ResponseStatusException extends
ErrorResponseException and now also su... | spring-web/src/main/java/org/springframework/web/server/UnsupportedMediaTypeStatusException.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2021 the original author or authors.
+ * Copyright 2002-2022 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.
@@ -91,16 +91,17 @@ public UnsupportedMediaType... | true |
Other | spring-projects | spring-framework | 3efedef161038bff3e5d88f5ab36f3527f468b1f.json | Add ErrorResponse and ErrorResponseException
ErrorResponse represents a complete error response with status, headers,
and an RFC 7807 ProblemDetail body.
ErrorResponseException implements ErrorResponse and is usable on its
own or as a base class. ResponseStatusException extends
ErrorResponseException and now also su... | spring-web/src/main/java/org/springframework/web/server/handler/ResponseStatusExceptionHandler.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2021 the original author or authors.
+ * Copyright 2002-2022 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.
@@ -95,9 +95,8 @@ private boolean updateRespons... | true |
Other | spring-projects | spring-framework | 3efedef161038bff3e5d88f5ab36f3527f468b1f.json | Add ErrorResponse and ErrorResponseException
ErrorResponse represents a complete error response with status, headers,
and an RFC 7807 ProblemDetail body.
ErrorResponseException implements ErrorResponse and is usable on its
own or as a base class. ResponseStatusException extends
ErrorResponseException and now also su... | spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/ResponseEntityResultHandler.java | @@ -37,14 +37,15 @@
import org.springframework.http.codec.HttpMessageWriter;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
+import org.springframework.web.ErrorResponse;
import org.springframework.web.reactive.HandlerResult;
import org.springframework.web.reactive.HandlerResultH... | true |
Other | spring-projects | spring-framework | 3efedef161038bff3e5d88f5ab36f3527f468b1f.json | Add ErrorResponse and ErrorResponseException
ErrorResponse represents a complete error response with status, headers,
and an RFC 7807 ProblemDetail body.
ErrorResponseException implements ErrorResponse and is usable on its
own or as a base class. ResponseStatusException extends
ErrorResponseException and now also su... | spring-webflux/src/test/java/org/springframework/web/reactive/result/method/RequestMappingInfoHandlerMappingTests.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2021 the original author or authors.
+ * Copyright 2002-2022 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.
@@ -330,7 +330,7 @@ public void handlePatchUnsu... | true |
Other | spring-projects | spring-framework | 3efedef161038bff3e5d88f5ab36f3527f468b1f.json | Add ErrorResponse and ErrorResponseException
ErrorResponse represents a complete error response with status, headers,
and an RFC 7807 ProblemDetail body.
ErrorResponseException implements ErrorResponse and is usable on its
own or as a base class. ResponseStatusException extends
ErrorResponseException and now also su... | spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/ResponseEntityResultHandlerTests.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2021 the original author or authors.
+ * Copyright 2002-2022 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.
@@ -55,6 +55,8 @@
import org.springframework.h... | true |
Other | spring-projects | spring-framework | 3efedef161038bff3e5d88f5ab36f3527f468b1f.json | Add ErrorResponse and ErrorResponseException
ErrorResponse represents a complete error response with status, headers,
and an RFC 7807 ProblemDetail body.
ErrorResponseException implements ErrorResponse and is usable on its
own or as a base class. ResponseStatusException extends
ErrorResponseException and now also su... | spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/annotation/ResponseStatusExceptionResolver.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2020 the original author or authors.
+ * Copyright 2002-2022 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.
@@ -116,7 +116,7 @@ protected ModelAndView reso... | true |
Other | spring-projects | spring-framework | 3efedef161038bff3e5d88f5ab36f3527f468b1f.json | Add ErrorResponse and ErrorResponseException
ErrorResponse represents a complete error response with status, headers,
and an RFC 7807 ProblemDetail body.
ErrorResponseException implements ErrorResponse and is usable on its
own or as a base class. ResponseStatusException extends
ErrorResponseException and now also su... | spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/HttpEntityMethodProcessor.java | @@ -44,6 +44,7 @@
import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
+import org.springframework.web.ErrorResponse;
import org.springframework.web.HttpMediaTypeNotSupportedException;
import org.springframework.web.accept.ContentNego... | true |
Other | spring-projects | spring-framework | 3efedef161038bff3e5d88f5ab36f3527f468b1f.json | Add ErrorResponse and ErrorResponseException
ErrorResponse represents a complete error response with status, headers,
and an RFC 7807 ProblemDetail body.
ErrorResponseException implements ErrorResponse and is usable on its
own or as a base class. ResponseStatusException extends
ErrorResponseException and now also su... | spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/HttpEntityMethodProcessorMockTests.java | @@ -52,6 +52,8 @@
import org.springframework.http.ResponseEntity;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.HttpMessageNotWritableException;
+import org.springframework.web.ErrorResponse;
+import org.springframework.web.ErrorResponseException;
import o... | true |
Other | spring-projects | spring-framework | 714d4512607d87a1d187d57b10ca9d1e336dbd84.json | Add ProblemDetail and `@ExceptionHandler` support
ProblemDetail is a representation of an RFC 7807 "problem", and this
commits adds support for it in Spring MVC and WebFlux as a return value
from `@ExceptionHandler` methods, optionally wrapped with
ResponseEntity for headers.
See gh-27052 | spring-web/src/main/java/org/springframework/http/ProblemDetail.java | @@ -0,0 +1,279 @@
+/*
+ * Copyright 2002-2022 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
... | true |
Other | spring-projects | spring-framework | 714d4512607d87a1d187d57b10ca9d1e336dbd84.json | Add ProblemDetail and `@ExceptionHandler` support
ProblemDetail is a representation of an RFC 7807 "problem", and this
commits adds support for it in Spring MVC and WebFlux as a return value
from `@ExceptionHandler` methods, optionally wrapped with
ResponseEntity for headers.
See gh-27052 | spring-web/src/main/java/org/springframework/http/ResponseEntity.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2021 the original author or authors.
+ * Copyright 2002-2022 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.
@@ -260,6 +260,27 @@ public static <T> Response... | true |
Other | spring-projects | spring-framework | 714d4512607d87a1d187d57b10ca9d1e336dbd84.json | Add ProblemDetail and `@ExceptionHandler` support
ProblemDetail is a representation of an RFC 7807 "problem", and this
commits adds support for it in Spring MVC and WebFlux as a return value
from `@ExceptionHandler` methods, optionally wrapped with
ResponseEntity for headers.
See gh-27052 | spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/ResponseEntityResultHandler.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2021 the original author or authors.
+ * Copyright 2002-2022 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,6 +16,7 @@
package org.springframewor... | true |
Other | spring-projects | spring-framework | 714d4512607d87a1d187d57b10ca9d1e336dbd84.json | Add ProblemDetail and `@ExceptionHandler` support
ProblemDetail is a representation of an RFC 7807 "problem", and this
commits adds support for it in Spring MVC and WebFlux as a return value
from `@ExceptionHandler` methods, optionally wrapped with
ResponseEntity for headers.
See gh-27052 | spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/ResponseEntityResultHandlerTests.java | @@ -46,6 +46,7 @@
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
+import org.springframework.http.ProblemDetail;
import org.springframework.http.ResponseEntity;
import org.springframework.http.codec.EncoderHttpMessageWriter;
impor... | true |
Other | spring-projects | spring-framework | 714d4512607d87a1d187d57b10ca9d1e336dbd84.json | Add ProblemDetail and `@ExceptionHandler` support
ProblemDetail is a representation of an RFC 7807 "problem", and this
commits adds support for it in Spring MVC and WebFlux as a return value
from `@ExceptionHandler` methods, optionally wrapped with
ResponseEntity for headers.
See gh-27052 | spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/HttpEntityMethodProcessor.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2021 the original author or authors.
+ * Copyright 2002-2022 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.
@@ -19,6 +19,7 @@
import java.io.IOException;
... | true |
Other | spring-projects | spring-framework | 714d4512607d87a1d187d57b10ca9d1e336dbd84.json | Add ProblemDetail and `@ExceptionHandler` support
ProblemDetail is a representation of an RFC 7807 "problem", and this
commits adds support for it in Spring MVC and WebFlux as a return value
from `@ExceptionHandler` methods, optionally wrapped with
ResponseEntity for headers.
See gh-27052 | spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/HttpEntityMethodProcessorMockTests.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2021 the original author or authors.
+ * Copyright 2002-2022 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.
@@ -31,6 +31,7 @@
import java.util.Set;
imp... | true |
Other | spring-projects | spring-framework | 453c6d41f71acc54bb3928f9c7b9787d29e84a43.json | Fix Objenesis version
See gh-28100 | src/docs/dist/license.txt | @@ -255,10 +255,10 @@ CGLIB 3.3 is licensed under the Apache License, version 2.0, the text of which
is included above.
->>> Objenesis 3.1 (org.objenesis:objenesis:3.1):
+>>> Objenesis 3.2 (org.objenesis:objenesis:3.2):
Per the LICENSE file in the Objenesis ZIP distribution downloaded from
-http://objenesis.org... | false |
Other | spring-projects | spring-framework | c5c926726dc46f5135645d79ddc12c4027e1d061.json | Use enhanced switch expressions where feasible
Closes gh-28014 | spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AspectMetadata.java | @@ -101,24 +101,22 @@ public AspectMetadata(Class<?> aspectClass, String aspectName) {
this.ajType = ajType;
switch (this.ajType.getPerClause().getKind()) {
- case SINGLETON:
+ case SINGLETON -> {
this.perClausePointcut = Pointcut.TRUE;
- return;
- case PERTARGET:
- case PERTHIS:
+ }
+ case ... | true |
Other | spring-projects | spring-framework | c5c926726dc46f5135645d79ddc12c4027e1d061.json | Use enhanced switch expressions where feasible
Closes gh-28014 | spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/InstantiationModelAwarePointcutAdvisorImpl.java | @@ -220,21 +220,18 @@ private void determineAdviceType() {
}
else {
switch (aspectJAnnotation.getAnnotationType()) {
- case AtPointcut:
- case AtAround:
+ case AtPointcut, AtAround -> {
this.isBeforeAdvice = false;
this.isAfterAdvice = false;
- break;
- case AtBefore:
+ }
+ c... | true |
Other | spring-projects | spring-framework | c5c926726dc46f5135645d79ddc12c4027e1d061.json | Use enhanced switch expressions where feasible
Closes gh-28014 | spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/ReflectiveAspectJAdvisorFactory.java | @@ -261,42 +261,36 @@ public Advice getAdvice(Method candidateAdviceMethod, AspectJExpressionPointcut
AbstractAspectJAdvice springAdvice;
switch (aspectJAnnotation.getAnnotationType()) {
- case AtPointcut:
+ case AtPointcut -> {
if (logger.isDebugEnabled()) {
logger.debug("Processing pointcut '" ... | true |
Other | spring-projects | spring-framework | c5c926726dc46f5135645d79ddc12c4027e1d061.json | Use enhanced switch expressions where feasible
Closes gh-28014 | spring-beans/src/jmh/java/org/springframework/beans/AbstractPropertyAccessorBenchmark.java | @@ -61,18 +61,14 @@ public void setup() {
this.propertyAccessor = new BeanWrapperImpl(this.target);
}
switch (this.customEditor) {
- case "stringTrimmer":
- this.propertyAccessor.registerCustomEditor(String.class, new StringTrimmerEditor(false));
- break;
- case "numberOnPath":
- this.pro... | true |
Other | spring-projects | spring-framework | c5c926726dc46f5135645d79ddc12c4027e1d061.json | Use enhanced switch expressions where feasible
Closes gh-28014 | spring-context-support/src/main/java/org/springframework/mail/javamail/MimeMessageHelper.java | @@ -333,30 +333,28 @@ public final MimeMessage getMimeMessage() {
*/
protected void createMimeMultiparts(MimeMessage mimeMessage, int multipartMode) throws MessagingException {
switch (multipartMode) {
- case MULTIPART_MODE_NO:
- setMimeMultiparts(null, null);
- break;
- case MULTIPART_MODE_MIXED:
+ ... | true |
Other | spring-projects | spring-framework | c5c926726dc46f5135645d79ddc12c4027e1d061.json | Use enhanced switch expressions where feasible
Closes gh-28014 | spring-context/src/main/java/org/springframework/cache/annotation/CachingConfigurationSelector.java | @@ -68,14 +68,10 @@ public class CachingConfigurationSelector extends AdviceModeImportSelector<Enabl
*/
@Override
public String[] selectImports(AdviceMode adviceMode) {
- switch (adviceMode) {
- case PROXY:
- return getProxyImports();
- case ASPECTJ:
- return getAspectJImports();
- default:
- ret... | true |
Other | spring-projects | spring-framework | c5c926726dc46f5135645d79ddc12c4027e1d061.json | Use enhanced switch expressions where feasible
Closes gh-28014 | spring-context/src/main/java/org/springframework/context/annotation/TypeFilterUtils.java | @@ -78,38 +78,32 @@ public static List<TypeFilter> createTypeFiltersFor(AnnotationAttributes filterA
for (Class<?> filterClass : filterAttributes.getClassArray("classes")) {
switch (filterType) {
- case ANNOTATION:
+ case ANNOTATION -> {
Assert.isAssignable(Annotation.class, filterClass,
"@... | true |
Other | spring-projects | spring-framework | c5c926726dc46f5135645d79ddc12c4027e1d061.json | Use enhanced switch expressions where feasible
Closes gh-28014 | spring-context/src/main/java/org/springframework/format/datetime/standard/DateTimeFormatterRegistrar.java | @@ -209,11 +209,11 @@ private DateTimeFormatter getFormatter(Type type) {
}
private DateTimeFormatter getFallbackFormatter(Type type) {
- switch (type) {
- case DATE: return DateTimeFormatter.ofLocalizedDate(FormatStyle.SHORT);
- case TIME: return DateTimeFormatter.ofLocalizedTime(FormatStyle.SHORT);
- def... | true |
Other | spring-projects | spring-framework | c5c926726dc46f5135645d79ddc12c4027e1d061.json | Use enhanced switch expressions where feasible
Closes gh-28014 | spring-context/src/main/java/org/springframework/scheduling/annotation/AsyncConfigurationSelector.java | @@ -18,7 +18,7 @@
import org.springframework.context.annotation.AdviceMode;
import org.springframework.context.annotation.AdviceModeImportSelector;
-import org.springframework.lang.Nullable;
+import org.springframework.lang.NonNull;
/**
* Selects which implementation of {@link AbstractAsyncConfiguration} shoul... | true |
Other | spring-projects | spring-framework | c5c926726dc46f5135645d79ddc12c4027e1d061.json | Use enhanced switch expressions where feasible
Closes gh-28014 | spring-core/src/main/java/org/springframework/asm/TypePath.java | @@ -163,22 +163,13 @@ public String toString() {
int length = getLength();
StringBuilder result = new StringBuilder(length * 2);
for (int i = 0; i < length; ++i) {
- switch (getStep(i)) {
- case ARRAY_ELEMENT:
- result.append('[');
- break;
- case INNER_TYPE:
- ... | true |
Other | spring-projects | spring-framework | c5c926726dc46f5135645d79ddc12c4027e1d061.json | Use enhanced switch expressions where feasible
Closes gh-28014 | spring-core/src/main/java/org/springframework/core/annotation/AnnotationsScanner.java | @@ -95,19 +95,13 @@ private static <C, R> R process(C context, AnnotatedElement source,
private static <C, R> R processClass(C context, Class<?> source,
SearchStrategy searchStrategy, AnnotationsProcessor<C, R> processor) {
- switch (searchStrategy) {
- case DIRECT:
- return processElement(context, source... | true |
Other | spring-projects | spring-framework | c5c926726dc46f5135645d79ddc12c4027e1d061.json | Use enhanced switch expressions where feasible
Closes gh-28014 | spring-core/src/main/java/org/springframework/core/env/ProfilesParser.java | @@ -70,39 +70,38 @@ private static Profiles parseTokens(String expression, StringTokenizer tokens, C
continue;
}
switch (token) {
- case "(":
+ case "(" -> {
Profiles contents = parseTokens(expression, tokens, Context.BRACKET);
if (context == Context.INVERT) {
return contents;
... | true |
Other | spring-projects | spring-framework | c5c926726dc46f5135645d79ddc12c4027e1d061.json | Use enhanced switch expressions where feasible
Closes gh-28014 | spring-core/src/main/java/org/springframework/core/io/buffer/DataBufferUtils.java | @@ -608,14 +608,11 @@ public static Matcher matcher(byte[]... delimiters) {
private static NestedMatcher createMatcher(byte[] delimiter) {
Assert.isTrue(delimiter.length > 0, "Delimiter must not be empty");
- switch (delimiter.length) {
- case 1:
- return (delimiter[0] == 10 ? SingleByteMatcher.NEWLINE_MAT... | true |
Other | spring-projects | spring-framework | c5c926726dc46f5135645d79ddc12c4027e1d061.json | Use enhanced switch expressions where feasible
Closes gh-28014 | spring-core/src/main/java/org/springframework/util/concurrent/ListenableFutureCallbackRegistry.java | @@ -56,16 +56,12 @@ public void addCallback(ListenableFutureCallback<? super T> callback) {
Assert.notNull(callback, "'callback' must not be null");
synchronized (this.mutex) {
switch (this.state) {
- case NEW:
+ case NEW -> {
this.successCallbacks.add(callback);
this.failureCallbacks.add(ca... | true |
Other | spring-projects | spring-framework | c5c926726dc46f5135645d79ddc12c4027e1d061.json | Use enhanced switch expressions where feasible
Closes gh-28014 | spring-expression/src/main/java/org/springframework/expression/spel/SpelMessage.java | @@ -287,10 +287,8 @@ public enum SpelMessage {
public String formatMessage(Object... inserts) {
StringBuilder formattedMessage = new StringBuilder();
formattedMessage.append("EL").append(this.code);
- switch (this.kind) {
- case ERROR:
- formattedMessage.append('E');
- break;
+ if (this.kind == Kind.E... | true |
Other | spring-projects | spring-framework | c5c926726dc46f5135645d79ddc12c4027e1d061.json | Use enhanced switch expressions where feasible
Closes gh-28014 | spring-expression/src/main/java/org/springframework/expression/spel/ast/OpDivide.java | @@ -115,21 +115,12 @@ public void generateCode(MethodVisitor mv, CodeFlow cf) {
cf.exitCompilationScope();
CodeFlow.insertNumericUnboxOrPrimitiveTypeCoercion(mv, rightDesc, targetDesc);
switch (targetDesc) {
- case 'I':
- mv.visitInsn(IDIV);
- break;
- case 'J':
- mv.visitInsn(LDIV);
- ... | true |
Other | spring-projects | spring-framework | c5c926726dc46f5135645d79ddc12c4027e1d061.json | Use enhanced switch expressions where feasible
Closes gh-28014 | spring-expression/src/main/java/org/springframework/expression/spel/ast/OpMinus.java | @@ -184,40 +184,22 @@ public void generateCode(MethodVisitor mv, CodeFlow cf) {
cf.exitCompilationScope();
CodeFlow.insertNumericUnboxOrPrimitiveTypeCoercion(mv, rightDesc, targetDesc);
switch (targetDesc) {
- case 'I':
- mv.visitInsn(ISUB);
- break;
- case 'J':
- mv.visitInsn(LSUB);
- ... | true |
Other | spring-projects | spring-framework | c5c926726dc46f5135645d79ddc12c4027e1d061.json | Use enhanced switch expressions where feasible
Closes gh-28014 | spring-expression/src/main/java/org/springframework/expression/spel/ast/OpModulus.java | @@ -112,21 +112,12 @@ public void generateCode(MethodVisitor mv, CodeFlow cf) {
cf.exitCompilationScope();
CodeFlow.insertNumericUnboxOrPrimitiveTypeCoercion(mv, rightDesc, targetDesc);
switch (targetDesc) {
- case 'I':
- mv.visitInsn(IREM);
- break;
- case 'J':
- mv.visitInsn(LREM);
- ... | true |
Other | spring-projects | spring-framework | c5c926726dc46f5135645d79ddc12c4027e1d061.json | Use enhanced switch expressions where feasible
Closes gh-28014 | spring-expression/src/main/java/org/springframework/expression/spel/ast/OpMultiply.java | @@ -140,21 +140,12 @@ public void generateCode(MethodVisitor mv, CodeFlow cf) {
cf.exitCompilationScope();
CodeFlow.insertNumericUnboxOrPrimitiveTypeCoercion(mv, rightDesc, targetDesc);
switch (targetDesc) {
- case 'I':
- mv.visitInsn(IMUL);
- break;
- case 'J':
- mv.visitInsn(LMUL);
- ... | true |
Other | spring-projects | spring-framework | c5c926726dc46f5135645d79ddc12c4027e1d061.json | Use enhanced switch expressions where feasible
Closes gh-28014 | spring-expression/src/main/java/org/springframework/expression/spel/ast/OpPlus.java | @@ -226,21 +226,12 @@ public void generateCode(MethodVisitor mv, CodeFlow cf) {
cf.exitCompilationScope();
CodeFlow.insertNumericUnboxOrPrimitiveTypeCoercion(mv, rightDesc, targetDesc);
switch (targetDesc) {
- case 'I':
- mv.visitInsn(IADD);
- break;
- case 'J':
- mv.visitInsn(LADD... | true |
Other | spring-projects | spring-framework | c5c926726dc46f5135645d79ddc12c4027e1d061.json | Use enhanced switch expressions where feasible
Closes gh-28014 | spring-expression/src/main/java/org/springframework/expression/spel/ast/Selection.java | @@ -209,12 +209,12 @@ public String toStringAST() {
}
private String prefix() {
- switch (this.variant) {
- case ALL: return "?[";
- case FIRST: return "^[";
- case LAST: return "$[";
- }
- return "";
+ return switch (this.variant) {
+ case ALL -> "?[";
+ case FIRST -> "^[";
+ case LAST -> "$["... | true |
Other | spring-projects | spring-framework | c5c926726dc46f5135645d79ddc12c4027e1d061.json | Use enhanced switch expressions where feasible
Closes gh-28014 | spring-jcl/src/main/java/org/apache/commons/logging/LogAdapter.java | @@ -84,22 +84,19 @@ private LogAdapter() {
* @param name the logger name
*/
public static Log createLog(String name) {
- switch (logApi) {
- case LOG4J:
- return Log4jAdapter.createLog(name);
- case SLF4J_LAL:
- return Slf4jAdapter.createLocationAwareLog(name);
- case SLF4J:
- return Slf4jAdapte... | true |
Other | spring-projects | spring-framework | c5c926726dc46f5135645d79ddc12c4027e1d061.json | Use enhanced switch expressions where feasible
Closes gh-28014 | spring-jms/src/main/java/org/springframework/jms/support/converter/MarshallingMessageConverter.java | @@ -155,14 +155,11 @@ public void afterPropertiesSet() {
public Message toMessage(Object object, Session session) throws JMSException, MessageConversionException {
Assert.state(this.marshaller != null, "No Marshaller set");
try {
- switch (this.targetType) {
- case TEXT:
- return marshalToTextMessage(o... | true |
Other | spring-projects | spring-framework | c5c926726dc46f5135645d79ddc12c4027e1d061.json | Use enhanced switch expressions where feasible
Closes gh-28014 | spring-messaging/src/jmh/java/org/springframework/messaging/simp/broker/DefaultSubscriptionRegistryBenchmark.java | @@ -145,18 +145,15 @@ public static class FindRequest {
@Setup(Level.Trial)
public void doSetup(ServerState serverState) {
switch (this.contention) {
- case "noSubscribers":
+ case "noSubscribers" -> {
this.destination = "someDestination_withNoSubscribers_" + serverState.uniqueIdGenerator.incremen... | true |
Other | spring-projects | spring-framework | c5c926726dc46f5135645d79ddc12c4027e1d061.json | Use enhanced switch expressions where feasible
Closes gh-28014 | spring-messaging/src/main/java/org/springframework/messaging/rsocket/annotation/support/RSocketFrameTypeMessageCondition.java | @@ -192,20 +192,16 @@ public int compareTo(RSocketFrameTypeMessageCondition other, Message<?> message)
* @since 5.2.2
*/
public static RSocketFrameTypeMessageCondition getCondition(int cardinalityIn, int cardinalityOut) {
- switch (cardinalityIn) {
- case 0:
- case 1:
- switch (cardinalityOut) {
- c... | true |
Other | spring-projects | spring-framework | c5c926726dc46f5135645d79ddc12c4027e1d061.json | Use enhanced switch expressions where feasible
Closes gh-28014 | spring-orm/src/main/java/org/springframework/orm/jpa/SharedEntityManagerCreator.java | @@ -266,13 +266,14 @@ public Object invoke(Object proxy, Method method, Object[] args) throws Throwabl
this.targetFactory, this.properties, this.synchronizedWithTransaction);
switch (method.getName()) {
- case "getTargetEntityManager":
+ case "getTargetEntityManager" -> {
// Handle EntityManager... | true |
Other | spring-projects | spring-framework | c5c926726dc46f5135645d79ddc12c4027e1d061.json | Use enhanced switch expressions where feasible
Closes gh-28014 | spring-orm/src/main/java/org/springframework/orm/jpa/vendor/EclipseLinkJpaVendorAdapter.java | @@ -94,19 +94,19 @@ public Map<String, Object> getJpaPropertyMap() {
*/
@Nullable
protected String determineTargetDatabaseName(Database database) {
- switch (database) {
- case DB2: return TargetDatabase.DB2;
- case DERBY: return TargetDatabase.Derby;
- case HANA: return TargetDatabase.HANA;
- case HSQL... | true |
Other | spring-projects | spring-framework | c5c926726dc46f5135645d79ddc12c4027e1d061.json | Use enhanced switch expressions where feasible
Closes gh-28014 | spring-orm/src/main/java/org/springframework/orm/jpa/vendor/HibernateJpaVendorAdapter.java | @@ -169,20 +169,20 @@ private Map<String, Object> buildJpaPropertyMap(boolean connectionReleaseOnClose
*/
@Nullable
protected Class<?> determineDatabaseDialectClass(Database database) {
- switch (database) {
- case DB2: return DB2Dialect.class;
- case DERBY: return DerbyTenSevenDialect.class;
- case H2: r... | true |
Other | spring-projects | spring-framework | c5c926726dc46f5135645d79ddc12c4027e1d061.json | Use enhanced switch expressions where feasible
Closes gh-28014 | spring-r2dbc/src/main/java/org/springframework/r2dbc/connection/R2dbcTransactionManager.java | @@ -415,17 +415,13 @@ protected Mono<Void> prepareTransactionalConnection(
*/
@Nullable
protected IsolationLevel resolveIsolationLevel(int isolationLevel) {
- switch (isolationLevel) {
- case TransactionDefinition.ISOLATION_READ_COMMITTED:
- return IsolationLevel.READ_COMMITTED;
- case TransactionDefinit... | true |
Other | spring-projects | spring-framework | c5c926726dc46f5135645d79ddc12c4027e1d061.json | Use enhanced switch expressions where feasible
Closes gh-28014 | spring-test/src/main/java/org/springframework/mock/web/MockPageContext.java | @@ -154,20 +154,11 @@ public void setAttribute(String name, @Nullable Object value) {
public void setAttribute(String name, @Nullable Object value, int scope) {
Assert.notNull(name, "Attribute name must not be null");
switch (scope) {
- case PAGE_SCOPE:
- setAttribute(name, value);
- break;
- case REQ... | true |
Other | spring-projects | spring-framework | c5c926726dc46f5135645d79ddc12c4027e1d061.json | Use enhanced switch expressions where feasible
Closes gh-28014 | spring-tx/src/main/java/org/springframework/transaction/HeuristicCompletionException.java | @@ -49,16 +49,12 @@ public class HeuristicCompletionException extends TransactionException {
public static String getStateString(int state) {
- switch (state) {
- case STATE_COMMITTED:
- return "committed";
- case STATE_ROLLED_BACK:
- return "rolled back";
- case STATE_MIXED:
- return "mixed";
- ... | true |
Other | spring-projects | spring-framework | c5c926726dc46f5135645d79ddc12c4027e1d061.json | Use enhanced switch expressions where feasible
Closes gh-28014 | spring-tx/src/main/java/org/springframework/transaction/jta/SpringJtaSynchronizationAdapter.java | @@ -171,14 +171,9 @@ public void afterCompletion(int status) {
}
// Call afterCompletion with the appropriate status indication.
switch (status) {
- case Status.STATUS_COMMITTED:
- this.springSynchronization.afterCompletion(TransactionSynchronization.STATUS_COMMITTED);
- break;
- case Status.STATUS_R... | true |
Other | spring-projects | spring-framework | c5c926726dc46f5135645d79ddc12c4027e1d061.json | Use enhanced switch expressions where feasible
Closes gh-28014 | spring-web/src/main/java/org/springframework/http/codec/json/Jackson2Tokenizer.java | @@ -154,18 +154,10 @@ else if (token == null ) { // !previousNull
private void updateDepth(JsonToken token) {
switch (token) {
- case START_OBJECT:
- this.objectDepth++;
- break;
- case END_OBJECT:
- this.objectDepth--;
- break;
- case START_ARRAY:
- this.arrayDepth++;
- break;
- case E... | true |
Other | spring-projects | spring-framework | c5c926726dc46f5135645d79ddc12c4027e1d061.json | Use enhanced switch expressions where feasible
Closes gh-28014 | spring-web/src/main/java/org/springframework/web/client/DefaultResponseErrorHandler.java | @@ -164,12 +164,9 @@ protected void handleError(ClientHttpResponse response, HttpStatus statusCode) t
String message = getErrorMessage(statusCode.value(), statusText, body, charset);
switch (statusCode.series()) {
- case CLIENT_ERROR:
- throw HttpClientErrorException.create(message, statusCode, statusText,... | true |
Other | spring-projects | spring-framework | c5c926726dc46f5135645d79ddc12c4027e1d061.json | Use enhanced switch expressions where feasible
Closes gh-28014 | spring-web/src/testFixtures/java/org/springframework/web/testfixture/servlet/MockPageContext.java | @@ -154,20 +154,11 @@ public void setAttribute(String name, @Nullable Object value) {
public void setAttribute(String name, @Nullable Object value, int scope) {
Assert.notNull(name, "Attribute name must not be null");
switch (scope) {
- case PAGE_SCOPE:
- setAttribute(name, value);
- break;
- case REQ... | true |
Other | spring-projects | spring-framework | c5c926726dc46f5135645d79ddc12c4027e1d061.json | Use enhanced switch expressions where feasible
Closes gh-28014 | spring-webmvc/src/main/java/org/springframework/web/servlet/config/ViewControllerBeanDefinitionParser.java | @@ -82,24 +82,23 @@ public BeanDefinition parse(Element element, ParserContext parserContext) {
String name = element.getLocalName();
switch (name) {
- case "view-controller":
+ case "view-controller" -> {
if (element.hasAttribute("view-name")) {
controller.getPropertyValues().add("viewName", ele... | true |
Other | spring-projects | spring-framework | c5c926726dc46f5135645d79ddc12c4027e1d061.json | Use enhanced switch expressions where feasible
Closes gh-28014 | spring-websocket/src/main/java/org/springframework/web/socket/handler/ConcurrentWebSocketSessionDecorator.java | @@ -210,12 +210,12 @@ private void checkSessionLimits() {
}
else if (getBufferSize() > getBufferSizeLimit()) {
switch (this.overflowStrategy) {
- case TERMINATE:
+ case TERMINATE -> {
String format = "Buffer size %d bytes for session '%s' exceeds the allowed limit %d";
String r... | true |
Other | spring-projects | spring-framework | c5c926726dc46f5135645d79ddc12c4027e1d061.json | Use enhanced switch expressions where feasible
Closes gh-28014 | spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/session/AbstractSockJsSession.java | @@ -407,17 +407,14 @@ private void logUndeliveredMessages(int index, String[] messages) {
}
private static List<String> getUndelivered(String[] messages, int i) {
- switch (messages.length - i) {
- case 0:
- return Collections.emptyList();
- case 1:
- return (messages[i].trim().isEmpty() ?
- Colle... | true |
Other | spring-projects | spring-framework | 8d0ac214f3b3d8b74a6399d95a1ce2743e03d347.json | Configure more memory for checkstyleNohttp
See https://docs.gradle.org/7.5/release-notes.html#checkstyle-tasks-use-toolchains-and-execute-in-parallel-by-default | build.gradle | @@ -428,6 +428,10 @@ configure(rootProject) {
}
}
+ tasks.named("checkstyleNohttp").configure {
+ maxHeapSize = "1g"
+ }
+
publishing {
publications {
mavenJava(MavenPublication) { | false |
Other | spring-projects | spring-framework | 332961f833fea5fde7554c60707d4cbea27e56fd.json | Contribute introspection hints on registered beans
As a follow up of #29205, we now need to contribute an "introspection on
declared method" reflection hint for all registered beans.
Closes gh-29246 | spring-beans/src/main/java/org/springframework/beans/factory/aot/BeanRegistrationsAotContribution.java | @@ -26,7 +26,10 @@
import org.springframework.aot.generate.GenerationContext;
import org.springframework.aot.generate.MethodReference;
import org.springframework.aot.generate.MethodReference.ArgumentCodeGenerator;
+import org.springframework.aot.hint.MemberCategory;
+import org.springframework.aot.hint.RuntimeHints;... | true |
Other | spring-projects | spring-framework | 332961f833fea5fde7554c60707d4cbea27e56fd.json | Contribute introspection hints on registered beans
As a follow up of #29205, we now need to contribute an "introspection on
declared method" reflection hint for all registered beans.
Closes gh-29246 | spring-beans/src/main/java/org/springframework/beans/factory/aot/BeanRegistrationsAotProcessor.java | @@ -27,6 +27,7 @@
* register beans.
*
* @author Phillip Webb
+ * @author Brian Clozel
* @since 6.0
*/
class BeanRegistrationsAotProcessor implements BeanFactoryInitializationAotProcessor {
@@ -35,13 +36,13 @@ class BeanRegistrationsAotProcessor implements BeanFactoryInitializationAotProce
public BeanRegist... | true |
Other | spring-projects | spring-framework | 332961f833fea5fde7554c60707d4cbea27e56fd.json | Contribute introspection hints on registered beans
As a follow up of #29205, we now need to contribute an "introspection on
declared method" reflection hint for all registered beans.
Closes gh-29246 | spring-beans/src/main/java/org/springframework/beans/factory/support/RegisteredBean.java | @@ -16,6 +16,7 @@
package org.springframework.beans.factory.support;
+import java.util.Objects;
import java.util.function.BiFunction;
import java.util.function.Supplier;
@@ -195,6 +196,23 @@ public RegisteredBean getParent() {
return this.parent;
}
+ @Override
+ public boolean equals(Object o) {
+ if (... | true |
Other | spring-projects | spring-framework | 332961f833fea5fde7554c60707d4cbea27e56fd.json | Contribute introspection hints on registered beans
As a follow up of #29205, we now need to contribute an "introspection on
declared method" reflection hint for all registered beans.
Closes gh-29246 | spring-beans/src/test/java/org/springframework/beans/factory/aot/BeanRegistrationsAotContributionTests.java | @@ -32,6 +32,8 @@
import org.springframework.aot.generate.GenerationContext;
import org.springframework.aot.generate.MethodReference;
import org.springframework.aot.generate.MethodReference.ArgumentCodeGenerator;
+import org.springframework.aot.hint.MemberCategory;
+import org.springframework.aot.hint.predicate.Runt... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.