Skip to content

Commit

Permalink
Finally deprecated @ConfigUpdater for removal
Browse files Browse the repository at this point in the history
  • Loading branch information
WillFP committed Dec 3, 2023
1 parent 24d9052 commit 9ad12c2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion eco-api/src/main/java/com/willfp/eco/core/PluginProps.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public final class PluginProps {
private final Map<String, String> environment = new HashMap<>();

/**
* If the plugin uses reflective reload (via {@link com.willfp.eco.core.config.updating.ConfigUpdater}).
* If the plugin uses reflective reload.
*/
private boolean usesReflectiveReload = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,16 @@
* <p>
* By having a plugin as a parameter, you shouldn't really need getInstance()
* calls in your code.
*
* <p>
* While flexible, this can lead to long initialization times, so this feature
* can be disabled in eco.yml with the uses-reflective-reload option.
*
* @deprecated This has been deprecated due to the poor control flow and long startup times.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
@Documented
@Deprecated(since = "6.67.0", forRemoval = true)
@SuppressWarnings("DeprecatedIsStillUsed")
public @interface ConfigUpdater {
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.willfp.eco.internal.config.handler

import com.willfp.eco.core.EcoPlugin
import com.willfp.eco.core.config.updating.ConfigUpdater
import org.reflections.Reflections
import org.reflections.scanners.MethodAnnotationsScanner

Expand All @@ -14,7 +13,8 @@ class ReflectiveConfigHandler(
)

override fun callUpdate() {
for (method in reflections.getMethodsAnnotatedWith(ConfigUpdater::class.java)) {
@Suppress("DEPRECATION", "REMOVAL")
for (method in reflections.getMethodsAnnotatedWith(com.willfp.eco.core.config.updating.ConfigUpdater::class.java)) {
runCatching {
when (method.parameterCount) {
0 -> method.invoke(null)
Expand Down

0 comments on commit 9ad12c2

Please sign in to comment.