Find Usages not working if overriding methods use SObject and List<SObject>
public class Outer {
public class TLV {
public void validate(SObject so, Boolean b1) {
validate(new List<SObject> {
so
}, b1);
}
public void validate(List<SObject> so, Boolean b1) {
System.debug(' ');
}
public void validate(SObject so, Boolean b1, Boolean b2) {
validate(new List<SObject> {
so
}, b1, b2);
}
public void validate(List<SObject> so, Boolean b1, Boolean b2) {
System.debug(' ');
}
public void validate(SObject so, Boolean b1, Boolean b2, Boolean b3) {
validate(new List<SObject> {
so
}, b1, b2, b3);
}
public void validate(List<SObject> so, Boolean b1, Boolean b2, Boolean b3) {
System.debug(' ');
}
public void validate(SObject so, Boolean b1, Boolean b2, Boolean b3, Boolean b4) {
validate(new List<SObject> {
so
}, b1, b2, b3, b4);
}
public void validate(List<SObject> so, Boolean b1, Boolean b2, Boolean b3, Boolean b4) {
System.debug(' ');
}
}
public class TLVUser {
public TLVUser() {
Content__c myObj = new Content__c();
TLV t = new TLV();
t.validate(myObj, false); // GOOD
t.validate(myObj, false, true); // GOOD
t.validate(myObj, true, true, true); // NOT GOOD
t.validate(myObj, true, true, true, false); // NOT GOOD
}
}
}
With something that looks like the above: The ones marked GOOD work as expected, the ones marked NOT GOOD behave as below. I titled this FindUsages but it's not just Find Usages, but also the editor
1) The editor doesn't show the t.validate(...) as if it recognizes the method, ie: It's just white and not colored like a method. 2) Ctrl clicking the method t.validate(...) will show the 2 methods like it doesn't know which one to jump to. 3) Find Usages on the TLV method that takes a single SObject, shows no usages found.
So we have a methods like the one that takes the 3 booleans. I started this example with just one boolean, then thought to myself, I better check it in IntelliJ. That's when I realized the first two work.
So as long as you only have not more than 2 booleans, it works. Weird.
Let me know if you need anything else.
Comments (6)
-
repo owner -
repo owner I have a prospective fix for this. I want to test it a bit more but it will likely be in the next build assuming it pans out.
-
reporter Thanks Scott
-
repo owner Fix delivered for IC2 in 2.0.4.1. IC1 build with this fix will be coming tomorrow.
-
reporter Seems to have fixed the issue.
-
repo owner - changed status to resolved
Delivered in 1.8.4.0 for Illuminated Cloud 1.
- Log in to comment
Easily reproduced. I'll take a look but hopefully it should also be easy to fix. I'll keep you posted.