Im using jexl 2.1.1 executing a script.
When I do this I get null (which seems wrong)



 

      ProvisioningEntity provisioningEntity = new ProvisioningEntity();

      provisioningEntity.setSubjectIdentifier0("hello");




      Map<String, Object> elVariableMap = new HashMap<String, Object>();

      elVariableMap.put("provisioningEntity", provisioningEntity);

      

      String el = "${provisioningEntity ? provisioningEntity.subjectIdentifier0 
: null}";

      

      boolean silent = false;

      boolean lenient = false;

      boolean allowStaticClasses = true;




      Object result = substituteExpressionLanguageScript(el,elVariableMap, 
allowStaticClasses, silent, lenient);

      System.out.println(result);






When I do this I get "hello".  Why?  since provisioningEntity is not null they 
should have the same result ("hello") right?

 

      ProvisioningEntity provisioningEntity = new ProvisioningEntity();

      provisioningEntity.setSubjectIdentifier0("hello");




      Map<String, Object> elVariableMap = new HashMap<String, Object>();

      elVariableMap.put("provisioningEntity", provisioningEntity);

      

      String el = "${provisioningEntity.subjectIdentifier0 ? 
provisioningEntity.subjectIdentifier0 : null}";

      

      boolean silent = false;

      boolean lenient = false;

      boolean allowStaticClasses = true;




      Object result = substituteExpressionLanguageScript(el,elVariableMap, 
allowStaticClasses, silent, lenient);

      System.out.println(result);



Reply via email to