[java-identity-provider COMMIT] in /trunk/idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filter...
noreply at shibboleth.net
noreply at shibboleth.net
Sun Jan 18 15:04:56 EST 2015
Author: scantor
Date: Sun Jan 18 15:04:56 2015
New Revision: 7263
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=7263&view=rev
Log:
Code cleanup
Modified:
trunk/idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filter/matcher/impl/AbstractRegexpStringMatcher.java
trunk/idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filter/matcher/impl/AttributeValueRegexpMatcher.java
trunk/idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filter/matcher/impl/AttributeValueStringMatcher.java
Modified: trunk/idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filter/matcher/impl/AbstractRegexpStringMatcher.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filter/matcher/impl/AbstractRegexpStringMatcher.java?rev=7263&r1=7262&r2=7263&view=diff
==============================================================================
--- trunk/idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filter/matcher/impl/AbstractRegexpStringMatcher.java (original)
+++ trunk/idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filter/matcher/impl/AbstractRegexpStringMatcher.java Sun Jan 18 15:04:56 2015
@@ -32,7 +32,7 @@
public abstract class AbstractRegexpStringMatcher extends AbstractMatcher {
/** Regular expression to match. */
- private Pattern regex;
+ @NonnullAfterInit private Pattern regex;
/**
* Gets the regular expression to match.
@@ -60,7 +60,7 @@
*
* @return true if the value matches the given match string, false if not
*/
- protected final boolean regexpCompare(@Nullable final String value) {
+ protected boolean regexpCompare(@Nullable final String value) {
ComponentSupport.ifNotInitializedThrowUninitializedComponentException(this);
if (regex == null || value == null) {
return false;
@@ -74,10 +74,12 @@
}
/** {@inheritDoc} */
+ @Override
protected void doInitialize() throws ComponentInitializationException {
super.doInitialize();
if (null == regex) {
throw new ComponentInitializationException(getLogPrefix() + " No regular expression provided");
}
}
-}
+
+}
Modified: trunk/idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filter/matcher/impl/AttributeValueRegexpMatcher.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filter/matcher/impl/AttributeValueRegexpMatcher.java?rev=7263&r1=7262&r2=7263&view=diff
==============================================================================
--- trunk/idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filter/matcher/impl/AttributeValueRegexpMatcher.java (original)
+++ trunk/idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filter/matcher/impl/AttributeValueRegexpMatcher.java Sun Jan 18 15:04:56 2015
@@ -43,11 +43,10 @@
}
if (value instanceof StringAttributeValue) {
- final StringAttributeValue stringValue = (StringAttributeValue) value;
- return regexpCompare(stringValue.getValue());
+ return regexpCompare(((StringAttributeValue) value).getValue());
} else {
- final String valueAsString = ((IdPAttributeValue) value).getValue().toString();
+ final String valueAsString = value.getValue().toString();
log.warn("{} Object supplied to StringAttributeValue comparison"
+ " was of class {}, not StringAttributeValue, comparing with {}", new Object[] {
getLogPrefix(), value.getClass().getName(), valueAsString,});
@@ -55,4 +54,4 @@
}
}
-}
+}
Modified: trunk/idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filter/matcher/impl/AttributeValueStringMatcher.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filter/matcher/impl/AttributeValueStringMatcher.java?rev=7263&r1=7262&r2=7263&view=diff
==============================================================================
--- trunk/idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filter/matcher/impl/AttributeValueStringMatcher.java (original)
+++ trunk/idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filter/matcher/impl/AttributeValueStringMatcher.java Sun Jan 18 15:04:56 2015
@@ -17,6 +17,7 @@
package net.shibboleth.idp.attribute.filter.matcher.impl;
+import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import net.shibboleth.idp.attribute.IdPAttributeValue;
@@ -33,7 +34,7 @@
public class AttributeValueStringMatcher extends AbstractStringMatcher {
/** Logger. */
- private final Logger log = LoggerFactory.getLogger(AttributeValueStringMatcher.class);
[... 11 lines stripped ...]
More information about the commits
mailing list