-
Notifications
You must be signed in to change notification settings - Fork 25
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
Close underlying resources #176
Conversation
PR Reviewer Guide 🔍
|
PR Code Suggestions ✨
|
Test Results 10 files 10 suites 33s ⏱️ Results for commit 297a4ad. ♻️ This comment has been updated with latest results. |
Quality Gate passedIssues Measures |
User description
This PR fixes some cases where the underlying resources are not closed properly.
If you use the
iterator()
orspliterator()
methods, the underlying resources will not close automatically.PR Type
Enhancement, Tests
Description
AutoCloseStream
and related classes to manage stream resources automatically, ensuring proper closure and resource management.StreamUtil
class to facilitate stream operations, such as creating a stream from an iterator.CloseTest
to verify the automatic closure of streams and resource management.Changes walkthrough 📝
7 files
AbstractRssReader.java
Implement AutoCloseStream for automatic resource management
src/main/java/com/apptasticsoftware/rssreader/AbstractRssReader.java
AutoCloseStream
for automatic resource management.AutoCloseStream
.AtomicBoolean
for managing resource closure state.StreamUtil.java
Add StreamUtil class for stream operations
src/main/java/com/apptasticsoftware/rssreader/internal/StreamUtil.java
StreamUtil
for stream operations.AbstractAutoCloseStream.java
Introduce AbstractAutoCloseStream for lifecycle management
src/main/java/com/apptasticsoftware/rssreader/internal/stream/AbstractAutoCloseStream.java
AbstractAutoCloseStream
for managing stream lifecycle.AutoCloseDoubleStream.java
Implement AutoCloseDoubleStream for double stream management
src/main/java/com/apptasticsoftware/rssreader/internal/stream/AutoCloseDoubleStream.java
AutoCloseDoubleStream
for double stream management.AutoCloseIntStream.java
Implement AutoCloseIntStream for integer stream management
src/main/java/com/apptasticsoftware/rssreader/internal/stream/AutoCloseIntStream.java
AutoCloseIntStream
for integer stream management.AutoCloseLongStream.java
Implement AutoCloseLongStream for long stream management
src/main/java/com/apptasticsoftware/rssreader/internal/stream/AutoCloseLongStream.java
AutoCloseLongStream
for long stream management.AutoCloseStream.java
Implement AutoCloseStream for generic stream management
src/main/java/com/apptasticsoftware/rssreader/internal/stream/AutoCloseStream.java
AutoCloseStream
for generic stream management.3 files
CloseTest.java
Add tests for automatic stream closure
src/test/java/com/apptasticsoftware/integrationtest/CloseTest.java
SortTest.java
Refactor SortTest for improved readability
src/test/java/com/apptasticsoftware/integrationtest/SortTest.java
rss-feed.xml
Add RSS feed XML for testing
src/test/resources/rss-feed.xml
2 files
ConnectionTest.java
Update import path for RssServer
src/test/java/com/apptasticsoftware/integrationtest/ConnectionTest.java
RssServer
.RssServer.java
Move RssServer to internal package
src/test/java/com/apptasticsoftware/rssreader/internal/RssServer.java
RssServer
to internal package.