Skip to content

Commit

Permalink
fix(mybatis#1156): illegal reflective access on java 9
Browse files Browse the repository at this point in the history
  • Loading branch information
Loïc Mathieu committed Jan 30, 2018
1 parent b4d4e29 commit 02ff593
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 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,8 @@ private boolean isValidPropertyName(String name) {
private Method[] getClassMethods(Class<?> cls) {
Map<String, Method> uniqueMethods = new HashMap<String, Method>();
Class<?> currentClass = cls;
while (currentClass != null) {
//there's no point of looking thought method of Object class and it causes illegal reflection access on Java 9
while (currentClass != null && currentClass != Object.class) {
addUniqueMethods(uniqueMethods, currentClass.getDeclaredMethods());

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

0 comments on commit 02ff593

Please sign in to comment.