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

For Boolean, Double and Integer properties, getters should be NonNull #178

Merged
merged 2 commits into from
Mar 13, 2019

Conversation

RicoYao
Copy link
Contributor

@RicoYao RicoYao commented Mar 9, 2019

Otherwise callers will always have to defend against null values, which is a big pain.
We have isVARIABLESet() methods if developers want to check if a property was actually set or not.

@RicoYao
Copy link
Contributor Author

RicoYao commented Mar 9, 2019

@rahul-malik Probably easiest if you review and (hopefully) merge #177 first

Copy link
Collaborator

@rahul-malik rahul-malik left a comment

Choose a reason for hiding this comment

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

Just did a first pass, PTAL and let me know what you think

Sources/Core/JavaModelRenderer.swift Show resolved Hide resolved
]
}
default:
return JavaIR.method([.public], typeFromSchema(param, schemaObj) + " get" + param.snakeCaseToCapitalizedPropertyName() + "()") { [
"return this." + param.snakeCaseToPropertyName() + ";",
Copy link
Collaborator

Choose a reason for hiding this comment

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

same with param.snakeCaseToPropertyName()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Sources/Core/JavaFileRenderer.swift Outdated Show resolved Hide resolved
@@ -49,6 +49,56 @@ extension JavaFileRenderer {
}
}

func wrappedClassNameFromSchema(_ param: String, _ schema: Schema) -> String {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this method used anywhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed

Sources/Core/JavaModelRenderer.swift Show resolved Hide resolved
Sources/Core/JavaModelRenderer.swift Outdated Show resolved Hide resolved
@rahul-malik
Copy link
Collaborator

rahul-malik commented Mar 13, 2019

@RicoYao - I'll likely merge the PR that builds Java code tomorrow if you'd like to take a look #176

Basically did the work to get the Java example fixtures building on CI and fixed small issues along the way to get it working. If you get yourself added to the Pinterest Github organization I can add you as a reviewer

@RicoYao
Copy link
Contributor Author

RicoYao commented Mar 13, 2019

@RicoYao - I'll likely merge the PR that builds Java code tomorrow if you'd like to take a look #176

Basically did the work to get the Java example fixtures building on CI and fixed small issues along the way to get it working. If you get yourself added to the Pinterest Github organization I can add you as a reviewer

Will do. I am in the Pinterest Github organization now.

@rahul-malik
Copy link
Collaborator

@RicoYao - Please rebase master and resolve the conflicts when you get a chance. I just merged the changes for CI to build the java examples so you should see that when you rebase / update this PR 👍

Otherwise callers will always have to defend against null values, which is a big pain.
We have isVARIABLESet() methods if developers want to check if a property was actually set or not.
Copy link
Collaborator

@rahul-malik rahul-malik left a comment

Choose a reason for hiding this comment

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

Looks good!

@rahul-malik
Copy link
Collaborator

@RicoYao - I'll merge after CI passes

@rahul-malik rahul-malik merged commit e63f15c into pinterest:master Mar 13, 2019
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.

2 participants