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

[java] Fix BooleanInstantiationRule for Java 8 #111

Merged
merged 1 commit into from Oct 29, 2016

Conversation

Projects
None yet
2 participants
@jsotuyod
Copy link
Member

commented Oct 12, 2016

  • In Java 8 annotations may appear in several new places. For instance Object o = new @Interned MyObject(); would have this rule fail with a ClassCastException
  • The current code deals with it gracefully
return data;
}

// Get the instantiated type - We can't use getFirstDescendantOfType since that is a DFS search

This comment has been minimized.

Copy link
@jsotuyod

jsotuyod Oct 12, 2016

Author Member

I just realized I could use getFirstChildOfType. Will be updating this PR soon.

In Java 8, annotations may appear as first child
 - For instance `Object o = new @Interned MyObject();` would fail with a ClassCastException
 - The current code deals with it gracefully

@jsotuyod jsotuyod force-pushed the Monits:birule-java8-compat branch from c419f42 to 8f62f6c Oct 13, 2016

@jsotuyod

This comment has been minimized.

Copy link
Member Author

commented Oct 13, 2016

Now it's good to go

@adangel adangel changed the title Fix BooleanInstantiationRule for Java 8 [java] Fix BooleanInstantiationRule for Java 8 Oct 29, 2016

@adangel

This comment has been minimized.

Copy link
Member

commented Oct 29, 2016

Thanks!

@adangel adangel merged commit 8f62f6c into pmd:master Oct 29, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@jsotuyod jsotuyod deleted the Monits:birule-java8-compat branch Oct 29, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.