close
Skip to content

Wrong casting for response in BoxAPIResponse for BoxMetadataCascadePo… - #685

Merged
carycheng merged 4 commits into
masterfrom
metadata_cascade_patch
Mar 5, 2019
Merged

Wrong casting for response in BoxAPIResponse for BoxMetadataCascadePo…#685
carycheng merged 4 commits into
masterfrom
metadata_cascade_patch

Conversation

@carycheng

Copy link
Copy Markdown

…licy

Unfortunately, I introduced a bug in BoxMetadataCascadePolicy.forceApply().

The issue being this API does not return a response body. However, I casted the return type, originally being BoxAPIResponse to BoxJSONResponse. This would then throw a casting exception.

@carycheng
carycheng requested review from mattwiller and nidoran March 1, 2019 22:51
@boxcla

boxcla commented Mar 1, 2019

Copy link
Copy Markdown

Hi @carycheng, thanks for the pull request. Before we can merge it, we need you to sign our Contributor License Agreement. You can do so electronically here: http://opensource.box.com/cla

Once you have signed, just add a comment to this pull request saying, "CLA signed". Thanks!

@coveralls

coveralls commented Mar 1, 2019

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 1832

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.08%) to 61.378%

Totals Coverage Status
Change from base Build 1829: 0.08%
Covered Lines: 4901
Relevant Lines: 7985

💛 - Coveralls

.add("conflict_resolution", conflictResolution);
request.setBody(requestJSON.toString());
BoxJSONResponse response = (BoxJSONResponse) request.send();
BoxAPIResponse response = request.send();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

If you're not using the result anyway, why have it at all? You could just do request.send() and throw away the result.

@carycheng
carycheng merged commit 5600165 into master Mar 5, 2019
@carycheng
carycheng deleted the metadata_cascade_patch branch March 5, 2019 00:21
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.

4 participants