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

primitive booleans instead of Booleans #365

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,9 @@ public void processRequest(final InputStream inputStream, final OutputStream out
if (resourceHandlerRequest != null) {
resourceHandlerRequest.setPreviousResourceTags(getPreviousResourceTags(request));
resourceHandlerRequest.setStackId(getStackId(request));
resourceHandlerRequest.setSnapshotRequested(request.getSnapshotRequested());
resourceHandlerRequest.setRollback(request.getRollback());
resourceHandlerRequest.setDriftable(request.getDriftable());
resourceHandlerRequest.setSnapshotRequested(request.isSnapshotRequested());
resourceHandlerRequest.setRollback(request.isRollback());
resourceHandlerRequest.setDriftable(request.isDriftable());
if (request.getRequestData() != null) {
resourceHandlerRequest.setPreviousSystemTags(request.getRequestData().getPreviousSystemTags());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ public class HandlerRequest<ResourceT, CallbackT> {
private RequestData<ResourceT> requestData;
private String stackId;
private CallbackT callbackContext;
private Boolean snapshotRequested;
private Boolean rollback;
private Boolean driftable;
private boolean snapshotRequested;
private boolean rollback;
private boolean driftable;
private RequestContext<CallbackT> requestContext;
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ public class ResourceHandlerRequest<T> {
private String awsPartition;
private String logicalResourceIdentifier;
private String nextToken;
private Boolean snapshotRequested;
private Boolean rollback;
private Boolean driftable;
private boolean snapshotRequested;
Copy link
Contributor

Choose a reason for hiding this comment

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

I would suggest don't change the property type as it will cause method change and it will cause compile error.

As suggest in #341 (comment), we can provide extra helper method, such as isSnapshotRequested to simplify it.

Copy link
Author

Choose a reason for hiding this comment

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

@wbingli I have already taken care of that change and changed the references as well. And the pr got build is successful. Do yoy want me to revert the change and provide helper method ?

Copy link
Contributor

Choose a reason for hiding this comment

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

The point is that anyone who uses this class will be broken. The java plugin can build successful doesn't mean it won't break others. Therefore, I suggest to add helper method in the class instead of change the field type.

private boolean rollback;
private boolean driftable;
private String region;
private String stackId;
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ protected ResourceHandlerRequest<Model> transform(final HandlerRequest<Model, St
return ResourceHandlerRequest.<Model>builder().desiredResourceState(desiredResourceState)
.previousResourceState(previousResourceState).desiredResourceTags(getDesiredResourceTags(request))
.systemTags(systemTags).logicalResourceIdentifier(request.getRequestData().getLogicalResourceId())
.nextToken(request.getNextToken()).snapshotRequested(request.getSnapshotRequested()).build();
.nextToken(request.getNextToken()).snapshotRequested(request.isSnapshotRequested()).build();
}

@Override
Expand Down