Uploaded image for project: 'BlueJ'
  1. BlueJ
  2. BLUEJ-1127

Inherited static package-private methods shown on context-menu of class in another package

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Done
    • Affects Version/s: 4.1.2
    • Fix Version/s: 4.1.3
    • Component/s: PkgMgr
    • Sprint:
      BlueJ 4.1.3

      Description

      Given these two classes (Parent in parentPkg, Child in top-level package):

      package parentPkg;
      public class Parent {
          void instanceParent() {}
          static void staticParent() {}
      }
      
      class Child extends parentPkg.Parent {
          void instanceChild() {}
          static void staticChild() {}
      }
      

      The method staticParent() should not be callable via the Child class, because it is package-private to the parentPkg class. If in the top-level codepad you write "Child.staticParent();", you correctly get a compile-time error. But: if you right-click the Child class, you do see the method on the menu (the main bug). If you click it, no error is shown, which makes it seem like the method ran (which also seems like a separate bug to me).

      This is fairly obscure for BlueJ, but it crops up in the Greenfoot rewrite (package-private static methods of Actor show up when right-clicking Crab & co) so it needs fixing.

        Attachments

          Activity

            People

            • Assignee:
              nccb Neil Brown
              Reporter:
              nccb Neil Brown
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: