Jan Hendriks created JENA-2353:
----------------------------------

             Summary: Update outdated documentation to remove deprecated method 
warnings
                 Key: JENA-2353
                 URL: https://issues.apache.org/jira/browse/JENA-2353
             Project: Apache Jena
          Issue Type: Task
          Components: Jena
    Affects Versions: Jena 4.7.0, Jena 4.8.0
         Environment: Ubuntu Linux, JDK 17, Maven
            Reporter: Jan Hendriks
         Attachments: JenaDeprecated.png

The documentation on the Jena page states at several places (i.e. in the "Jena 
RDF/XML How-To" at 
[https://jena.apache.org/documentation/io/rdfxml_howto.html|https://jena.apache.org/documentation/io/rdfxml_howto.html)])
 some code like
{code:java}
Model m = ModelFactory.createDefaultModel();
RDFReader arp = m.getReader(); {code}
or
{code:java}
Model m = ModelFactory.createDefaultModel();
RDFReader arp = m.getReader("RDF/XML"); {code}
However, according to the Javadoc of "Model" (see 
[https://jena.apache.org/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html#getReader()]
 and 
[https://jena.apache.org/documentation/javadoc/jena/org.apache.jena.core/org/apache/jena/rdf/model/Model.html#getReader(java.lang.String)])
 these methods as well as their corresponding "getWriter()" methods are 
"deprecated".

There is no documentation (neiter in the Javadoc itself nor on the website) on 
the proper new replacement.

IDEs like IntelliJ complain about this deprecation (see screenshot).

Please update the Javadoc as well as the documentation on how to properly get a 
Reader and Writer object, or whether to ignore the deprecation warning (i.e. 
because only the overwritten method in "Model" is deprecated).

 
h2. Reproducer

JenaTest.java
{code:java}
package de.playground.jenatests;

import org.apache.jena.rdf.model.Model;
import org.apache.jena.rdf.model.ModelFactory;
import org.apache.jena.rdf.model.RDFReaderI;

public class JenaTest {

    public static void main(String[] args) {
        Model model = ModelFactory.createDefaultModel();
        RDFReaderI r = model.getReader("RDF/XML");
    }
} {code}
Maven pom.xml
{code:java}
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0";
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>

    <modelVersion>4.0.0</modelVersion>

    <groupId>de.playground</groupId>
    <artifactId>jena-test</artifactId>
    <version>1.0.0</version>
    <build>
        <sourceDirectory>src</sourceDirectory>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.7.0</version>
            </plugin>
        </plugins>
    </build>

    <dependencies>
      <dependency>
        <groupId>org.apache.jena</groupId>
        <artifactId>jena-core</artifactId>
        <version>4.7.0</version>
      </dependency>
    </dependencies>
</project> {code}
 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to