Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 949c3d4

Browse filesBrowse files
committed
Align plain accessor check
1 parent 3b4ae7b commit 949c3d4
Copy full SHA for 949c3d4

File tree

Expand file treeCollapse file tree

1 file changed

+6
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-3
lines changed

‎spring-beans/src/main/java/org/springframework/beans/CachedIntrospectionResults.java

Copy file name to clipboardExpand all lines: spring-beans/src/main/java/org/springframework/beans/CachedIntrospectionResults.java
+6-3Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ private void introspectPlainAccessors(Class<?> beanClass, Set<String> readMethod
367367

368368
for (Method method : beanClass.getMethods()) {
369369
if (!this.propertyDescriptors.containsKey(method.getName()) &&
370-
!readMethodNames.contains((method.getName())) && isPlainAccessor(method)) {
370+
!readMethodNames.contains(method.getName()) && isPlainAccessor(method)) {
371371
this.propertyDescriptors.put(method.getName(),
372372
new GenericTypeAwarePropertyDescriptor(beanClass, method.getName(), method, null, null));
373373
readMethodNames.add(method.getName());
@@ -376,8 +376,11 @@ private void introspectPlainAccessors(Class<?> beanClass, Set<String> readMethod
376376
}
377377

378378
private boolean isPlainAccessor(Method method) {
379-
if (method.getParameterCount() > 0 || method.getReturnType() == void.class ||
380-
method.getDeclaringClass() == Object.class || Modifier.isStatic(method.getModifiers())) {
379+
if (Modifier.isStatic(method.getModifiers()) ||
380+
method.getDeclaringClass() == Object.class || method.getDeclaringClass() == Class.class ||
381+
method.getParameterCount() > 0 || method.getReturnType() == void.class ||
382+
ClassLoader.class.isAssignableFrom(method.getReturnType()) ||
383+
ProtectionDomain.class.isAssignableFrom(method.getReturnType())) {
381384
return false;
382385
}
383386
try {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.