Skip to content

SnLib v1.20.3

Choose a tag to compare

@ValentinTarnovsky ValentinTarnovsky released this 02 Aug 21:50
· 13 commits to main since this release

Fix

A consumer that refuses to enable - an invalid license, an absent requirement - disables
itself and then leaves onInnerEnable(). Until now the throwing form of that abort was
reported as a bug: right after the gate's own clean one-line refusal, the library printed
SEVERE: onInnerEnable failed plus the full stack trace.

SnPlugin.onEnable now branches its Throwable catch on isEnabled():

  • already disabled - the consumer took the decision itself and threw only to cut the
    enable short. One line, Enable aborted: <reason>; the throwable stays available at
    FINE; no second disablePlugin.
  • still enabled - nobody disabled anything, so the failure is unexpected. Unchanged:
    SEVERE with the full stack trace, then the library disables the plugin.

The same check now guards applyLang() on a normal return, so aborting with a plain
return after disabling is supported by construction instead of by the accident of the
command roots being empty after the teardown.

Impact

No consumer needs a recompile. Replacing SnLib.jar is enough - every already-released
licensed plugin gets the clean log as it stands.

SnApi.LEVEL stays at 12: no public surface was added, and japicmp reports no change
to SnPlugin. A public abort primitive would have meant level 13 and a rebuild of every
licensed consumer for the same visible result.