I have the following class:
static final Logger log = Logger.getLogger(Foo.class.getName());
I want to implement a rule that checks the argument of Logger.getLogger is "Clazz".class.getName(), no matter which class "Clazz" is.
How does that rule have to look like?
I tried with
//Statement[ancestor::MethodDeclaration]/StatementExpression/PrimaryExpression/PrimaryPrefix[starts-with(Name/@Image, 'Logger')]/../PrimarySuffix/Arguments/ArgumentList/Expression[position() =1]/PrimaryExpression/PrimaryPrefix/ResultType/Type/ReferenceType/ClassOrInterfaceType[@Image!=ancestor::ClassOrInterfaceDeclaration/@Image)]]
but it doesn't work...