Skip to content

Commit

Permalink
GH-2675: Call JenaSystem.init in RDFLinkHTTPBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
afs committed Sep 2, 2024
1 parent 2317a90 commit 8654c07
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion jena-core/src/main/java/org/apache/jena/sys/JenaSystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,20 @@ public static void logLifecycle(String fmt, Object ...args) {
}

public static void init() {
// Once jena is initialized, all calls are an immediate return.
if ( initialized )
return ;
// Overlapping attempts to perform initialization will block on the synchronized.
synchronized(JenaSystem.class) {
if ( initialized )
return ;
initialized = true;
setup();
if ( DEBUG_INIT )
singleton.debug(DEBUG_INIT);
singleton.initialize();
singleton.debug(false);
// Last so overlapping initialization waits on the synchronized
initialized = true;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@
import org.apache.jena.sparql.core.TransactionalLock;
import org.apache.jena.sparql.exec.http.QuerySendMode;
import org.apache.jena.sparql.exec.http.UpdateSendMode;
import org.apache.jena.sys.JenaSystem;

/** Builder class for {@link RDFLinkHTTP} */
public class RDFLinkHTTPBuilder {

static { JenaSystem.init(); }

/*package*/ static String SameAsDestination = "";

protected Transactional txnLifecycle = TransactionalLock.createMRPlusSW();
Expand Down

0 comments on commit 8654c07

Please sign in to comment.