Re: Use of ModifierType fails if TypeDefinitionCategory is not loaded before

HadoopMarc <bi...@...>

Hi Thomas,

Thanks for asking on the user group first. I cannot reproduce the issue (works fine on my system using java8).

I ran:
    mvn exec:java -Dexec.mainClass="JGModifierTypeIssue"

and get CONSISTENCY printed whether the TypeDefinitionCategory line is commented out or not.
I used the pom.xml file below.
Also, java does not have the concept of cyclical dependencies (as in python): an import causes a class load unless the class is already loaded.

HTH,    Marc

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns=""




Op maandag 31 augustus 2020 om 15:30:57 UTC+2 schreef Thomas Franco:


When I try to set consistency of a property key (using JanusGraphManagement.setConsistency in a java project) I get a NPE if I don't refer the class TypeDefinitionCategory before.

The method setConsistency uses ModifierType and there is a cyclic dependency between  ModifierType  and TypeDefinitionCategory.

You can reproduce the error with this minimalist java code:
import org.janusgraph.graphdb.types.TypeDefinitionCategory;

public class JGModifierTypeIssue {
  public static void main(String[] args) {
    TypeDefinitionCategory dummy = TypeDefinitionCategory.BACKING_INDEX
    // without the following line the next line generates a NPE

Should I create an issue on Github ?



Join { to automatically receive all group messages.