Uploaded image for project: 'Apache Jena'
  1. Apache Jena
  2. JENA-1729

A minor initilization issue

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Core
    • Labels:
      None
    • Environment:

      java8(1.8.0_152), jena-arq:3.12.0

      Description

      The following one-class program fails with assertion error:

       

      package xx.yy;
      
      import org.apache.jena.rdf.model.RDFNode;
      import org.apache.jena.rdf.model.ResourceFactory;
      import org.apache.jena.sys.JenaSubsystemLifecycle;
      import org.apache.jena.sys.JenaSystem;
      import org.apache.jena.vocabulary.RDF;
      
      public class InitTest implements JenaSubsystemLifecycle {
          @Override
          public void start() {
              if (JenaSystem.DEBUG_INIT)
                  System.err.println("InitTEST -- start");
              assert RDF.type != null : "RDF#type is null => attempt to load a graph here will fail";
          }
      
          @Override
          public void stop() {
              if (JenaSystem.DEBUG_INIT)
                  System.err.println("InitTEST -- finish");
          }
      
          @Override
          public int level() {
              return 500;
          }
      
          public static void main(String... args) { // run VM option: -ea
              JenaSystem.DEBUG_INIT = true;
              //RDFNode r = ResourceFactory.createProperty("X"); // this works fine
              RDFNode r = ResourceFactory.createTypedLiteral("Y"); // this causes a problem
              System.out.println(r);
          }
      }
      
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              szz ssz
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: