diff --git a/src/main/java/org/apache/ibatis/reflection/Reflector.java b/src/main/java/org/apache/ibatis/reflection/Reflector.java index 1cf6c1ab451..06dd7c6ba38 100644 --- a/src/main/java/org/apache/ibatis/reflection/Reflector.java +++ b/src/main/java/org/apache/ibatis/reflection/Reflector.java @@ -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. @@ -313,7 +313,8 @@ private boolean isValidPropertyName(String name) { private Method[] getClassMethods(Class cls) { Map uniqueMethods = new HashMap(); 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 -