Skip to content

[ISSUE #399] Use AbstractFileStore.class for resource loading#400

Open
flying-musk wants to merge 1 commit intoapache:masterfrom
flying-musk:fix/unsafe-getresource
Open

[ISSUE #399] Use AbstractFileStore.class for resource loading#400
flying-musk wants to merge 1 commit intoapache:masterfrom
flying-musk:fix/unsafe-getresource

Conversation

@flying-musk
Copy link

What is the purpose of the change

This PR makes resource loading in AbstractFileStore use an explicit class reference instead of getClass().

The current code uses:

getClass().getResourceAsStream("/" + fileName)

Since AbstractFileStore is designed to be extended, this makes the lookup depend on the runtime subclass, which can introduce inheritance-related ambiguity and make the behavior less explicit for future maintenance.

Using AbstractFileStore.class.getResourceAsStream(...) makes the resource lookup context explicit and stable.

Brief changelog

  • Replace getClass().getResourceAsStream("/" + fileName) with AbstractFileStore.class.getResourceAsStream("/" + fileName) in AbstractFileStore

Verifying this change

  • Verified that the project still compiles after the change
  • Verified by running mvn test

@flying-musk
Copy link
Author

Gentle follow-up in case this slipped through.

This is a small, behavior-preserving cleanup that makes the resource lookup context explicit in AbstractFileStore.

I also verified the project still builds and the test suite passes locally:

  • Tests run: 213
  • Failures: 0
  • Errors: 0
  • Skipped: 0

Happy to revise if needed. Thanks!

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.

1 participant