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

Add @Nullable annotations for pegasus java getters and setters with mode #932

Merged
merged 3 commits into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ and what APIs have changed, if applicable.

## [Unreleased]

## [29.45.1] - 2023-09-05
zhihaodev marked this conversation as resolved.
Show resolved Hide resolved
- add @Nullable annotations to pegasus java getters and setters with mode

## [29.45.0] - 2023-08-25

- Downgrade major version back to 29. Technically this is not semver-compatible
Expand Down Expand Up @@ -5524,7 +5527,8 @@ patch operations can re-use these classes for generating patch messages.

## [0.14.1]

[Unreleased]: https://github.com/linkedin/rest.li/compare/v29.45.0...master
[Unreleased]: https://github.com/linkedin/rest.li/compare/v29.45.1...master
[29.45.1]: https://github.com/linkedin/rest.li/compare/v29.45.0...v29.45.1
[29.45.0]: https://github.com/linkedin/rest.li/compare/v30.0.0...v29.45.0
[30.0.0]: https://github.com/linkedin/rest.li/compare/v29.44.0...v30.0.0
[29.44.0]: https://github.com/linkedin/rest.li/compare/v29.43.11...v29.44.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1119,6 +1119,7 @@ private void generateRecordFieldAccessors(JDefinedClass templateClass, RecordTem
final JMethod getterWithMode = templateClass.method(JMod.PUBLIC, type, getterName);
addAccessorDoc(templateClass, getterWithMode, schemaField, "Getter");
setDeprecatedAnnotationAndJavadoc(getterWithMode, schemaField);
getterWithMode.annotate(Nullable.class);
JVar modeParam = getterWithMode.param(_getModeClass, "mode");
final JBlock getterWithModeBody = getterWithMode.body();

Expand Down Expand Up @@ -1200,6 +1201,7 @@ else if (!schemaField.getOptional())
addAccessorDoc(templateClass, setterWithMode, schemaField, "Setter");
setDeprecatedAnnotationAndJavadoc(setterWithMode, schemaField);
JVar param = setterWithMode.param(type, "value");
param.annotate(Nullable.class);
JVar modeParam = setterWithMode.param(_setModeClass, "mode");
JSwitch modeSwitch = setterWithMode.body()._switch(modeParam);
JCase disallowNullCase = modeSwitch._case(JExpr.ref("DISALLOW_NULL"));
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version=29.45.0
version=29.45.1
group=com.linkedin.pegasus
org.gradle.configureondemand=true
org.gradle.parallel=true
Expand Down
Loading