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

Change more classes to records #2313

Merged
merged 6 commits into from
Jan 30, 2022

Conversation

Defeatomizer
Copy link
Collaborator

@Defeatomizer Defeatomizer commented Jan 25, 2022

This PR changes more classes to the new record feature of J16.
This PR changes the following classes:

  • net.mcreator.blockly.BlocklyCompileNote
  • net.mcreator.blockly.data.NamedInput
  • net.mcreator.element.types.Recipe.OptimisedRecipe
  • net.mcreator.minecraft.api.ModAPI.Implementation
  • net.mcreator.ui.MCreatorDropTarget
  • net.mcreator.ui.action.impl.workspace.resources.StructureImportActions.Structure
  • net.mcreator.ui.vcs.WorkspaceMergeHandles
  • net.mcreator.vcs.SyncTwoRefsWithMerge.SyncResult
  • net.mcreator.vcs.diff.AffectedObjectWithType

The following classes pretended to become records too:

  • net.mcreator.generator.GeneratorWrapper - Turning it into a record would cause it's generator parameter to become visible by plugins, the only way to prevent that is to use the following code:
    image
  • net.mcreator.ui.validation.validators.CommaSeparatedNumbersValidator - I changed type of its holder parameter from VTextField to JTextField, like it's done in all the other validators;
  • net.mcreator.ui.vcs.MCreatorWorkspaceSyncHandler - I added @SuppressWarnings annotation to it (it's not a data class so should remain untouched);
  • net.mcreator.workspace.WorkspaceFileManager.SaveTask - check the previous entry.

Copy link
Contributor

@KlemenDEV KlemenDEV left a comment

Choose a reason for hiding this comment

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

Sometimes following code cleanup suggestions makes things less clear / introduces bugs. Each cleanup should be weighted if it is worth it

@KlemenDEV KlemenDEV marked this pull request as draft January 25, 2022 18:33
@Defeatomizer Defeatomizer marked this pull request as ready for review January 26, 2022 08:09
@KlemenDEV KlemenDEV self-assigned this Jan 27, 2022
@KlemenDEV KlemenDEV marked this pull request as draft January 27, 2022 20:03
@Defeatomizer Defeatomizer marked this pull request as ready for review January 28, 2022 06:20
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.

None yet

2 participants