[GitHub] commons-rdf pull request #43: COMMONSRDF-49: Make AbstractRDFParser serializ...
Github user asfgit closed the pull request at: https://github.com/apache/commons-rdf/pull/43 --- - To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org
[GitHub] commons-rdf pull request #43: COMMONSRDF-49: Make AbstractRDFParser serializ...
Github user ansell commented on a diff in the pull request: https://github.com/apache/commons-rdf/pull/43#discussion_r151267617 --- Diff: commons-rdf-simple/src/main/java/org/apache/commons/rdf/simple/experimental/AbstractRDFParser.java --- @@ -200,19 +200,19 @@ * been set */ public Optional getSourceIri() { -return sourceIri; +return Optional.ofNullable(sourceIri); } -private Optional rdfTermFactory = Optional.empty(); -private Optional contentTypeSyntax = Optional.empty(); -private Optional contentType = Optional.empty(); -private Optional base = Optional.empty(); -private Optional sourceInputStream = Optional.empty(); -private Optional sourceFile = Optional.empty(); -private Optional sourceIri = Optional.empty(); +private RDF rdfTermFactory = null; +private RDFSyntax contentTypeSyntax = null; +private String contentType = null; +private IRI base = null; +private InputStream sourceInputStream = null; --- End diff -- This may be a sticking point for actually enabling ``Serializable``, but the changes to not use optional field values look good to me. --- - To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org
[GitHub] commons-rdf pull request #43: COMMONSRDF-49: Make AbstractRDFParser serializ...
GitHub user ajs6f opened a pull request: https://github.com/apache/commons-rdf/pull/43 COMMONSRDF-49: Make AbstractRDFParser serializable Very simple approach-- I just exposed the values of the fields internally and made the accessors keep producing `Optional`. My understanding is that any modern JVM will hotspot all the `isPresent` and similar calls into `null` checks anyway, so there should be no performance implications. You can merge this pull request into a Git repository by running: $ git pull https://github.com/ajs6f/commons-rdf COMMONSRDF-49 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/commons-rdf/pull/43.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #43 --- - To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org