SEC-599: Refactoring to use Map.Entry for iterating through patterns.
This commit is contained in:
parent
04c89e0795
commit
a40bb11be3
|
@ -111,10 +111,11 @@ public abstract class AbstractFilterInvocationDefinitionSource implements Filter
|
|||
}
|
||||
}
|
||||
|
||||
Iterator patterns = requestMap.keySet().iterator();
|
||||
Iterator entries = requestMap.entrySet().iterator();
|
||||
|
||||
while (patterns.hasNext()) {
|
||||
Object p = patterns.next();
|
||||
while (entries.hasNext()) {
|
||||
Map.Entry entry = (Map.Entry) entries.next();
|
||||
Object p = entry.getKey();
|
||||
boolean matched = urlMatcher.pathMatchesUrl(p, url);
|
||||
|
||||
if (logger.isDebugEnabled()) {
|
||||
|
@ -122,7 +123,7 @@ public abstract class AbstractFilterInvocationDefinitionSource implements Filter
|
|||
}
|
||||
|
||||
if (matched) {
|
||||
return (ConfigAttributeDefinition) getRequestMap().get(p);
|
||||
return (ConfigAttributeDefinition) entry.getValue();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -47,14 +47,6 @@ public class AbstractFilterInvocationDefinitionSourceTests extends TestCase {
|
|||
|
||||
//~ Methods ========================================================================================================
|
||||
|
||||
public static void main(String[] args) {
|
||||
junit.textui.TestRunner.run(AbstractFilterInvocationDefinitionSourceTests.class);
|
||||
}
|
||||
|
||||
public final void setUp() throws Exception {
|
||||
super.setUp();
|
||||
}
|
||||
|
||||
public void testDoesNotSupportAnotherObject() {
|
||||
MockFilterInvocationDefinitionSource mfis = new MockFilterInvocationDefinitionSource(false, true);
|
||||
assertFalse(mfis.supports(String.class));
|
||||
|
|
Loading…
Reference in New Issue