Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue in computing expressions #167

Closed
garg-ketki opened this issue May 16, 2018 · 3 comments
Closed

Issue in computing expressions #167

garg-ketki opened this issue May 16, 2018 · 3 comments

Comments

@garg-ketki
Copy link

garg-ketki commented May 16, 2018

public enum TestEnum {
    VALUE1,
    VALUE2
  }

List<TestObject> testList = new ArrayList();

class TestObject {
    private TestEnum testEnum;
    public TestEnum getTestEnum() {
        return testEnum;
   }
}

if (testList.get(0).getTestEnum() != null) {
      return testList.get(0).getTestEnum().ordinal(); // not working
}

TestEnum testEnum = testList.get(0).getTestEnum(); // worked
if (testEnum != null) {
      return testEnum.ordinal();
}

Library version: 0.4.4

@msridhar
Copy link
Collaborator

The issue here is not enums, it's the expression testList.get(0).getTestEnum(). We don't track null checks on expressions that read out of lists. If you store testList.get(0) in a local things should work. I don't think we'll get to handling this use case anytime soon, but I'll leave it open just in case

@garg-ketki garg-ketki changed the title Issue in validating enums Issue in computing expressions May 18, 2018
@msridhar
Copy link
Collaborator

@lazaroclapp #285 will fix this right?

@lazaroclapp
Copy link
Collaborator

Yes. This should be fixed now after #285 landed. We aren't cutting a release yet, I think, since that change + optional support by default should merit a 0.7.0 release. In the meantime, closing this issue. Feel free to re-open if not fixed on master or 0.7.0 when it is out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants