Skip to content

Commit 7c52397

Browse files
committed
Polishing
1 parent 2c0a505 commit 7c52397

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

spring-context/src/main/java/org/springframework/cache/interceptor/SimpleKey.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232
@SuppressWarnings("serial")
3333
public class SimpleKey implements Serializable {
3434

35-
/** An empty key. */
35+
/**
36+
* An empty key.
37+
*/
3638
public static final SimpleKey EMPTY = new SimpleKey();
3739

3840

spring-context/src/main/java/org/springframework/jmx/export/assembler/InterfaceBasedMBeanInfoAssembler.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -207,7 +207,7 @@ protected boolean includeOperation(Method method, String beanKey) {
207207
* configured interfaces and is public, otherwise {@code false}.
208208
*/
209209
private boolean isPublicInInterface(Method method, String beanKey) {
210-
return ((method.getModifiers() & Modifier.PUBLIC) > 0) && isDeclaredInInterface(method, beanKey);
210+
return Modifier.isPublic(method.getModifiers()) && isDeclaredInInterface(method, beanKey);
211211
}
212212

213213
/**
@@ -231,6 +231,7 @@ private boolean isDeclaredInInterface(Method method, String beanKey) {
231231
for (Class<?> ifc : ifaces) {
232232
for (Method ifcMethod : ifc.getMethods()) {
233233
if (ifcMethod.getName().equals(method.getName()) &&
234+
ifcMethod.getParameterCount() == method.getParameterCount() &&
234235
Arrays.equals(ifcMethod.getParameterTypes(), method.getParameterTypes())) {
235236
return true;
236237
}

spring-context/src/test/java/org/springframework/cache/interceptor/SimpleKeyGeneratorTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public void noValues() {
4444
}
4545

4646
@Test
47-
public void singleValue(){
47+
public void singleValue() {
4848
Object k1 = generateKey(new Object[] { "a" });
4949
Object k2 = generateKey(new Object[] { "a" });
5050
Object k3 = generateKey(new Object[] { "different" });
@@ -56,7 +56,7 @@ public void singleValue(){
5656
}
5757

5858
@Test
59-
public void multipleValues() {
59+
public void multipleValues() {
6060
Object k1 = generateKey(new Object[] { "a", 1, "b" });
6161
Object k2 = generateKey(new Object[] { "a", 1, "b" });
6262
Object k3 = generateKey(new Object[] { "b", 1, "a" });

0 commit comments

Comments
 (0)