Skip to content

Remove the deprecated string data format exception - #33

Merged
pavog merged 2 commits into
masterfrom
remove-deprecated-string-data-format-exception
Nov 27, 2026
Merged

pavog merged 2 commits into
masterfrom
remove-deprecated-string-data-format-exception

Conversation

@pavog

@pavog pavog commented Nov 27, 2026

Copy link
Copy Markdown
Member

Before, Aternos\Nbt\String\StringDataFormatException still existed as a deprecated subclass of Aternos\Nbt\Exception\StringDataFormatException.
JavaEncoding and the Java and Bedrock deserializers threw the deprecated class, so catch blocks for either class kept working.

This PR removes the deprecated class.
JavaEncoding and the deserializers throw Aternos\Nbt\Exception\StringDataFormatException directly.
The README lists the removal in the upgrade section.

Deliberate decisions:
The class is removed in the same major version that introduced its replacement, because 2.0 already contains other breaking changes and keeping it would only delay the break.

Not covered:
The message texts of the exceptions are unchanged.

Changes

  • remove Aternos\Nbt\String\StringDataFormatException
  • throw Aternos\Nbt\Exception\StringDataFormatException in JavaEncoding and the deserializers
  • replace the compatibility tests with a test for the new class
  • list the removal in the README

…tring-data-format-exception

# Conflicts:
#	README.md
#	tests/ExceptionTest.php
@pavog
pavog merged commit 2148e4a into master Nov 27, 2026
4 checks passed
@pavog
pavog deleted the remove-deprecated-string-data-format-exception branch November 27, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants