Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle errors when loading project TMX files #1297

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

miurahr
Copy link
Member

@miurahr miurahr commented Mar 17, 2025

Refactor ProjectTMX constructors to improve error handling during TMX file loading. Log specific errors, such as parsing issues or general load failures, for better debugging. This change also introduces a clear separation between initialization and loading logic.

Pull request type

Please mark github LABEL of the type of change your PR introduces:

  • Other (describe below)
    refactor to fix spotbugs warning

Which ticket is resolved?

What does this PR change?

Other information

CT: Be wary of letting constructors throw exceptions. (CT_CONSTRUCTOR_THROW)

Classes that throw exceptions in their constructors are vulnerable to Finalizer attacks

A finalizer attack can be prevented, by declaring the class final, using an empty finalizer declared as final, or by a clever use of a private constructor.

See SEI CERT Rule OBJ-11 for more information.

Refactor `ProjectTMX` constructors to improve error handling during TMX file loading. Log specific errors, such as parsing issues or general load failures, for better debugging. This change also introduces a clear separation between initialization and loading logic.

Signed-off-by: Hiroshi Miura <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant