Code analysis reports an error if same subclass consists within two parent classes

Issue #838 resolved
Andreas Epping created an issue

I created a subclass called ScopeEnvironment within two different parent classes (StageAccount and StageConditionAccount). If I use the subclass within StageAccount and without prefixing, Illuminated Cloud reports an error despite the fact that there is no error. See screenshot. I used the newest version of illuminated cloud. 2.0.0.5

Workaround was to prefix the subclass e.g. StageAccount.ScopeEnvironment within the parameters.

Comments (6)

  1. Scott Wells repo owner

    Thanks, Andreas! I'll see about including the fix in the next build or two. Keep 'em coming as you find them! Just helps to create a tighter seal around the whole thing!

  2. Scott Wells repo owner

    Delivered in 2.0.0.6. Please let me know if you continue to see the issue after updating and/or see other issues.

  3. Andreas Epping reporter

    Thanks Scott, however the issue isn't fixed. Now the calling class says "Can't resolve symbol" despite the fact that it could be compiled without errors. Furthermore the inner class now produces a warning, that the constructor of the inner class is never used. See attachments. 2018-01-09_19-50-43.png 2018-01-09_19-54-03.png

  4. Scott Wells repo owner

    Okay, I'll take another look. This one was actually more involved than I'd have expected. So just to ensure that I set things up exactly as you have them, is the unresolvable reference in this case (the first screenshot) also inside of the class StageAccount? Just trying to get full bearings on what you're showing me.

  5. Andreas Epping reporter

    No the first one is a separate class called StageAccountBatch. This class uses the class StageAccount and within the class StageAccount there is a subclass ScopeEnvironment.

  6. Scott Wells repo owner

    Okay, so just to be very specific, you have (first image) a class called StageAccountBatch which contains the line of code:

    StageAccount.ScopeEnvironment scopeEnvironment = new StageAccount.ScopeEnvironment(scope);
    

    and then you have (second image) a class named StageAccount with an inner class called ScopeEnvironment. You have a third class named StageConditionAccount with an inner class also named ScopeEnvironment. The reference to StageAccount.ScopeEnvironment inside of StageAccountBatch is yielding the false positive. Is that correct and complete description of the problem? If so, my guess is that it will be quite quick to fix. Thanks for bearing with me on the details, but they're critically important in reproducing, characterizing, and addressing these.

  7. Log in to comment