Skip to content

Commit

Permalink
Add missing break statements to stop looping when result is known
Browse files Browse the repository at this point in the history
Closes gh-22573
  • Loading branch information
stsypanov authored and sbrannen committed Mar 12, 2019
1 parent 96cd441 commit a35adc6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,7 @@ class ExtendedTestBean extends TestBean {
for (PropertyDescriptor pd : ebi.getPropertyDescriptors()) {
if (pd.getName().equals("foo")) {
found = true;
break;
}
}
assertThat(found, is(true));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ public Object getScriptedObject(ScriptSource scriptSource, @Nullable Class<?>...
if (script instanceof Class ? !requestedIfc.isAssignableFrom((Class<?>) script) :
!requestedIfc.isInstance(script)) {
adaptationRequired = true;
break;
}
}
if (adaptationRequired) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public void classpathStarWithPatternOnFileSystem() throws IOException {
noCloverResources.add(resource);
}
}
resources = noCloverResources.toArray(new Resource[noCloverResources.size()]);
resources = noCloverResources.toArray(new Resource[0]);
assertProtocolAndFilenames(resources, "file",
StringUtils.concatenateStringArrays(CLASSES_IN_CORE_IO_SUPPORT, TEST_CLASSES_IN_CORE_IO_SUPPORT));
}
Expand All @@ -113,6 +113,7 @@ public void rootPatternRetrievalInJarFiles() throws IOException {
for (Resource resource : resources) {
if (resource.getFilename().equals("aspectj_1_5_0.dtd")) {
found = true;
break;
}
}
assertTrue("Could not find aspectj_1_5_0.dtd in the root of the aspectjweaver jar", found);
Expand Down

0 comments on commit a35adc6

Please sign in to comment.