Skript icon indicating copy to clipboard operation
Skript copied to clipboard

Housekeeping: deprecate, replace or remove archaic utilities classes.

Open Moderocky opened this issue 2 months ago • 0 comments

Description

A lot of utility types were left over from Java 6. Most of these weren't used at all, but a few are still being used in place of the proper equivalent in legacy code. This pull request is a bulk group task to deprecate all of these for removal, and to replace internal uses of them all with a better thing.

Where possible, compatibility is perfectly preserved, but in some obscure cases (e.g. constructors) parameters have to be changed.

Legacy libraries

Some legacy libraries have been removed, moved, or just deprecated for removal. Stubs for each one have been left behind (so technically nothing still using them will break).

Legacy functional interfaces

We have a legacy equivalent of Predicate, Consumer and Function, along with some others.

A lot of these can be replaced without any breaking changes. For some, where a method signature has changed, a plugin extending the method would need to be recompiled but wouldn't require any changes: for example, a method accepting Predicate<T> will also accept the deprecated Checker<T> because that is now a predicate itself.

The process is as follows:

  1. Make the legacy class extend its proper replacement (e.g. Checker<T> extends Predicate<T>)
  2. Forward a default method call from the proper method to the legacy method
  3. Replace uses of the legacy class with the proper class (where possible)
  4. Deprecate the legacy class and mark it for removal.

This is a branch merge request!

Individual pull requests were made by contributors to its feature branch: this can be merged as-is to preserve the Git change history.


Target Minecraft Versions: any Requirements: none Related Issues: none

Moderocky avatar May 08 '24 12:05 Moderocky