Skip to content
This repository has been archived by the owner on Dec 15, 2020. It is now read-only.

TAMAYA-277: LHF: use try-with-resources with BufferedReader #49

Merged
merged 8 commits into from May 1, 2019

Conversation

acoburn
Copy link
Member

@acoburn acoburn commented May 1, 2019

This opens a BufferedReader in a try-with-resources block to ensure that the resource is properly closed in the event of an exception.

This opens a BufferedReader in a try-with-resources block to ensure that
the resource is properly closed in the event of an exception.
@ottlinger ottlinger changed the title LHF: use try-with-resources with BufferedReader TAMAYA-277: LHF: use try-with-resources with BufferedReader May 1, 2019
Copy link
Contributor

@ottlinger ottlinger left a comment

Choose a reason for hiding this comment

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

@acoburn I added some more changes ..... would you fancy to add some more tests. To me the OSGi-stuff does not seem very easy to test :(

@acoburn
Copy link
Member Author

acoburn commented May 1, 2019

@ottlinger the best way to test OSGi is with Pax-Exam, but that adds a huge amount of complexity and should probably be part of a separate effort. In the meantime, though, I can definitely add some simple tests.

@ottlinger
Copy link
Contributor

ottlinger commented May 1, 2019

... or we merge the changes although they break the quality build:
https://github.com/apache/incubator-tamaya/pull/49/checks?check_run_id=116131187

Do you see a chance to reduce the duplicate-warning? I tried to extract the stuff into a method, but that only made things worse.

@acoburn
Copy link
Member Author

acoburn commented May 1, 2019

I suppose the question is whether Sonar non-compliance should be allowed to fail a build or not. I personally find Sonar to be very useful, but I typically put it in a after_success clause like this:

script: mvn clean install 
after_success: mvn sonar:sonar -Dsonar.organization=apache -Dsonar.projectKey=apache_incubator-tamaya

@acoburn
Copy link
Member Author

acoburn commented May 1, 2019

@ottlinger all the checks now pass.

@ottlinger
Copy link
Contributor

@acoburn thanks - my IDE marked the first lines in

  • processEntryPath(Bundle bundle, String entryPath)
  • removeEntryPath(Bundle bundle, String entryPath)
    as possible duplicates. Your solution is much simpler and does not break the quality build.

Thanks 👍

@ottlinger ottlinger merged commit 841cd03 into master May 1, 2019
@ottlinger ottlinger deleted the try_with_resource branch May 1, 2019 22:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants