Skip to content

Don't use engine-module.txt as a possible metadata source for all modules #4646

@keturn

Description

@keturn

Map<String, ModuleMetadataLoader> mmlm = moduleFactory.getModuleMetadataLoaderMap();
mmlm.put(TerasologyConstants.MODULE_INFO_FILENAME.toString(), metadataReader);
mmlm.put("engine-module.txt", metadataReader); // FIXME: this should be *only* for engine-module.
// FIXME: …or maybe engine-module doesn't need a special filename anymore?

I imagine that engine has this unique engine-module.txt filename because it was loaded from a class.getResource call

try (Reader reader = new InputStreamReader(getClass().getResourceAsStream("/engine-module.txt"), TerasologyConstants.CHARSET)) {

instead of a filesystem API that opens a file in the root of a specific directory or archive.

So maybe it needed a name to distinguish it from a /module.txt file that might have been put there by anything else on the classpath?

but now that we've moved it to org/terasology/engine/ maybe that's enough of a qualifier that it could just be named module.txt again?

[☝ copied from a comment thread on #4622]

This isn't quite release-critical for a first gestalt-v7 release, but it would definitely be good to get done while we're still on the topic before moving down the roadmap to something else.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Category: SecurityRequests, Issues and Changes targeting security

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions