Skip to content

Commit

Permalink
Skip Object when collecting class methods (#1180)
Browse files Browse the repository at this point in the history
As a side effect, this might reduce the chance of 'illegal reflective access' warnings on Java 9. #1156
  • Loading branch information
loicmathieu authored and harawata committed Feb 1, 2018
1 parent b4d4e29 commit 9a19aed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/apache/ibatis/reflection/Reflector.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2009-2017 the original author or authors.
* Copyright 2009-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -313,7 +313,7 @@ private boolean isValidPropertyName(String name) {
private Method[] getClassMethods(Class<?> cls) {
Map<String, Method> uniqueMethods = new HashMap<String, Method>();
Class<?> currentClass = cls;
while (currentClass != null) {
while (currentClass != null && currentClass != Object.class) {
addUniqueMethods(uniqueMethods, currentClass.getDeclaredMethods());

// we also need to look for interface methods -
Expand Down

2 comments on commit 9a19aed

@xl1605368195
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes are meaningless.
Object.class.getSuperclass=null

@harawata
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xl1605368195 ,
Um...I think you are misunderstanding something.
Please elaborate if you still believe the change is meaningless.

Please sign in to comment.