Skip to content

Commit

Permalink
Make BytecodeGen work with Java 9.
Browse files Browse the repository at this point in the history
The name of the sun.reflect package has changed to jdk.internal.reflect
in Java 9.  This was stopping the open-source testGuiceWorksInOSGiContainer test
from passing.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=183320310
  • Loading branch information
jhmanson authored and ronshapiro committed Jan 29, 2018
1 parent d95c8c0 commit 9a3b8a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/com/google/inject/internal/BytecodeGen.java
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ private static class BridgeClassLoader extends ClassLoader {
@Override
protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {

if (name.startsWith("sun.reflect")) {
if (name.startsWith("sun.reflect") || name.startsWith("jdk.internal.reflect")) {
// these reflection classes must be loaded from bootstrap class loader
return SystemBridgeHolder.SYSTEM_BRIDGE.classicLoadClass(name, resolve);
}
Expand Down

0 comments on commit 9a3b8a1

Please sign in to comment.