[ https://issues.apache.org/jira/browse/COMMONSRDF-49?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16254314#comment-16254314 ]
ASF GitHub Bot commented on COMMONSRDF-49: ------------------------------------------ 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<IRI> getSourceIri() { - return sourceIri; + return Optional.ofNullable(sourceIri); } - private Optional<RDF> rdfTermFactory = Optional.empty(); - private Optional<RDFSyntax> contentTypeSyntax = Optional.empty(); - private Optional<String> contentType = Optional.empty(); - private Optional<IRI> base = Optional.empty(); - private Optional<InputStream> sourceInputStream = Optional.empty(); - private Optional<Path> sourceFile = Optional.empty(); - private Optional<IRI> 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. > Make AbstractRDFParser serializable > ----------------------------------- > > Key: COMMONSRDF-49 > URL: https://issues.apache.org/jira/browse/COMMONSRDF-49 > Project: Apache Commons RDF > Issue Type: New Feature > Components: simple > Affects Versions: 0.3.0 > Reporter: Stian Soiland-Reyes > Assignee: Stian Soiland-Reyes > Labels: parser > Fix For: 0.6.0 > > > Raised by [~p_ansell] in [pull request > 25|(https://github.com/apache/incubator-commonsrdf/pull/25#discussion_r85436754] > {quote} > The use of optional here as a field type makes it impossible to serialise. > Need to have the raw values stored in fields if you want to support > serialisation in the future, which should otherwise be possible. > {quote} > The suggestion is to avoid {{Optional}} in the private fields of > {{AbstractRDFParser}} so it can be serialized - it can still be {{Optional}} > in the accessor methods. -- This message was sent by Atlassian JIRA (v6.4.14#64029)