Skip to content

[java] Is there a way to say "type is X or there is no type information" on XPath Expression? #3294

Answered by oowekyala
contivero asked this question in Q&A
Discussion options

You must be logged in to vote

Currently, there's no way to do that within an XPath expression (though with java your hands are freer)

PMD doesn't have any information about the superclass' fields (correct me if my assumption is wrong)

Actually it does, the type resolution framework does resolve them and use their type (but, it doesn't expose eg a reflect.Field instance, only the final Class for the expression). If the classpath is properly configured, and the type of the expression is not resolved, this is a bug that you should report to us :) In PMD 7 this part of pmd will also be very significantly improved.

Given that, I think it's a bad idea to add a way to do what you describe. If we have no information we coul…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@contivero
Comment options

Answer selected by contivero
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants