Filter noisy "Dependent class is invalid and needs recompilation" errors from Problems View

Issue #161 resolved
Michael Hoefer created an issue

When the issue is in a dependent class, the stack trace linking should go to the actual class with the problem.

For example: ProductConfigurationControllerTests.cls Error:(17, 57) Dependent class is invalid and needs recompilation: ProductConfigurationController: line 18, column 81: Non-void method might not return a value or might have statement after a return statement.

Clicking that error takes you to the ProductConfigurationControllerTests.cls file, when it should take you to ProductConfigurationController: line 18, column 81

Comments (11)

  1. Scott Wells repo owner

    Michael, I tried to reproduce this but suspect that I've changed things in a way that may not have the same formatting that you're seeing. Here's the stack trace that I'm pasting into Analyze>Analyze Stacktrace...:

    ShoppingListMobileListControllerTest.cls Error:(11, 59) Dependent class is invalid and needs recompilation: 
    ShoppingListMobileListController: line 28, column 9: Non-void method might not return a value or might have statement after a return statement.
    

    and while the first line isn't linking to anything, the second line properly links to ShoppingListMobileController line 28, column 9 which is the branching logic that results in a code path that doesn't yield a return value.

    Can you please provide a specifically formatted example that reproduces the issue? Thanks!

  2. Michael Hoefer reporter

    Hey Scott. Reading my original post, I wasn't clear enough. This happens when you get a compile error. To reproduce, I have AbstractProductRuleValidator which relies on MetaDataUtils. I introduce a syntax error in the latter, and then compile both (CMD+OPT+SHIFT+F9). The result is a series of errors. I get:

    /Users/michael/Code/CPQ/src/classes/AbstractProductRuleValidator.cls Error:(24, 41) Dependent class is invalid and needs recompilation: Class.QuoteVO.prepareJSQCPriceRules: line 160, column 43 Class.QuoteLinePriceRuleEvaluator: line 1, column 63 Class.AbstractPriceRuleEvaluator.applyRuleActions: line 66, column 57 AliasedMetaDataUtils: line 108, column 62: Dependent class is invalid and needs recompilation: MetaDataUtils: line 65, column 9: Invalid type: Boomtasm

    In this case, none of those lines are hyperlinked, and clicking the whole error takes you to AbstractProductRuleValidator, when it should take you to MetaDataUtils where the actual error occurred.

  3. Michael Hoefer reporter

    And sorry, when I say 'Error', I should have said 'Problem'. As in, the above appears in the Problems tab, as a compile error.

  4. Scott Wells repo owner

    Michael, thanks for the update. Just to make sure I'm trying the same thing, here's a screenshot where I've introduced a compilation error in one class and tried to compile it alongside another class that contains a reference to the symbol that won't compile (also using CTRL+ALT+SHIFT+F9):

    Issue161.png

    The Salesforce APIs report two errors, one in each file. The resulting Problems View contains those two errors, each linked to the corresponding location in the associated file.

    Can you verify that I'm taking the correct steps to try to reproduce the issue? I definitely understand that even if so, it's not working properly for you. First I want to be 100% sure that we're doing the same thing, though. I'll also try this on my Mac in a bit to see if the behavior is different for some reason.

    Thanks much!

  5. Michael Hoefer reporter

    Yes, that is what I’m seeing. The second error you see there does indeed link to the correct place. The trouble is, for a ‘real’ project the list of the ‘Dependent class is invalid and needs recompilation’ errors can be very long. Like, hundreds of lines long. So finding the actual error is painful. Much, much better to be able to double click the indirect error and go to the correct spot in the code.

  6. Scott Wells repo owner

    Ah, I see. Yes, that's an annoyance that I've experienced many times as well. The error information that is shown in the Problems View is taken directly from the API deployment response. If you agree, what I'd like to do is keep this issue around as an enhancement to allow filtering of "Dependent class if invalid and need recompilation" errors from the Problems View as a configurable setting.

  7. Log in to comment