[java-identity-provider] 03/03: Checkstyle found bug in taglibs
Rod Widdowson
rdw at steadingsoftware.com
Tue Feb 12 11:57:11 EST 2019
This is an automated email from the git hooks/post-receive script.
rdw pushed a commit to branch master
in repository java-identity-provider.
View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=c5fc228737bb92210784f240f68c5bdc6a541505
commit c5fc228737bb92210784f240f68c5bdc6a541505
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Tue Feb 12 16:31:15 2019 +0000
Checkstyle found bug in taglibs
We were comparing an enum with a string, which checkstyle complained about.
We should have been comapring string with strine, so do this.
Note that this code looks like a straight V2 port (by virtue of having
a private static final long serialVersionUID ....) So this is probably
a very old bug. Or not a bug at all, but it is cleaner like this.
---
.../net/shibboleth/idp/ui/taglib/ServiceContactTag.java | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/idp-ui/src/main/java/net/shibboleth/idp/ui/taglib/ServiceContactTag.java b/idp-ui/src/main/java/net/shibboleth/idp/ui/taglib/ServiceContactTag.java
index 8a40545..326e214 100644
--- a/idp-ui/src/main/java/net/shibboleth/idp/ui/taglib/ServiceContactTag.java
+++ b/idp-ui/src/main/java/net/shibboleth/idp/ui/taglib/ServiceContactTag.java
@@ -55,28 +55,25 @@ public class ServiceContactTag extends ServiceTagSupport {
*
* @param type in value
*/
- // Checkstyle: ReturnCount OFF
public void setContactType(@Nullable final String type) {
if (null == type || 0 == type.length()) {
log.warn("no parameter provided to contactType");
return;
}
- if (type.equals(ContactPersonTypeEnumeration.ADMINISTRATIVE)) {
+ if (type.equals(ContactPersonTypeEnumeration.ADMINISTRATIVE.toString())) {
contactType = ContactPersonTypeEnumeration.ADMINISTRATIVE;
- } else if (type.equals(ContactPersonTypeEnumeration.BILLING)) {
+ } else if (type.equals(ContactPersonTypeEnumeration.BILLING.toString())) {
contactType = ContactPersonTypeEnumeration.BILLING;
- } else if (type.equals(ContactPersonTypeEnumeration.OTHER)) {
+ } else if (type.equals(ContactPersonTypeEnumeration.OTHER.toString())) {
contactType = ContactPersonTypeEnumeration.OTHER;
- } else if (type.equals(ContactPersonTypeEnumeration.SUPPORT)) {
+ } else if (type.equals(ContactPersonTypeEnumeration.SUPPORT.toString())) {
contactType = ContactPersonTypeEnumeration.SUPPORT;
- } else if (type.equals(ContactPersonTypeEnumeration.TECHNICAL)) {
+ } else if (type.equals(ContactPersonTypeEnumeration.TECHNICAL.toString())) {
contactType = ContactPersonTypeEnumeration.TECHNICAL;
} else {
log.warn("parameter provided to contactType:" + type + " is invalid");
- return;
}
}
- // Checkstyle: ReturnCount ON
/**
* Set the contact name.
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list