Skip to content

Commit 02b7a1f

Browse files
authored
[JBLOGGING-203] Merge pull request #183 from dmlloyd/add-reads
Fix incomplete access issue
2 parents e800ea9 + 2c3ff32 commit 02b7a1f

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

src/main/java/org/jboss/logging/Logger.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2566,6 +2566,7 @@ public static <T> T getMessageLogger(Class<T> type, String category) {
25662566
public static <T> T getMessageLogger(final Class<T> type, final String category, final Locale locale) {
25672567
if (System.getSecurityManager() == null) {
25682568
try {
2569+
Logger.class.getModule().addReads(type.getModule());
25692570
final Lookup lookup = MethodHandles.privateLookupIn(type, MethodHandles.lookup());
25702571
return doGetMessageLogger(lookup, type, category, locale);
25712572
} catch (IllegalAccessException e) {
@@ -2575,6 +2576,7 @@ public static <T> T getMessageLogger(final Class<T> type, final String category,
25752576
return doPrivileged(new PrivilegedAction<T>() {
25762577
public T run() {
25772578
try {
2579+
Logger.class.getModule().addReads(type.getModule());
25782580
final Lookup lookup = MethodHandles.privateLookupIn(type, MethodHandles.lookup());
25792581
return doGetMessageLogger(lookup, type, category, locale);
25802582
} catch (IllegalAccessException e) {

src/main/java/org/jboss/logging/Messages.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ public static <T> T getBundle(Class<T> type) {
6363
public static <T> T getBundle(final Class<T> type, final Locale locale) {
6464
if (System.getSecurityManager() == null) {
6565
try {
66+
Messages.class.getModule().addReads(type.getModule());
6667
final Lookup lookup = MethodHandles.privateLookupIn(type, MethodHandles.lookup());
6768
return doGetBundle(lookup, type, locale);
6869
} catch (IllegalAccessException e) {
@@ -72,6 +73,7 @@ public static <T> T getBundle(final Class<T> type, final Locale locale) {
7273
return doPrivileged(new PrivilegedAction<T>() {
7374
public T run() {
7475
try {
76+
Messages.class.getModule().addReads(type.getModule());
7577
final Lookup lookup = MethodHandles.privateLookupIn(type, MethodHandles.lookup());
7678
return doGetBundle(lookup, type, locale);
7779
} catch (IllegalAccessException e) {

0 commit comments

Comments
 (0)