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

can't call a subclass's methods as expressions, from CodePad

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Done
    • Affects Version/s: 2.5.0
    • Fix Version/s: 3.0.0
    • Component/s: CodePad

      Description

      Okay, this is bizarre:

      public class Lala {
         public String toString() { return "haha"; }
         public String foo() { return "mama"; }
      }
      public class Nana extends Lala {
        int bar() { return 99; }
      }
      

      From CodePad, I can't call any of a Nana's inherited methods as an expression; it gives the ol' "missing semicolon" error. However I can call them as statements, and I can call them fine from the parent class Nana. Here's a cut-n-paste from CodePad:

       (new Lala()).toString()
       "haha"   (String)
       (new Lala()).foo()
       "mama"   (String)
       (new Nana()).toString()
       Error: ';' expected
       (new Nana()).foo()
       Error: ';' expected
       (new Nana()).bar()
       99   (int)
       String s = (new Nana()).foo();
       s
       "mama"   (String)
       s = (new Nana()).toString();
       s
       "haha"   (String)
      

      ===========

      It gets a bit weirder: repeating this for the bug report, I was getting inconsistent results; sometimes (new Nana()).bar() would fail, and sometimes (new Lala()).foo() would fail [when called as expressions; I think they always worked as statements|always].

      I don't know, but perhaps it is a related to this error, that I get upon starting 3.0.0-preview:

      2010-03-24 22:21:57.001 java[7380:903] Error loading /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types:  dlopen(/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types, 262): no suitable image found.  Did find:
      	/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: no matching architecture in universal wrapper
      java: OpenScripting.framework - scripting addition "/Library/ScriptingAdditions/Adobe Unit Types.osax" declares no loadable handlers.
      

        Attachments

          Activity

            People

            • Assignee:
              davmac Davin McCall
              Reporter:
              external External via trac
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: