Invalid Inspection issues are not being raised: Method can be made static

Issue #2369 resolved
Jason van Beukering created an issue
  • Appears to be a regression, that in certain circumstances the code inspector is providing a hint that a method can be made static.
  • I have attached an example from my code base where its clear the hint is wrong

Official response

  • Scott Wells repo owner

    With Jason’s help, reproduced this locally as a regression introduced in 2.2.7.0 and I’ve already committed a fix for it. Worst-case scenario it’ll be in next Thursday’s build, but if it’s causing issues for multiple folks, I may issue a hotfix earlier in the week.

Comments (8)

  1. Scott Wells repo owner
    • changed status to open

    Thanks for logging. There was a change to encapsulate the way that declaration reference searching occurs, so I'm sure that would account for the regression. Should be easy to reproduce and fix given the provided example.

  2. Scott Wells repo owner

    I am curious as to why my own regression test suite didn’t catch it, but I’ll augment as necessary.

  3. Scott Wells repo owner

    Hmmmm…I’m unable to reproduce this behavior locally, but perhaps my example is too simple. Does it reproduce for you with just the following?

    public with sharing class Issue2369
    {
        private final Object value;
    
        public String toStringPretty()
        {
            return JSON.serializePretty(value);
        }
    }
    

    If not, can you provide a very simple, standalone reproduction?

  4. Jason van Beukering reporter

    Hi Scott, I’ll email you the full file.. its an open source file which I’ve cleaned up etc. Hopefully it then re-occurs. Btw, we’re seeing this issue in MANY files now.

  5. Jason van Beukering reporter

    I did try the example above, but didn’t result in the inspection in question.

  6. Scott Wells repo owner

    Thank for the example. Unfortunately I still don’t see that issue with it. Once I stubbed the CMN_UTIL_Date methods that were referenced, I only see that its members are unused:

    and to confirm, all of the Apex inspections are enabled:

    I hate to ask you to do this, but can you reset the caches/indices using File > Invlidate Caches… and see if that resolves the issue? Perhaps something is wedged in a bad state for you?

  7. Scott Wells repo owner

    With Jason’s help, reproduced this locally as a regression introduced in 2.2.7.0 and I’ve already committed a fix for it. Worst-case scenario it’ll be in next Thursday’s build, but if it’s causing issues for multiple folks, I may issue a hotfix earlier in the week.

  8. Log in to comment