2 Replies Latest reply on Dec 18, 2007 2:04 AM by dmurat

    FB3 Beta 3 - another organize imports bug

    dmurat
      I'm getting lucky :-) Here is another organize imports bug in FB3 Beta3...
      If you have some simple hierarchy where base class defines public (or protected) method, and sub class tries to override this method you will encounter this bug. Let say that base class looks like this:

      package test {
      import flash.display.Shape;

      public class BaseClass extends Shape {
      public function BaseClass() {
      }

      public function myMethod():void {
      trace("In BaseClass.myMethod()");
      }
      }
      }

      and that sub class looks like this

      package test {
      public class SubClass extends BaseClass {
      public function SubClass() {
      super();
      }
      }
      }

      Now, if you try to override myMethod() from BaseClass and start typing in subclass something like

      override public function m

      and use Ctrl+Space, FB will insert appropriate method but it will also insert errorneous import statement like this:

      import test.BaseClass.myMethod;

      So you will end up with sub class which looks like following:

      package test {
      import test.BaseClass.myMethod;

      public class SubClass extends BaseClass {
      public function SubClass() {
      super();
      }

      override public function myMethod():void {
      }
      }
      }

      Wrong import is correctly marked as error but issuing "organize import" does not remove it so it must be removed manually.

      Regards,
      Damir Murat

      PS: Sorry for bad code formatting but there is no option for inserting in-line code and attach code is a little bit awkward.