R.S. question
Can R.S. replace in one go:
foo==null?null:foo.level1
foo==null?null:foo.levelOne.level2
by
foo.level1
foo.levelOne.level2
?
(the only filtering constraint is '$foo$ implements MyInterface')
I had to do it in 2 steps.
Alain
Please sign in to leave a comment.
It should
$foo$ == null ? null: $foo$.$bar$
by
$foo$.$bar$
Alain Ravet wrote:
--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"
Maxim
>
On the code below, I replaced
$ssn$ == null ? null : $ssn$.$nodeOrMore$
by
$ssn$.$nodeOrMore$
with as sole constraint that $ssn$ inherits from Serializable
, and only the 1st target is found.
Alain
public final class Foo
{
public static void main (String[] args) {
SuperSuperNode ssn = new SuperSuperNode ();
Node node = ssn == null ? null : ssn.node; <<-- IS FOUND
Node node2 = ssn == null ? null : ssn.supernode.node; <---
is NOT found
}
private static class Node {
}
public static class SuperNode {
public Node node;
}
public static class SuperSuperNode implements Serializable{
public SuperNode supernode;
public Node node;
}
}
Caught the problem (and my error too), current any var should be well
formed part of psi tree, and to match $foo$.$bar$ with
ssn.supernode.node the constraint gets violated.
Lets file full blown JIRA request any way.
Alain Ravet wrote:
>> It should
>> $foo$ == null ? null: $foo$.$bar$
>> by
>> $foo$.$bar$
>>
--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"
Maxim
Done:
"R.S. problem"
http://www.jetbrains.net/jira/browse/IDEA-3693
Alain