GraniteDS Grails Plugin
  1. GraniteDS Grails Plugin
  2. GDSGRAILS-31

Gas3 should not generate proxies for private methods in service proxy objects

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.8.5
    • Fix Version/s: 0.9.0
    • Component/s: Gas3 integration
    • Labels:
      None

      Description

      If I put the following method in my Java service class:

      private String fruitName() {
       return 'banana'
      }

      I get the following in my AS3 service proxy object:

      public function this$2$fruitName(resultHandler:Object = null, faultHandler:Function = null):void {
          if (faultHandler != null)
              callProperty("this$2$fruitName", resultHandler, faultHandler);
          else if (resultHandler is Function || resultHandler is ITideResponder)
              callProperty("this$2$fruitName", resultHandler);
          else if (resultHandler == null)
              callProperty("this$2$fruitName");
          else
              throw new Error("Illegal argument to remote call (last argument should be Function or ITideResponder): " + resultHandler);
      }

      It's fine to just ignore this when your method only returns a String, but if you're returning an object that doesn't exist on the AS side then this creates a compilation error.

      Please ignore private methods when generating service proxies.

        Activity

        Hide
        William Draï added a comment -
        Strangely private methods of Grails services are public methods in the bytecode ???
        Ignored this$.. and super$.. method names.
        Show
        William Draï added a comment - Strangely private methods of Grails services are public methods in the bytecode ??? Ignored this$.. and super$.. method names.

          People

          • Assignee:
            William Draï
            Reporter:
            John Fletcher
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: