X Tutup
Skip to content

corrected UncompressInputStream#718

Merged
josemduarte merged 8 commits intobiojava:masterfrom
zweibieren:master
Jan 30, 2018
Merged

corrected UncompressInputStream#718
josemduarte merged 8 commits intobiojava:masterfrom
zweibieren:master

Conversation

@zweibieren
Copy link
Copy Markdown
Contributor

The original UncompressInputStream could omit the final byes from the original. This patch corrects that. It also adds a new method for uncompressing from one stream to another; two existing methods have been revised to use this new method. Indentation was improved and a few comments added.

Fixed bugs where final bytes of file were not decoded
    in available() and the EOF condition for mainloop.
Added some comments
Indented some unindented lines
Added method uncompress(InputStream,OutputStream)
    and called it from main(String[])
    and from uncompress(String, FileOutputStream)
Rewrote skip method
Amended logging code in uncompress(String, FileOutputStream)
@josemduarte
Copy link
Copy Markdown
Contributor

Thanks! travis is complaining about a compilation error. Any chance that something was missed in the commits?

@zweibieren
Copy link
Copy Markdown
Contributor Author

zweibieren commented Jan 9, 2018 via email

@josemduarte
Copy link
Copy Markdown
Contributor

This is the error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project biojava-core: Compilation failure
[ERROR] /home/travis/build/biojava/biojava/biojava-core/src/main/java/org/biojava/nbio/core/util/UncompressInputStream.java:[384,61] ')' expected

In the master branch we are in java 8 (for upcoming release 5.0.0), so there shouldn't be an issue there.

Typo in skip() - fix compile error
@zweibieren
Copy link
Copy Markdown
Contributor Author

zweibieren commented Jan 9, 2018 via email

Copy link
Copy Markdown
Contributor

@josemduarte josemduarte left a comment

Choose a reason for hiding this comment

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

Changes look good, thanks a lot. My only request would be to add a unit test for this under biojava-core/src/test/java. The test should also cover the issue that is solved here.

@zweibieren
Copy link
Copy Markdown
Contributor Author

zweibieren commented Jan 10, 2018 via email

@josemduarte
Copy link
Copy Markdown
Contributor

I've just committed a test to a branch and have pull requested it to your branch. If you merge my pull request zweibieren#1 then my commit will be added to this PR.

The test I wrote actually does not pass, the uncompressed stream has an extra new line character at the end. Could you review the test and check what's going on? Thanks!

@zweibieren
Copy link
Copy Markdown
Contributor Author

fixed a test and added another

@zweibieren zweibieren closed this Jan 25, 2018
@josemduarte
Copy link
Copy Markdown
Contributor

Did you want to create a new pull request for this? or was it just closed by mistake?

This one is ready to be merges as it is.

@zweibieren
Copy link
Copy Markdown
Contributor Author

zweibieren commented Jan 30, 2018 via email

@josemduarte
Copy link
Copy Markdown
Contributor

No problem. I'll merge this one then. The convention is to close a PR when it's merged or otherwise if there's no consensus that it should be merged.

@josemduarte josemduarte reopened this Jan 30, 2018
@josemduarte josemduarte merged commit 728073b into biojava:master Jan 30, 2018
@lafita lafita added this to the BioJava 5.0.0 milestone Mar 11, 2018
@lafita lafita added the bug Bugs and bugfixes label Mar 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Bugs and bugfixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

X Tutup