title: Differences in reflection between JDK 1.8 and JDK 16
body: <p>The following statement was executed in both Oracle JDK1.8 and OpenJDK 16, but the different results returned. Founded during daily developping, the confusing issue is whether the difference are intended to be so or just an obscure bug? I've already done searching the similary questions but no expected ones was founded.</p>
  <p>Examples,</p>
  <pre class="lang-java prettyprint-override"><code>Field[] declaredFields = Field.class.getDeclaredFields();
  // Field[12] with all private fields which are expected. (JDK 1.8)
  // Empty field array. (JDK 16)
  </code></pre>
  <p>Through debug mode, the critical statements are located: line 293, 309 in jdk.internal.reflect.Reflections. Those methods left without javadoc.</p>
  <pre class="lang-java prettyprint-override"><code>// line 293
  return (Field[])filter(fields, fieldFilterMap.get(containingClass));
  
  // line 309
  if (filteredNames.contains(WILDCARD)) {
      return (Member[]) Array.newInstance(memberType, 0);
  }
  </code></pre>