Skip to content

Commit

Permalink
Merge pull request #26720 from ajaypaul-ibm/privileageIssue
Browse files Browse the repository at this point in the history
Added doPrivileged for setAccessible when parsing JPQL query with EXT…
  • Loading branch information
tkburroughs authored Oct 26, 2023
2 parents 6d831b7 + 2cb44fe commit 6ab0435
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@ protected void acceptUnknownVisitor(ExpressionVisitor visitor,

try {
Method visitMethod = type.getDeclaredMethod("visit", parameterType);
if (!visitMethod.isAccessible()) {
AccessController.doPrivileged((PrivilegedAction<Void>) () -> {visitMethod.setAccessible(true); return null;});
if (!visitMethod.canAccess(visitor)) {
AccessController.doPrivileged((PrivilegedAction<Void>) () -> {visitMethod.setAccessible(true); return null;});
}
visitMethod.invoke(visitor, this);
}
Expand Down

0 comments on commit 6ab0435

Please sign in to comment.