forked from DSpace/xoai
-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
enhancementNew feature or requestNew feature or requestservice-providerRelated to Service Provider implementationRelated to Service Provider implementation
Description
Currently parsers in package io.gdcc.xoai.serviceprovider.parsers
are handed over an InputStream
as constructor arguments. They build and save a XmlReader
from this as class variable. This is bad, as the reader does not get burned (closed) after reading.
Two ways to refactor:
- Provide a reader instance, so the stream control is in the hand of the calling code.
- Provide the stream, but create the reader on the fly when calling code comes for
parse()
, using a try-with-resources.
Preferred approach: Do 2. Plus: make the parsing static. No need for instances. Make the stream be passed on then, to make it more explicit where the action happens.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestservice-providerRelated to Service Provider implementationRelated to Service Provider implementation