Skip to content

Commit 6beb383

Browse files
committed
Sonar
Signed-off-by: Duane May <[email protected]>
1 parent f977ffd commit 6beb383

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

server/src/main/java/org/cloudfoundry/identity/uaa/provider/ldap/extension/LdapAuthority.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
* An authority that contains at least a DN and a role name for an LDAP entry
2525
* but can also contain other desired attributes to be fetched during an LDAP
2626
* authority search.
27+
*
2728
* @author Filip Hanik
2829
*/
2930
public class LdapAuthority implements GrantedAuthority {
@@ -84,16 +85,14 @@ public boolean equals(Object o) {
8485
if (this == o) {
8586
return true;
8687
}
87-
if (!(o instanceof LdapAuthority)) {
88+
if (!(o instanceof LdapAuthority that)) {
8889
return false;
8990
}
9091

91-
LdapAuthority that = (LdapAuthority) o;
92-
9392
if (!dn.equals(that.dn)) {
9493
return false;
9594
}
96-
return !!Objects.equals(role, that.role);
95+
return Objects.equals(role, that.role);
9796
}
9897

9998
@Override

server/src/main/java/org/cloudfoundry/identity/uaa/scim/event/GroupModifiedEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public boolean equals(Object o) {
127127
if (!group.equals(groupInfo.group)) {
128128
return false;
129129
}
130-
return !!Arrays.equals(members, groupInfo.members);
130+
return Arrays.equals(members, groupInfo.members);
131131
}
132132

133133
@Override

server/src/main/java/org/cloudfoundry/identity/uaa/security/web/UaaRequestMatcher.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ public UaaRequestMatcher(String path) {
5454
/**
5555
* The HttpMethod that the request should be made with. Optional (if null,
5656
* then all values match)
57-
*
58-
* @param method
5957
*/
6058
public void setMethod(HttpMethod method) {
6159
this.method = method;
@@ -155,10 +153,9 @@ private boolean matchesAcceptHeader(String requestValue, List<String> expectedVa
155153

156154
@Override
157155
public boolean equals(Object obj) {
158-
if (!(obj instanceof UaaRequestMatcher)) {
156+
if (!(obj instanceof UaaRequestMatcher other)) {
159157
return false;
160158
}
161-
UaaRequestMatcher other = (UaaRequestMatcher) obj;
162159
if (!this.path.equals(other.path)) {
163160
return false;
164161
}
@@ -177,8 +174,8 @@ public boolean equals(Object obj) {
177174
return false;
178175
}
179176

180-
return !!((this.expectedHeaders == null && other.expectedHeaders == null) || (this.expectedHeaders != null && this.expectedHeaders
181-
.equals(other.expectedHeaders)));
177+
return (this.expectedHeaders == null && other.expectedHeaders == null) || (this.expectedHeaders != null && this.expectedHeaders
178+
.equals(other.expectedHeaders));
182179
}
183180

184181
@Override

0 commit comments

Comments
 (0)