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

Log : add inconsistent part size #153

Merged
merged 2 commits into from
Dec 27, 2018
Merged

Conversation

1019272778
Copy link
Contributor

No description provided.

@@ -128,6 +131,17 @@ protected void initMultipartUploadId() throws IOException, ClientException, Serv
}
OSSLog.logDebug("[initUploadId] - " + i + " part.getPartNumber() : " + part.getPartNumber());
OSSLog.logDebug("[initUploadId] - " + i + " part.getSize() : " + part.getSize());

if (part.getPartNumber() == partTotalNumber){
Copy link
Contributor

@binghaiwang binghaiwang Dec 21, 2018

Choose a reason for hiding this comment

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

boolean isTotal = part.getPartNumber() == partTotalNumber;

 if (isTotal && part.getSize() != mLastPartSize){
                                    throw new ClientException("current part size " + partSize + " setting is inconsistent with PartSize : " + mPartAttr[0] + " or lastPartSize : " + mLastPartSize);
                                }

if (!isTotal && part.getSize() != partSize){
                                    throw new ClientException("current part size " + partSize + " setting is inconsistent with PartSize : " + mPartAttr[0] + " or lastPartSize : " + mLastPartSize);
                                }
                            }

这样 少一个if else 会不会更好呢

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good idea

@@ -49,6 +49,7 @@
private OSSSharedPreferences mSp;
private File mCRC64RecordFile;


Copy link
Contributor

@binghaiwang binghaiwang Dec 21, 2018

Choose a reason for hiding this comment

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

多余的空行

@1019272778 1019272778 merged commit 2b7de55 into master Dec 27, 2018
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