mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-06 15:44:49 +08:00
Plan API 5.2-R0.9: Fixed access issue with package private classes
Affects issues: - Fixed #1862
This commit is contained in:
parent
e70158250f
commit
bd7336b411
@ -4,7 +4,7 @@ dependencies {
|
||||
compileOnly "com.google.code.gson:gson:$gsonVersion"
|
||||
}
|
||||
|
||||
ext.apiVersion = '5.2-R0.8'
|
||||
ext.apiVersion = '5.2-R0.9'
|
||||
|
||||
publishing {
|
||||
repositories {
|
||||
|
@ -122,6 +122,13 @@ public final class ExtensionExtractor {
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
method.makeAccessible();
|
||||
} catch (SecurityException failedToMakeAccessible) {
|
||||
throw new IllegalArgumentException(extensionName + "." + method.getMethodName() + " could not be made accessible: " +
|
||||
failedToMakeAccessible.getMessage(), failedToMakeAccessible);
|
||||
}
|
||||
|
||||
method.getAnnotation(BooleanProvider.class).ifPresent(annotation -> {
|
||||
validateMethod(method, annotation);
|
||||
methods.get(method.getParameterType()).addBooleanMethod(method);
|
||||
|
@ -77,6 +77,15 @@ public class ExtensionMethod {
|
||||
return getMethod().getName();
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws SecurityException If access modification fails.
|
||||
*/
|
||||
public void makeAccessible() {
|
||||
if (!method.isAccessible()) {
|
||||
method.setAccessible(true);
|
||||
}
|
||||
}
|
||||
|
||||
public enum ParameterType {
|
||||
SERVER_NONE(null),
|
||||
PLAYER_STRING(String.class),
|
||||
|
Loading…
Reference in New Issue
Block a user