Skip to content

Commit 9a19aed

Browse files
loicmathieuharawata
authored andcommitted
Skip Object when collecting class methods (#1180)
As a side effect, this might reduce the chance of 'illegal reflective access' warnings on Java 9. #1156
1 parent b4d4e29 commit 9a19aed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/org/apache/ibatis/reflection/Reflector.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2009-2017 the original author or authors.
2+
* Copyright 2009-2018 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.
@@ -313,7 +313,7 @@ private boolean isValidPropertyName(String name) {
313313
private Method[] getClassMethods(Class<?> cls) {
314314
Map<String, Method> uniqueMethods = new HashMap<String, Method>();
315315
Class<?> currentClass = cls;
316-
while (currentClass != null) {
316+
while (currentClass != null && currentClass != Object.class) {
317317
addUniqueMethods(uniqueMethods, currentClass.getDeclaredMethods());
318318

319319
// we also need to look for interface methods -

0 commit comments

Comments
 (0)