Skip to content

Commit

Permalink
Fixed NoClassDefFoundError caused by changes to the addon version com…
Browse files Browse the repository at this point in the history
…patibility algorithm

Fixes #1177.
It was introduced in 3329679.
  • Loading branch information
Poslovitch committed Feb 8, 2020
1 parent 05a4b2d commit 5e02954
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;

import be.maximvdw.placeholderapi.internal.utils.NumberUtils;

This comment has been minimized.

Copy link
@tastybento

tastybento Feb 8, 2020

Member

Hmm. This was supposed to be org.apache.commons.lang.math.NumberUtils, which is included in the Bukkit class path.

import world.bentobox.bentobox.BentoBox;
import world.bentobox.bentobox.api.addons.Addon;
import world.bentobox.bentobox.api.addons.Addon.State;
Expand All @@ -38,6 +37,7 @@
import world.bentobox.bentobox.api.events.addon.AddonEvent;
import world.bentobox.bentobox.commands.BentoBoxCommand;
import world.bentobox.bentobox.database.objects.DataObject;
import world.bentobox.bentobox.util.Util;

/**
* @author tastybento, ComminQ
Expand Down Expand Up @@ -221,7 +221,7 @@ private boolean isAddonCompatibleWithBentoBox(@NonNull Addon addon) {
/**
* Checks if the addon does not explicitly rely on API from a more recent BentoBox version.
* @param addon instance of the Addon.
* @param plugin version string - used for testing
* @param pluginVersion plugin version string.
* @return {@code true} if the addon relies on available BentoBox API, {@code false} otherwise.
* @since 1.11.0
*/
Expand All @@ -231,10 +231,10 @@ boolean isAddonCompatibleWithBentoBox(@NonNull Addon addon, String pluginVersion

for (int i = 0; i < apiVersion.length; i++) {
int bentoboxNumber = 0;
if (i < bentoboxVersion.length && NumberUtils.isInteger(bentoboxVersion[i])) {
if (i < bentoboxVersion.length && Util.isInteger(bentoboxVersion[i], false)) {
bentoboxNumber = Integer.parseInt(bentoboxVersion[i]);
}
int apiNumber = NumberUtils.isInteger(apiVersion[i]) ? Integer.parseInt(apiVersion[i]) : -1;
int apiNumber = Util.isInteger(apiVersion[i], false) ? Integer.parseInt(apiVersion[i]) : -1;
if (bentoboxNumber < apiNumber) {
return false;
}
Expand Down

1 comment on commit 5e02954

@tastybento
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Poslovitch Thanks for the fix. The importer grabbed the "wrong" import.

Please sign in to comment.