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

Fix elide-model-config build warnings #1971

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

rishi-aga
Copy link
Collaborator

Resolves #1892

Description

Fix Build warnings for elide-model-config

How Has This Been Tested?

Existing tests pass.

License

I confirm that this contribution is made under an Apache 2.0 license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

private Set<String> tags = new LinkedHashSet<>();

@JsonProperty("arguments")
@Singular
@Builder.Default
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we replacing Singular?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

👍

aklish
aklish previously approved these changes Mar 31, 2021
@@ -68,10 +66,10 @@
private String dbConnectionName;

@JsonProperty("isFact")
private Boolean isFact = true;
private Boolean isFact;
Copy link
Contributor

Choose a reason for hiding this comment

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

@aklish are this fields purposely modifiable after building? Or should they all be final?

Suggested change
private Boolean isFact;
private final Boolean isFact;

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think we cannot declare all fields final, because we have inheritance logic

@@ -51,7 +50,6 @@
@Data
Copy link
Contributor

Choose a reason for hiding this comment

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

Use builder for Jackson deserializer

Suggested change
@Data
@JsonDeserialize(builder = Table.TableBuilder.class)
@Data

Copy link
Contributor

@wcekan wcekan left a comment

Choose a reason for hiding this comment

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

Refactor builders using JsonDeserialize and remove no arg constructors.

Comment on lines +57 to +60
public Argument() {
this.values = new LinkedHashSet<>();
}

Copy link
Contributor

@wcekan wcekan Mar 31, 2021

Choose a reason for hiding this comment

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

Remove and replace with JsonDeserialize builder.

Suggested change
public Argument() {
this.values = new LinkedHashSet<>();
}

@@ -33,7 +32,6 @@
@Data
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
@Data
@JsonDeserialize(builder = Argument.ArgumentBuilder.class)
@Data

@@ -48,14 +46,18 @@

@JsonProperty("values")
@JsonDeserialize(as = LinkedHashSet.class)
private Set<String> values = new LinkedHashSet<>();
private Set<String> values;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
private Set<String> values;
private final Set<String> values;

Comment on lines +96 to +104
public Dimension() {
this.hidden = false;
this.readAccess = "Prefab.Role.All";
this.grains = new ArrayList<>();
this.tags = new LinkedHashSet<>();
this.values = new LinkedHashSet<>();
this.arguments = new ArrayList<>();
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
public Dimension() {
this.hidden = false;
this.readAccess = "Prefab.Role.All";
this.grains = new ArrayList<>();
this.tags = new LinkedHashSet<>();
this.values = new LinkedHashSet<>();
this.arguments = new ArrayList<>();
}

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.

Fix elide-model-config build warnings
3 participants