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 | b3ceb0f625a5b40d1007bb4dfe673be497fc2c9e.json | Add core JavaPoet utilities
This commit adds utilities that facilitate code generation patterns
used by the AOT engine.
Closes gh-28028 | spring-core/src/test/java/org/springframework/javapoet/support/MultiCodeBlockTests.java | @@ -0,0 +1,61 @@
+/*
+ * 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 | b3ceb0f625a5b40d1007bb4dfe673be497fc2c9e.json | Add core JavaPoet utilities
This commit adds utilities that facilitate code generation patterns
used by the AOT engine.
Closes gh-28028 | spring-core/src/test/java/org/springframework/javapoet/support/MultiStatementTests.java | @@ -0,0 +1,131 @@
+/*
+ * 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 | 97582fd0a1f786c2cde12ba2af8196e423d47d87.json | Update Eclipse template to @since 5.3.16 | src/eclipse/org.eclipse.jdt.ui.prefs | @@ -63,4 +63,4 @@ org.eclipse.jdt.ui.keywordthis=false
org.eclipse.jdt.ui.ondemandthreshold=9999
org.eclipse.jdt.ui.overrideannotation=true
org.eclipse.jdt.ui.staticondemandthreshold=9999
-org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template auto... | false |
Other | spring-projects | spring-framework | 6936f7e0cb1eae8357f3c700d2c2d33834475ec2.json | Relocate runtime hints to aot package
See gh-27829 | spring-core/src/main/java/org/springframework/aot/hint/AbstractTypeReference.java | @@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.core.hint;
+package org.springframework.aot.hint;
import java.util.Objects;
| true |
Other | spring-projects | spring-framework | 6936f7e0cb1eae8357f3c700d2c2d33834475ec2.json | Relocate runtime hints to aot package
See gh-27829 | spring-core/src/main/java/org/springframework/aot/hint/ClassProxyHint.java | @@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.core.hint;
+package org.springframework.aot.hint;
import java.util.Arrays;
import java.util.LinkedList; | true |
Other | spring-projects | spring-framework | 6936f7e0cb1eae8357f3c700d2c2d33834475ec2.json | Relocate runtime hints to aot package
See gh-27829 | spring-core/src/main/java/org/springframework/aot/hint/ExecutableHint.java | @@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.core.hint;
+package org.springframework.aot.hint;
import java.lang.reflect.Constructor;
import java.lang.reflect.Executable; | true |
Other | spring-projects | spring-framework | 6936f7e0cb1eae8357f3c700d2c2d33834475ec2.json | Relocate runtime hints to aot package
See gh-27829 | spring-core/src/main/java/org/springframework/aot/hint/ExecutableMode.java | @@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.core.hint;
+package org.springframework.aot.hint;
import java.lang.reflect.Executable;
| true |
Other | spring-projects | spring-framework | 6936f7e0cb1eae8357f3c700d2c2d33834475ec2.json | Relocate runtime hints to aot package
See gh-27829 | spring-core/src/main/java/org/springframework/aot/hint/FieldHint.java | @@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.core.hint;
+package org.springframework.aot.hint;
import java.lang.reflect.Field;
| true |
Other | spring-projects | spring-framework | 6936f7e0cb1eae8357f3c700d2c2d33834475ec2.json | Relocate runtime hints to aot package
See gh-27829 | spring-core/src/main/java/org/springframework/aot/hint/JavaSerializationHints.java | @@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.core.hint;
+package org.springframework.aot.hint;
import java.io.Serializable;
import java.util.LinkedHashSet; | true |
Other | spring-projects | spring-framework | 6936f7e0cb1eae8357f3c700d2c2d33834475ec2.json | Relocate runtime hints to aot package
See gh-27829 | spring-core/src/main/java/org/springframework/aot/hint/JdkProxyHint.java | @@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.core.hint;
+package org.springframework.aot.hint;
import java.lang.reflect.Proxy;
import java.util.Arrays; | true |
Other | spring-projects | spring-framework | 6936f7e0cb1eae8357f3c700d2c2d33834475ec2.json | Relocate runtime hints to aot package
See gh-27829 | spring-core/src/main/java/org/springframework/aot/hint/MemberCategory.java | @@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.core.hint;
+package org.springframework.aot.hint;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field; | true |
Other | spring-projects | spring-framework | 6936f7e0cb1eae8357f3c700d2c2d33834475ec2.json | Relocate runtime hints to aot package
See gh-27829 | spring-core/src/main/java/org/springframework/aot/hint/MemberHint.java | @@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.core.hint;
+package org.springframework.aot.hint;
import java.lang.reflect.Member;
| true |
Other | spring-projects | spring-framework | 6936f7e0cb1eae8357f3c700d2c2d33834475ec2.json | Relocate runtime hints to aot package
See gh-27829 | spring-core/src/main/java/org/springframework/aot/hint/ProxyHints.java | @@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.core.hint;
+package org.springframework.aot.hint;
import java.util.Arrays;
import java.util.LinkedHashSet;
@@ -25,7 +25,7 @@
import java.util.stream.Collectors;
import java.util.stream.Stream;
-import org.springframework.co... | true |
Other | spring-projects | spring-framework | 6936f7e0cb1eae8357f3c700d2c2d33834475ec2.json | Relocate runtime hints to aot package
See gh-27829 | spring-core/src/main/java/org/springframework/aot/hint/ReflectionHints.java | @@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.core.hint;
+package org.springframework.aot.hint;
import java.lang.reflect.Constructor;
import java.lang.reflect.Executable;
@@ -28,7 +28,7 @@
import java.util.stream.Collectors;
import java.util.stream.Stream;
-import org.... | true |
Other | spring-projects | spring-framework | 6936f7e0cb1eae8357f3c700d2c2d33834475ec2.json | Relocate runtime hints to aot package
See gh-27829 | spring-core/src/main/java/org/springframework/aot/hint/ReflectionTypeReference.java | @@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.core.hint;
+package org.springframework.aot.hint;
import org.springframework.lang.Nullable;
| true |
Other | spring-projects | spring-framework | 6936f7e0cb1eae8357f3c700d2c2d33834475ec2.json | Relocate runtime hints to aot package
See gh-27829 | spring-core/src/main/java/org/springframework/aot/hint/ResourceBundleHint.java | @@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.core.hint;
+package org.springframework.aot.hint;
import java.util.ResourceBundle;
| true |
Other | spring-projects | spring-framework | 6936f7e0cb1eae8357f3c700d2c2d33834475ec2.json | Relocate runtime hints to aot package
See gh-27829 | spring-core/src/main/java/org/springframework/aot/hint/ResourceHints.java | @@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.core.hint;
+package org.springframework.aot.hint;
import java.util.ArrayList;
import java.util.HashSet;
@@ -24,7 +24,7 @@
import java.util.function.Consumer;
import java.util.stream.Stream;
-import org.springframework.core.... | true |
Other | spring-projects | spring-framework | 6936f7e0cb1eae8357f3c700d2c2d33834475ec2.json | Relocate runtime hints to aot package
See gh-27829 | spring-core/src/main/java/org/springframework/aot/hint/ResourcePatternHint.java | @@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.core.hint;
+package org.springframework.aot.hint;
import java.util.ArrayList;
import java.util.Arrays; | true |
Other | spring-projects | spring-framework | 6936f7e0cb1eae8357f3c700d2c2d33834475ec2.json | Relocate runtime hints to aot package
See gh-27829 | spring-core/src/main/java/org/springframework/aot/hint/RuntimeHints.java | @@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.core.hint;
+package org.springframework.aot.hint;
/**
* Gather hints that can be used to optimize the application runtime. | true |
Other | spring-projects | spring-framework | 6936f7e0cb1eae8357f3c700d2c2d33834475ec2.json | Relocate runtime hints to aot package
See gh-27829 | spring-core/src/main/java/org/springframework/aot/hint/SimpleTypeReference.java | @@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.core.hint;
+package org.springframework.aot.hint;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert; | true |
Other | spring-projects | spring-framework | 6936f7e0cb1eae8357f3c700d2c2d33834475ec2.json | Relocate runtime hints to aot package
See gh-27829 | spring-core/src/main/java/org/springframework/aot/hint/TypeHint.java | @@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.core.hint;
+package org.springframework.aot.hint;
import java.util.Arrays;
import java.util.HashMap; | true |
Other | spring-projects | spring-framework | 6936f7e0cb1eae8357f3c700d2c2d33834475ec2.json | Relocate runtime hints to aot package
See gh-27829 | spring-core/src/main/java/org/springframework/aot/hint/TypeReference.java | @@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.core.hint;
+package org.springframework.aot.hint;
import org.springframework.lang.Nullable;
| true |
Other | spring-projects | spring-framework | 6936f7e0cb1eae8357f3c700d2c2d33834475ec2.json | Relocate runtime hints to aot package
See gh-27829 | spring-core/src/main/java/org/springframework/aot/hint/package-info.java | @@ -2,4 +2,4 @@
* Support for registering the need for reflection, resources, java serialization
* and proxies.
*/
-package org.springframework.core.hint;
+package org.springframework.aot.hint; | true |
Other | spring-projects | spring-framework | 6936f7e0cb1eae8357f3c700d2c2d33834475ec2.json | Relocate runtime hints to aot package
See gh-27829 | spring-core/src/test/java/org/springframework/aot/hint/ClassProxyHintTests.java | @@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.core.hint;
+package org.springframework.aot.hint;
import java.io.Closeable;
import java.io.Serializable;
@@ -24,7 +24,7 @@
import org.junit.jupiter.api.Test;
-import org.springframework.core.hint.JdkProxyHint.Builder;
+imp... | true |
Other | spring-projects | spring-framework | 6936f7e0cb1eae8357f3c700d2c2d33834475ec2.json | Relocate runtime hints to aot package
See gh-27829 | spring-core/src/test/java/org/springframework/aot/hint/JavaSerializationHintsTests.java | @@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.core.hint;
+package org.springframework.aot.hint;
import java.net.URL;
| true |
Other | spring-projects | spring-framework | 6936f7e0cb1eae8357f3c700d2c2d33834475ec2.json | Relocate runtime hints to aot package
See gh-27829 | spring-core/src/test/java/org/springframework/aot/hint/JdkProxyHintTests.java | @@ -14,14 +14,14 @@
* limitations under the License.
*/
-package org.springframework.core.hint;
+package org.springframework.aot.hint;
import java.util.function.Consumer;
import java.util.function.Function;
import org.junit.jupiter.api.Test;
-import org.springframework.core.hint.JdkProxyHint.Builder;
+im... | true |
Other | spring-projects | spring-framework | 6936f7e0cb1eae8357f3c700d2c2d33834475ec2.json | Relocate runtime hints to aot package
See gh-27829 | spring-core/src/test/java/org/springframework/aot/hint/ProxyHintsTests.java | @@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.core.hint;
+package org.springframework.aot.hint;
import java.io.Serializable;
import java.util.Arrays;
@@ -26,7 +26,7 @@
import org.junit.jupiter.api.Test;
-import org.springframework.core.hint.JdkProxyHint.Builder;
+impo... | true |
Other | spring-projects | spring-framework | 6936f7e0cb1eae8357f3c700d2c2d33834475ec2.json | Relocate runtime hints to aot package
See gh-27829 | spring-core/src/test/java/org/springframework/aot/hint/ReflectionHintsTests.java | @@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.core.hint;
+package org.springframework.aot.hint;
import java.util.function.Consumer;
| true |
Other | spring-projects | spring-framework | 6936f7e0cb1eae8357f3c700d2c2d33834475ec2.json | Relocate runtime hints to aot package
See gh-27829 | spring-core/src/test/java/org/springframework/aot/hint/ResourceHintsTests.java | @@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.core.hint;
+package org.springframework.aot.hint;
import java.util.Arrays;
import java.util.Collections;
@@ -23,7 +23,7 @@
import org.junit.jupiter.api.Test;
-import org.springframework.core.hint.ResourceHintsTests.Nested.... | true |
Other | spring-projects | spring-framework | 6936f7e0cb1eae8357f3c700d2c2d33834475ec2.json | Relocate runtime hints to aot package
See gh-27829 | spring-core/src/test/java/org/springframework/aot/hint/RuntimeHintsTests.java | @@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.core.hint;
+package org.springframework.aot.hint;
import java.util.function.Function;
| true |
Other | spring-projects | spring-framework | 6936f7e0cb1eae8357f3c700d2c2d33834475ec2.json | Relocate runtime hints to aot package
See gh-27829 | spring-core/src/test/java/org/springframework/aot/hint/TypeHintTests.java | @@ -14,13 +14,13 @@
* limitations under the License.
*/
-package org.springframework.core.hint;
+package org.springframework.aot.hint;
import java.util.List;
import org.junit.jupiter.api.Test;
-import org.springframework.core.hint.TypeHint.Builder;
+import org.springframework.aot.hint.TypeHint.Builder;
... | true |
Other | spring-projects | spring-framework | 6936f7e0cb1eae8357f3c700d2c2d33834475ec2.json | Relocate runtime hints to aot package
See gh-27829 | spring-core/src/test/java/org/springframework/aot/hint/TypeReferenceTests.java | @@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.core.hint;
+package org.springframework.aot.hint;
import org.junit.jupiter.api.Test;
| true |
Other | spring-projects | spring-framework | 4ab03fede8aa6fd501f136803277db7e868d9b7c.json | Fix Javadoc since for AopProxyUtils.isLambda()
See gh-28010 | spring-aop/src/main/java/org/springframework/aop/framework/AopProxyUtils.java | @@ -252,7 +252,7 @@ static Object[] adaptArgumentsIfNecessary(Method method, @Nullable Object[] argu
* checks that work on modern, main stream JVMs.
* @param clazz the class to check
* @return {@code true} if the class is a lambda implementation class
- * @since 5.2.16
+ * @since 5.3.16
*/
static boolea... | false |
Other | spring-projects | spring-framework | a22feac8036393725113222055166eb9e7211c9a.json | Update license header for https (nohttp rule)
See gh-27802 | spring-core/src/main/java/org/springframework/cglib/beans/BeanMap.java | @@ -5,14 +5,15 @@
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
*... | false |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-beans/src/test/java/org/springframework/beans/support/PagedListHolderTests.java | @@ -195,14 +195,22 @@ public void setExtendedInfo(String extendedInfo) {
@Override
public boolean equals(Object o) {
- if (this == o) return true;
- if (!(o instanceof MockFilter)) return false;
-
- final MockFilter mockFilter = (MockFilter) o;
-
- if (!age.equals(mockFilter.age)) return false;
- if (... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-beans/src/testFixtures/java/org/springframework/beans/testfixture/beans/NestedTestBean.java | @@ -44,10 +44,9 @@ public String getCompany() {
@Override
public boolean equals(Object obj) {
- if (!(obj instanceof NestedTestBean)) {
+ if (!(obj instanceof NestedTestBean ntb)) {
return false;
}
- NestedTestBean ntb = (NestedTestBean) obj;
return this.company.equals(ntb.company);
}
| true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-beans/src/testFixtures/java/org/springframework/beans/testfixture/beans/SerializablePerson.java | @@ -64,10 +64,9 @@ public Object echo(Object o) throws Throwable {
@Override
public boolean equals(Object other) {
- if (!(other instanceof SerializablePerson)) {
+ if (!(other instanceof SerializablePerson p)) {
return false;
}
- SerializablePerson p = (SerializablePerson) other;
return p.age == age... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-beans/src/testFixtures/java/org/springframework/beans/testfixture/beans/TestBean.java | @@ -468,10 +468,9 @@ public boolean equals(Object other) {
if (this == other) {
return true;
}
- if (!(other instanceof TestBean)) {
+ if (!(other instanceof TestBean tb2)) {
return false;
}
- TestBean tb2 = (TestBean) other;
return (ObjectUtils.nullSafeEquals(this.name, tb2.name) && this.age == ... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-beans/src/testFixtures/java/org/springframework/beans/testfixture/factory/xml/AbstractBeanFactoryTests.java | @@ -261,11 +261,9 @@ public void rejectsFactoryGetOnNormalBean() {
@Test
public void aliasing() {
BeanFactory bf = getBeanFactory();
- if (!(bf instanceof ConfigurableBeanFactory)) {
+ if (!(bf instanceof ConfigurableBeanFactory cbf)) {
return;
}
- ConfigurableBeanFactory cbf = (ConfigurableBeanFactory... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-context/src/test/java/org/springframework/context/annotation/ConfigurationClassPostProcessorTests.java | @@ -1358,7 +1358,7 @@ public static class RepositoryConfiguration {
@Bean
public Repository<String> stringRepo() {
- return new Repository<String>() {
+ return new Repository<>() {
@Override
public String toString() {
return "Repository<String>";
@@ -1368,7 +1368,7 @@ public String toString(... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-context/src/test/java/org/springframework/context/annotation/ConfigurationWithFactoryBeanBeanEarlyDeductionTests.java | @@ -95,17 +95,14 @@ public void preFreezeUnresolvedGenericFactoryBean() {
beanDefinition.setFactoryBeanName("factoryBean");
beanDefinition.setFactoryMethodName("myBean");
GenericApplicationContext context = new GenericApplicationContext();
- try {
+ try (context) {
context.registerBeanDefinition("factory... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-context/src/test/java/org/springframework/context/annotation/PropertySourceAnnotationTests.java | @@ -327,7 +327,7 @@ static class ConfigWithResolvablePlaceholderAndFactoryBean {
@Bean
FactoryBean<TestBean> testBean() {
final String name = env.getProperty("testbean.name");
- return new FactoryBean<TestBean>() {
+ return new FactoryBean<>() {
@Override
public TestBean getObject() {
retu... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-context/src/test/java/org/springframework/context/annotation/Spr15275Tests.java | @@ -78,7 +78,7 @@ protected static class ConfigWithFactoryBean {
@Bean
public FactoryBean<Foo> foo() {
- return new FactoryBean<Foo>() {
+ return new FactoryBean<>() {
@Override
public Foo getObject() {
return new Foo("x");
@@ -103,7 +103,7 @@ protected static class ConfigWithAbstractFactory... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-context/src/test/java/org/springframework/context/annotation/Spr16179Tests.java | @@ -53,7 +53,7 @@ PageAssemblerImpl<?> pageAssembler() {
@Bean
Assembler<SomeType> someAssembler() {
- return new Assembler<SomeType>() {};
+ return new Assembler<>() {};
}
}
| true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-context/src/test/java/org/springframework/context/event/AnnotationDrivenEventListenerTests.java | @@ -774,8 +774,7 @@ public Object handle(AnotherTestEvent event) {
if (event.content == null) {
return null;
}
- else if (event.content instanceof String) {
- String s = (String) event.content;
+ else if (event.content instanceof String s) {
if (s.equals("String")) {
return event.content;... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-context/src/test/java/org/springframework/context/support/ConversionServiceFactoryBeanTests.java | @@ -64,7 +64,7 @@ public Foo convert(String source) {
converters.add(new ConverterFactory<String, Bar>() {
@Override
public <T extends Bar> Converter<String, T> getConverter(Class<T> targetType) {
- return new Converter<String, T> () {
+ return new Converter<> () {
@SuppressWarnings("unchecked")
... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-context/src/test/java/org/springframework/context/support/PropertySourcesPlaceholderConfigurerTests.java | @@ -265,7 +265,7 @@ public void withNonEnumerablePropertySource() {
PropertySourcesPlaceholderConfigurer ppc = new PropertySourcesPlaceholderConfigurer();
- PropertySource<?> ps = new PropertySource<Object>("simplePropertySource", new Object()) {
+ PropertySource<?> ps = new PropertySource<>("simplePropertySou... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-context/src/test/java/org/springframework/jmx/export/NotificationListenerTests.java | @@ -168,8 +168,7 @@ public void testRegisterNotificationListenerWithFilter() throws Exception {
NotificationListenerBean listenerBean = new NotificationListenerBean();
listenerBean.setNotificationListener(listener);
listenerBean.setNotificationFilter(notification -> {
- if (notification instanceof AttributeC... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-context/src/test/java/org/springframework/scheduling/support/BitsCronFieldTests.java | @@ -108,7 +108,7 @@ void names() {
}
private static Condition<BitsCronField> set(int... indices) {
- return new Condition<BitsCronField>(String.format("set bits %s", Arrays.toString(indices))) {
+ return new Condition<>(String.format("set bits %s", Arrays.toString(indices))) {
@Override
public boolean m... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-context/src/test/java/org/springframework/scheduling/support/CronExpressionTests.java | @@ -43,7 +43,7 @@
*/
class CronExpressionTests {
- private static final Condition<Temporal> weekday = new Condition<Temporal>("weekday") {
+ private static final Condition<Temporal> weekday = new Condition<>("weekday") {
@Override
public boolean matches(Temporal value) { | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-core/src/main/java/org/springframework/core/convert/support/GenericConversionService.java | @@ -85,8 +85,8 @@ public class GenericConversionService implements ConfigurableConversionService {
@Override
public void addConverter(Converter<?, ?> converter) {
ResolvableType[] typeInfo = getRequiredTypeInfo(converter.getClass(), Converter.class);
- if (typeInfo == null && converter instanceof DecoratingProx... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-core/src/main/java/org/springframework/core/type/classreading/SimpleAnnotationMetadataReadingVisitor.java | @@ -85,8 +85,8 @@ public void visit(int version, int access, String name, String signature,
if (supername != null && !isInterface(access)) {
this.superClassName = toClassName(supername);
}
- for (int i = 0; i < interfaces.length; i++) {
- this.interfaceNames.add(toClassName(interfaces[i]));
+ for (String ... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-core/src/test/java/org/springframework/core/ParameterizedTypeReferenceTests.java | @@ -34,21 +34,21 @@ class ParameterizedTypeReferenceTests {
@Test
void stringTypeReference() {
- ParameterizedTypeReference<String> typeReference = new ParameterizedTypeReference<String>() {};
+ ParameterizedTypeReference<String> typeReference = new ParameterizedTypeReference<>() {};
assertThat(typeReference... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-core/src/test/java/org/springframework/core/convert/converter/DefaultConversionServiceTests.java | @@ -1096,10 +1096,9 @@ public SSN(String value) {
@Override
public boolean equals(Object o) {
- if (!(o instanceof SSN)) {
+ if (!(o instanceof SSN ssn)) {
return false;
}
- SSN ssn = (SSN) o;
return this.value.equals(ssn.value);
}
@@ -1137,10 +1136,9 @@ public ISBN(String value) {
... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-core/src/test/java/org/springframework/core/env/CustomEnvironmentTests.java | @@ -75,7 +75,7 @@ class CustomEnvironment extends AbstractEnvironment {
@Override
@SuppressWarnings("serial")
protected Set<String> getReservedDefaultProfiles() {
- return new HashSet<String>() {{
+ return new HashSet<>() {{
add("rd1");
add("rd2");
}}; | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-core/src/test/java/org/springframework/core/env/PropertySourceTests.java | @@ -37,10 +37,10 @@ class PropertySourceTests {
@Test
@SuppressWarnings("serial")
void equals() {
- Map<String, Object> map1 = new HashMap<String, Object>() {{
+ Map<String, Object> map1 = new HashMap<>() {{
put("a", "b");
}};
- Map<String, Object> map2 = new HashMap<String, Object>() {{
+ Map<String, ... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-core/src/test/java/org/springframework/util/concurrent/FutureAdapterTests.java | @@ -41,7 +41,7 @@ class FutureAdapterTests {
@SuppressWarnings("unchecked")
void setUp() {
adaptee = mock(Future.class);
- adapter = new FutureAdapter<String, Integer>(adaptee) {
+ adapter = new FutureAdapter<>(adaptee) {
@Override
protected String adapt(Integer adapteeResult) throws ExecutionException... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-core/src/testFixtures/java/org/springframework/core/testfixture/security/TestPrincipal.java | @@ -41,10 +41,9 @@ public boolean equals(Object obj) {
if (obj == this) {
return true;
}
- if (!(obj instanceof TestPrincipal)) {
+ if (!(obj instanceof TestPrincipal p)) {
return false;
}
- TestPrincipal p = (TestPrincipal) obj;
return this.name.equals(p.name);
}
| true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-jdbc/src/test/java/org/springframework/jdbc/core/support/LobSupportTests.java | @@ -111,7 +111,7 @@ public void testAbstractLobStreamingResultSetExtractorCorrectException()
}
private AbstractLobStreamingResultSetExtractor<Void> getResultSetExtractor(final boolean ex) {
- AbstractLobStreamingResultSetExtractor<Void> lobRse = new AbstractLobStreamingResultSetExtractor<Void>() {
+ AbstractLob... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-jdbc/src/test/java/org/springframework/jdbc/object/SqlQueryTests.java | @@ -107,7 +107,7 @@ public void testQueryWithoutParams() throws SQLException {
given(resultSet.next()).willReturn(true, false);
given(resultSet.getInt(1)).willReturn(1);
- SqlQuery<Integer> query = new MappingSqlQueryWithParameters<Integer>() {
+ SqlQuery<Integer> query = new MappingSqlQueryWithParameters<>()... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-jdbc/src/test/java/org/springframework/jdbc/support/KeyHolderTests.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.
@@ -16,7 +16,6 @@
package org.springframewor... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-messaging/src/test/java/org/springframework/messaging/simp/user/TestSimpSubscription.java | @@ -61,10 +61,9 @@ public boolean equals(Object other) {
if (this == other) {
return true;
}
- if (!(other instanceof SimpSubscription)) {
+ if (!(other instanceof SimpSubscription otherSubscription)) {
return false;
}
- SimpSubscription otherSubscription = (SimpSubscription) other;
return (Objec... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-web/src/test/java/org/springframework/http/client/AbstractHttpRequestFactoryTests.java | @@ -89,8 +89,7 @@ void echo() throws Exception {
final byte[] body = "Hello World".getBytes(StandardCharsets.UTF_8);
request.getHeaders().setContentLength(body.length);
- if (request instanceof StreamingHttpOutputMessage) {
- StreamingHttpOutputMessage streamingRequest = (StreamingHttpOutputMessage) request;... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-web/src/test/java/org/springframework/http/codec/xml/Jaxb2XmlDecoderTests.java | @@ -289,8 +289,7 @@ public boolean equals(Object o) {
if (this == o) {
return true;
}
- if (o instanceof TypePojo) {
- TypePojo other = (TypePojo) o;
+ if (o instanceof TypePojo other) {
return this.foo.equals(other.foo) && this.bar.equals(other.bar);
}
return false; | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-web/src/test/java/org/springframework/http/converter/json/GsonHttpMessageConverterTests.java | @@ -207,7 +207,7 @@ public void readAndWriteGenerics() throws Exception {
@Test
@SuppressWarnings("unchecked")
public void readAndWriteParameterizedType() throws Exception {
- ParameterizedTypeReference<List<MyBean>> beansList = new ParameterizedTypeReference<List<MyBean>>() {
+ ParameterizedTypeReference<List<... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-web/src/test/java/org/springframework/http/converter/json/JsonbHttpMessageConverterTests.java | @@ -207,7 +207,7 @@ public void readAndWriteGenerics() throws Exception {
@Test
@SuppressWarnings("unchecked")
public void readAndWriteParameterizedType() throws Exception {
- ParameterizedTypeReference<List<MyBean>> beansList = new ParameterizedTypeReference<List<MyBean>>() {};
+ ParameterizedTypeReference<Lis... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-web/src/test/java/org/springframework/http/converter/json/MappingJackson2HttpMessageConverterTests.java | @@ -281,7 +281,7 @@ protected JavaType getJavaType(Type type, @Nullable Class<?> contextClass) {
@Test
@SuppressWarnings("unchecked")
public void readAndWriteParameterizedType() throws Exception {
- ParameterizedTypeReference<List<MyBean>> beansList = new ParameterizedTypeReference<List<MyBean>>() {};
+ Paramet... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-web/src/test/java/org/springframework/http/converter/xml/Jaxb2CollectionHttpMessageConverterTests.java | @@ -224,8 +224,7 @@ public boolean equals(Object o) {
if (this == o) {
return true;
}
- if (o instanceof RootElement) {
- RootElement other = (RootElement) o;
+ if (o instanceof RootElement other) {
return this.type.equals(other.type);
}
return false;
@@ -256,8 +255,7 @@ public boolean ... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-web/src/test/java/org/springframework/http/server/reactive/ChannelSendOperatorTests.java | @@ -140,7 +140,7 @@ public void cancelWhileItemCached() {
return Mono.never();
});
- BaseSubscriber<Void> subscriber = new BaseSubscriber<Void>() {};
+ BaseSubscriber<Void> subscriber = new BaseSubscriber<>() {};
operator.subscribe(subscriber);
subscriber.cancel();
| true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-web/src/test/java/org/springframework/web/client/HttpMessageConverterExtractorTests.java | @@ -153,7 +153,7 @@ void cannotRead() throws IOException {
void generics() throws IOException {
responseHeaders.setContentType(contentType);
String expected = "Foo";
- ParameterizedTypeReference<List<String>> reference = new ParameterizedTypeReference<List<String>>() {};
+ ParameterizedTypeReference<List<Stri... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-web/src/test/java/org/springframework/web/client/RestTemplateIntegrationTests.java | @@ -115,8 +115,7 @@ static Stream<ClientHttpRequestFactory> clientHttpRequestFactories() {
*/
@RegisterExtension
TestExecutionExceptionHandler serverErrorToAssertionErrorConverter = (context, throwable) -> {
- if (throwable instanceof HttpServerErrorException) {
- HttpServerErrorException ex = (HttpServerErro... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-web/src/test/java/org/springframework/web/client/RestTemplateTests.java | @@ -646,7 +646,7 @@ void exchange() throws Exception {
void exchangeParameterizedType() throws Exception {
GenericHttpMessageConverter converter = mock(GenericHttpMessageConverter.class);
template.setMessageConverters(Collections.<HttpMessageConverter<?>>singletonList(converter));
- ParameterizedTypeReference<... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-web/src/testFixtures/java/org/springframework/web/testfixture/http/server/reactive/bootstrap/AbstractHttpHandlerIntegrationTests.java | @@ -52,8 +52,7 @@ public abstract class AbstractHttpHandlerIntegrationTests {
*/
@RegisterExtension
TestExecutionExceptionHandler serverErrorToAssertionErrorConverter = (context, throwable) -> {
- if (throwable instanceof HttpServerErrorException) {
- HttpServerErrorException ex = (HttpServerErrorException) t... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-web/src/testFixtures/java/org/springframework/web/testfixture/servlet/MockHttpServletRequest.java | @@ -1282,8 +1282,7 @@ public String getServletPath() {
public void setSession(HttpSession session) {
this.session = session;
- if (session instanceof MockHttpSession) {
- MockHttpSession mockSession = ((MockHttpSession) session);
+ if (session instanceof MockHttpSession mockSession) {
mockSession.access(... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-web/src/testFixtures/java/org/springframework/web/testfixture/servlet/MockHttpServletResponse.java | @@ -447,8 +447,7 @@ else if (expires != null) {
if (cookie.isHttpOnly()) {
buf.append("; HttpOnly");
}
- if (cookie instanceof MockCookie) {
- MockCookie mockCookie = (MockCookie) cookie;
+ if (cookie instanceof MockCookie mockCookie) {
if (StringUtils.hasText(mockCookie.getSameSite())) {
buf.app... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-web/src/testFixtures/java/org/springframework/web/testfixture/xml/Pojo.java | @@ -57,8 +57,7 @@ public boolean equals(Object o) {
if (this == o) {
return true;
}
- if (o instanceof Pojo) {
- Pojo other = (Pojo) o;
+ if (o instanceof Pojo other) {
return this.foo.equals(other.foo) && this.bar.equals(other.bar);
}
return false; | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-webflux/src/test/java/org/springframework/web/reactive/function/client/DefaultClientRequestBuilderTests.java | @@ -202,7 +202,7 @@ public void bodyClass() {
public void bodyParameterizedTypeReference() {
String body = "foo";
Publisher<String> publisher = Mono.just(body);
- ParameterizedTypeReference<String> typeReference = new ParameterizedTypeReference<String>() {};
+ ParameterizedTypeReference<String> typeReference ... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-webflux/src/test/java/org/springframework/web/reactive/function/client/support/ClientResponseWrapperTests.java | @@ -111,7 +111,7 @@ public void bodyToMonoClass() {
@Test
public void bodyToMonoParameterizedTypeReference() {
Mono<String> result = Mono.just("foo");
- ParameterizedTypeReference<String> reference = new ParameterizedTypeReference<String>() {};
+ ParameterizedTypeReference<String> reference = new Parameterized... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-webflux/src/test/java/org/springframework/web/reactive/function/server/DefaultEntityResponseBuilderTests.java | @@ -71,15 +71,15 @@ public void fromPublisherClass() {
@Test
public void fromPublisher() {
Flux<String> body = Flux.just("foo", "bar");
- ParameterizedTypeReference<String> typeReference = new ParameterizedTypeReference<String>() {};
+ ParameterizedTypeReference<String> typeReference = new ParameterizedTypeRef... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-webflux/src/test/java/org/springframework/web/reactive/function/server/DefaultServerRequestTests.java | @@ -288,7 +288,7 @@ public void bodyToMonoParameterizedTypeReference() {
.body(body);
DefaultServerRequest request = new DefaultServerRequest(MockServerWebExchange.from(mockRequest), messageReaders);
- ParameterizedTypeReference<String> typeReference = new ParameterizedTypeReference<String>() {};
+ Paramete... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-webflux/src/test/java/org/springframework/web/reactive/function/server/DispatcherHandlerIntegrationTests.java | @@ -88,7 +88,7 @@ void mono(HttpServer httpServer) throws Exception {
void flux(HttpServer httpServer) throws Exception {
startServer(httpServer);
- ParameterizedTypeReference<List<Person>> reference = new ParameterizedTypeReference<List<Person>>() {};
+ ParameterizedTypeReference<List<Person>> reference = new... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-webflux/src/test/java/org/springframework/web/reactive/function/server/PublisherHandlerFunctionIntegrationTests.java | @@ -69,7 +69,7 @@ void mono(HttpServer httpServer) throws Exception {
void flux(HttpServer httpServer) throws Exception {
startServer(httpServer);
- ParameterizedTypeReference<List<Person>> reference = new ParameterizedTypeReference<List<Person>>() {};
+ ParameterizedTypeReference<List<Person>> reference = new... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-webflux/src/test/java/org/springframework/web/reactive/function/server/support/ServerRequestWrapperTests.java | @@ -159,7 +159,7 @@ public void bodyToMonoClass() {
@Test
public void bodyToMonoParameterizedTypeReference() {
Mono<String> result = Mono.just("foo");
- ParameterizedTypeReference<String> reference = new ParameterizedTypeReference<String>() {};
+ ParameterizedTypeReference<String> reference = new Parameterized... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/MessageReaderArgumentResolverTests.java | @@ -353,8 +353,7 @@ public boolean equals(Object o) {
if (this == o) {
return true;
}
- if (o instanceof TestBean) {
- TestBean other = (TestBean) o;
+ if (o instanceof TestBean other) {
return this.foo.equals(other.foo) && this.bar.equals(other.bar);
}
return false; | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/RequestMappingMessageConversionIntegrationTests.java | @@ -71,7 +71,7 @@
public class RequestMappingMessageConversionIntegrationTests extends AbstractRequestMappingIntegrationTests {
private static final ParameterizedTypeReference<List<Person>> PERSON_LIST =
- new ParameterizedTypeReference<List<Person>>() {};
+ new ParameterizedTypeReference<>() {};
private s... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-webmvc/src/test/java/org/springframework/web/context/ContextLoaderTests.java | @@ -347,7 +347,7 @@ private static class TestContextInitializer implements ApplicationContextInitial
@Override
public void initialize(ConfigurableApplicationContext applicationContext) {
ConfigurableEnvironment environment = applicationContext.getEnvironment();
- environment.getPropertySources().addFirst(ne... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-webmvc/src/test/java/org/springframework/web/context/XmlWebApplicationContextTests.java | @@ -56,8 +56,8 @@ protected ConfigurableApplicationContext createContext() throws Exception {
root.addBeanFactoryPostProcessor(beanFactory -> beanFactory.addBeanPostProcessor(new BeanPostProcessor() {
@Override
public Object postProcessBeforeInitialization(Object bean, String name) throws BeansException {
- ... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-webmvc/src/test/java/org/springframework/web/servlet/config/annotation/InterceptorRegistryTests.java | @@ -182,8 +182,7 @@ private List<HandlerInterceptor> getInterceptorsForPath(String lookupPath) {
PathMatcher pathMatcher = new AntPathMatcher();
List<HandlerInterceptor> result = new ArrayList<>();
for (Object interceptor : this.registry.getInterceptors()) {
- if (interceptor instanceof MappedInterceptor) {
... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-webmvc/src/test/java/org/springframework/web/servlet/i18n/LocaleResolverTests.java | @@ -83,8 +83,7 @@ private void doTest(LocaleResolver localeResolver, boolean shouldSet) {
}
// check LocaleContext
- if (localeResolver instanceof LocaleContextResolver) {
- LocaleContextResolver localeContextResolver = (LocaleContextResolver) localeResolver;
+ if (localeResolver instanceof LocaleContextRes... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/ItemPet.java | @@ -46,10 +46,9 @@ public boolean equals(Object other) {
if (this == other) {
return true;
}
- if (!(other instanceof ItemPet)) {
+ if (!(other instanceof ItemPet otherPet)) {
return false;
}
- ItemPet otherPet = (ItemPet) other;
return (this.name != null && this.name.equals(otherPet.getName()));... | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/OptionTagTests.java | @@ -556,8 +556,7 @@ public static RulesVariant fromId(String id) {
@Override
public boolean equals(Object obj) {
- if (obj instanceof RulesVariant) {
- RulesVariant other = (RulesVariant) obj;
+ if (obj instanceof RulesVariant other) {
return this.toId().equals(other.toId());
}
return false; | true |
Other | spring-projects | spring-framework | b3f786728ea7ccfc1660cc5b2dfdbc8b4c20ab5f.json | Use modern language features in tests | spring-websocket/src/test/java/org/springframework/web/socket/UndertowTestServer.java | @@ -144,7 +144,7 @@ public DispatcherServletInstanceFactory(WebApplicationContext wac) {
@Override
public InstanceHandle<Servlet> createInstance() throws InstantiationException {
- return new InstanceHandle<Servlet>() {
+ return new InstanceHandle<>() {
@Override
public Servlet getInstance() {
... | true |
Other | spring-projects | spring-framework | 32cd73261a3094a289b8d0d62f76c8e413fe3f86.json | Apply "switch expressions" where applicable | spring-context/src/main/java/org/springframework/format/datetime/standard/DateTimeFormatterFactory.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.
@@ -139,14 +139,14 @@ public void setStylePatte... | true |
Other | spring-projects | spring-framework | 32cd73261a3094a289b8d0d62f76c8e413fe3f86.json | Apply "switch expressions" where applicable | spring-jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseConfigurerFactory.java | @@ -1,5 +1,5 @@
/*
- * Copyright 2002-2018 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.
@@ -42,16 +42,12 @@ private EmbeddedDatabaseCon... | true |
Other | spring-projects | spring-framework | 32cd73261a3094a289b8d0d62f76c8e413fe3f86.json | Apply "switch expressions" where applicable | spring-jdbc/src/main/java/org/springframework/jdbc/support/SQLErrorCodeSQLExceptionTranslator.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.
@@ -64,6 +64,7 @@
* @author Rod Johnson
* @... | true |
Other | spring-projects | spring-framework | 32cd73261a3094a289b8d0d62f76c8e413fe3f86.json | Apply "switch expressions" where applicable | spring-jms/src/main/java/org/springframework/jms/support/converter/MappingJackson2MessageConverter.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.
@@ -179,16 +179,11 @@ public void setBeanClassL... | true |
Other | spring-projects | spring-framework | c263cbfbe486d7712b9e46b80ed151c1eda98c74.json | Fix broken test missed in merge | integration-tests/src/test/java/org/springframework/context/annotation/jsr330/ClassPathBeanDefinitionScannerJsr330ScopeIntegrationTests.java | @@ -318,7 +318,7 @@ else if (annDef.getMetadata().getMetaAnnotationTypes(type).contains(jakarta.inje
metadata.setScopedProxyMode(scopedProxyMode);
break;
}
- else if (type.startsWith("javax.inject")) {
+ else if (type.startsWith("jakarta.inject")) {
metadata.setScopeName(BeanDefinitio... | false |
Other | spring-projects | spring-framework | f8a5a8d7be6040e60c21107c14fc394e67e75e6b.json | Use modern language features in tests | integration-tests/src/test/java/org/springframework/context/annotation/jsr330/ClassPathBeanDefinitionScannerJsr330ScopeIntegrationTests.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.
@@ -34,7 +34,6 @@
import org.springframework.c... | true |
Other | spring-projects | spring-framework | f8a5a8d7be6040e60c21107c14fc394e67e75e6b.json | Use modern language features in tests | spring-aop/src/test/java/org/springframework/aop/interceptor/ConcurrencyThrottleInterceptorTests.java | @@ -125,16 +125,7 @@ public void run() {
try {
this.proxy.exceptional(this.ex);
}
- catch (RuntimeException ex) {
- if (ex == this.ex) {
- logger.debug("Expected exception thrown", ex);
- }
- else {
- // should never happen
- ex.printStackTrace();
- }
- }
- catch ... | true |
Other | spring-projects | spring-framework | f8a5a8d7be6040e60c21107c14fc394e67e75e6b.json | Use modern language features in tests | spring-beans/src/test/java/org/springframework/beans/AbstractPropertyValuesTests.java | @@ -43,13 +43,13 @@ protected void doTestTony(PropertyValues pvs) {
m.put("forname", "Tony");
m.put("surname", "Blair");
m.put("age", "50");
- for (int i = 0; i < ps.length; i++) {
- Object val = m.get(ps[i].getName());
+ for (PropertyValue element : ps) {
+ Object val = m.get(element.getName());
ass... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.