-
Bug
-
Resolution: Fixed
-
P3
-
None
-
b20
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8206784 | 12 | Weijun Wang | P3 | Resolved | Fixed | team |
JDK-8206561 | 11.0.1 | Weijun Wang | P3 | Resolved | Fixed | b01 |
test/jdk/sun/security/provider/SecureRandom/CommonSeeder.java
This test currently uses reflection to hack into a Field object of a static final field to "non-final". It needs a white-box testing mechanism to replace this reflection hack.
static void setDefaultSeeder(EntropySource es) throws Exception {
Field f = AbstractDrbg.class.getDeclaredField("defaultES");
f.setAccessible(true); // no more private
Field f2 = Field.class.getDeclaredField("modifiers");
f2.setAccessible(true);
f2.setInt(f, f2.getInt(f) - Modifier.FINAL); // no more final
f.set(null, es);
}
This test currently uses reflection to hack into a Field object of a static final field to "non-final". It needs a white-box testing mechanism to replace this reflection hack.
static void setDefaultSeeder(EntropySource es) throws Exception {
Field f = AbstractDrbg.class.getDeclaredField("defaultES");
f.setAccessible(true); // no more private
Field f2 = Field.class.getDeclaredField("modifiers");
f2.setAccessible(true);
f2.setInt(f, f2.getInt(f) - Modifier.FINAL); // no more final
f.set(null, es);
}
- backported by
-
JDK-8206561 CommonSeeder test needs a white-box testing mechanism to replace the default entropy source
-
- Resolved
-
-
JDK-8206784 CommonSeeder test needs a white-box testing mechanism to replace the default entropy source
-
- Resolved
-
- relates to
-
JDK-8202113 Reflection API is causing caller classes to leak
-
- Closed
-