mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-02-03 05:51:28 +01: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"
|
compileOnly "com.google.code.gson:gson:$gsonVersion"
|
||||||
}
|
}
|
||||||
|
|
||||||
ext.apiVersion = '5.2-R0.8'
|
ext.apiVersion = '5.2-R0.9'
|
||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
repositories {
|
repositories {
|
||||||
|
@ -122,6 +122,13 @@ public final class ExtensionExtractor {
|
|||||||
continue;
|
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 -> {
|
method.getAnnotation(BooleanProvider.class).ifPresent(annotation -> {
|
||||||
validateMethod(method, annotation);
|
validateMethod(method, annotation);
|
||||||
methods.get(method.getParameterType()).addBooleanMethod(method);
|
methods.get(method.getParameterType()).addBooleanMethod(method);
|
||||||
|
@ -77,6 +77,15 @@ public class ExtensionMethod {
|
|||||||
return getMethod().getName();
|
return getMethod().getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws SecurityException If access modification fails.
|
||||||
|
*/
|
||||||
|
public void makeAccessible() {
|
||||||
|
if (!method.isAccessible()) {
|
||||||
|
method.setAccessible(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public enum ParameterType {
|
public enum ParameterType {
|
||||||
SERVER_NONE(null),
|
SERVER_NONE(null),
|
||||||
PLAYER_STRING(String.class),
|
PLAYER_STRING(String.class),
|
||||||
|
Loading…
Reference in New Issue
Block a user