Skip to content

Commit

Permalink
Add missing implementation of JavaLangInvokeAccess.makeTrustedLookup
Browse files Browse the repository at this point in the history
  • Loading branch information
mpfaff committed Aug 10, 2024
1 parent 0185ce7 commit 4348953
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1643,6 +1643,11 @@ public MethodHandle serializableConstructor(Class<?> decl, Constructor<?> ctorTo
return IMPL_LOOKUP.serializableConstructor(decl, ctorToCall);
}

@Override
public Lookup makeTrustedLookup(Class<?> lookupClass) {
return new Lookup(lookupClass, null, Lookup.TRUSTED);
}

});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1529,7 +1529,7 @@ class Lookup {

private static final int ALL_MODES = (PUBLIC | PRIVATE | PROTECTED | PACKAGE | MODULE | UNCONDITIONAL | ORIGINAL);
private static final int FULL_POWER_MODES = (ALL_MODES & ~UNCONDITIONAL); // with original access
private static final int TRUSTED = -1;
static final int TRUSTED = -1;

/*
* Adjust PUBLIC => PUBLIC|MODULE|ORIGINAL|UNCONDITIONAL
Expand Down Expand Up @@ -1624,7 +1624,7 @@ public int lookupModes() {
this(lookupClass, null, FULL_POWER_MODES);
}

private Lookup(Class<?> lookupClass, Class<?> prevLookupClass, int allowedModes) {
Lookup(Class<?> lookupClass, Class<?> prevLookupClass, int allowedModes) {
assert prevLookupClass == null || ((allowedModes & MODULE) == 0
&& prevLookupClass.getModule() != lookupClass.getModule());
assert !lookupClass.isArray() && !lookupClass.isPrimitive();
Expand Down

0 comments on commit 4348953

Please sign in to comment.