Add missing break statements to stop looping when result is known

Closes gh-22573
master
Сергей Цыпанов 6 years ago committed by Sam Brannen
parent 96cd4411e5
commit a35adc6ea6
  1. 1
      spring-beans/src/test/java/org/springframework/beans/ExtendedBeanInfoTests.java
  2. 1
      spring-context/src/main/java/org/springframework/scripting/support/StandardScriptFactory.java
  3. 3
      spring-core/src/test/java/org/springframework/core/io/support/PathMatchingResourcePatternResolverTests.java

@ -754,6 +754,7 @@ public class ExtendedBeanInfoTests {
for (PropertyDescriptor pd : ebi.getPropertyDescriptors()) { for (PropertyDescriptor pd : ebi.getPropertyDescriptors()) {
if (pd.getName().equals("foo")) { if (pd.getName().equals("foo")) {
found = true; found = true;
break;
} }
} }
assertThat(found, is(true)); assertThat(found, is(true));

@ -151,6 +151,7 @@ public class StandardScriptFactory implements ScriptFactory, BeanClassLoaderAwar
if (script instanceof Class ? !requestedIfc.isAssignableFrom((Class<?>) script) : if (script instanceof Class ? !requestedIfc.isAssignableFrom((Class<?>) script) :
!requestedIfc.isInstance(script)) { !requestedIfc.isInstance(script)) {
adaptationRequired = true; adaptationRequired = true;
break;
} }
} }
if (adaptationRequired) { if (adaptationRequired) {

@ -89,7 +89,7 @@ public class PathMatchingResourcePatternResolverTests {
noCloverResources.add(resource); noCloverResources.add(resource);
} }
} }
resources = noCloverResources.toArray(new Resource[noCloverResources.size()]); resources = noCloverResources.toArray(new Resource[0]);
assertProtocolAndFilenames(resources, "file", assertProtocolAndFilenames(resources, "file",
StringUtils.concatenateStringArrays(CLASSES_IN_CORE_IO_SUPPORT, TEST_CLASSES_IN_CORE_IO_SUPPORT)); StringUtils.concatenateStringArrays(CLASSES_IN_CORE_IO_SUPPORT, TEST_CLASSES_IN_CORE_IO_SUPPORT));
} }
@ -113,6 +113,7 @@ public class PathMatchingResourcePatternResolverTests {
for (Resource resource : resources) { for (Resource resource : resources) {
if (resource.getFilename().equals("aspectj_1_5_0.dtd")) { if (resource.getFilename().equals("aspectj_1_5_0.dtd")) {
found = true; found = true;
break;
} }
} }
assertTrue("Could not find aspectj_1_5_0.dtd in the root of the aspectjweaver jar", found); assertTrue("Could not find aspectj_1_5_0.dtd in the root of the aspectjweaver jar", found);

Loading…
Cancel
Save