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

refactor: remove dead code #4016

Merged
merged 8 commits into from
Jun 6, 2020

Conversation

skaldarnar
Copy link
Member

@skaldarnar skaldarnar commented Jun 1, 2020

As @pollend found out in #3961 there are unused classes and other dead code in the engine.

Tested in Omega workspace, can run Josharias Survival without any (new) issues.

@skaldarnar skaldarnar changed the title refactor: remove dead code; reduce logging refactor: remove dead code Jun 1, 2020
@jdrueckert jdrueckert dismissed their stale review June 1, 2020 21:24

ci errors

Comment on lines +32 to +37
return context.getSandbox().getSubTypeIdentifier(item, Component.class);
}

@Override
public Class<? extends Component> getFromString(String representation) {
try {
final Class<? extends Component> clazz = Class.forName(representation).asSubclass(Component.class);
return clazz;
} catch (ClassNotFoundException e) {
e.printStackTrace();
return null;
}
return context.getSandbox().findSubTypeOf(representation, Component.class).orElse(null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only thing in this PR that's not just a straight deletion. And it looks okay from here.

It does change the constructor, but presumably that's the sort of thing that you'd find out pretty fast as soon as you tried to compile against it.

Actually ... where is this class used? it's not in my workspace.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, this is actually some sneaky little code cleanup 🤓

This class here existed, but was never used. However, there existed another inner class with exact same name (and purpose) in ComponentClassTypeHandlerFactory. As I don't like inner classes, I thought it would be better to have the correct code in this class, which is now used by the factory.

See https://github.com/MovingBlocks/Terasology/pull/4016/files#diff-7fd63f399c356366e5f1abab7dc34ebcL40-L57

@skaldarnar skaldarnar added this to the v3.3.0 milestone Jun 6, 2020
@skaldarnar skaldarnar merged commit 012985c into MovingBlocks:develop Jun 6, 2020
@skaldarnar skaldarnar deleted the topic/remove-dead-code branch June 6, 2020 15:54
@skaldarnar skaldarnar added the Topic: Stabilization Requests, Issues and Changes related to improving stablity and reducing flakyness label Jun 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Topic: Stabilization Requests, Issues and Changes related to improving stablity and reducing flakyness
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants