You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by "Michael Grove (JIRA)" <ji...@apache.org> on 2012/08/28 14:13:07 UTC

[jira] [Created] (FLEX-33182) override public in subclass results in public write only property. public override works as expected

Michael Grove created FLEX-33182:
------------------------------------

             Summary: override public in subclass results in public write only property. public override works as expected
                 Key: FLEX-33182
                 URL: https://issues.apache.org/jira/browse/FLEX-33182
             Project: Apache Flex
          Issue Type: Bug
    Affects Versions: Adobe Flex SDK 4.6 (Release)
         Environment: Flash Builder 4.6
            Reporter: Michael Grove


I'll upload a zip of classes and test cases for flexunit that demonstrate this problem.  Here's the gist:

We’ve found that the list of accessors is different if a derived class overrides a getter/setter with “public override” vs. “override public”.  “override public” introduces an additional write only public property as shown in both describeType output and in Flash Builder.

Here are some simple classes that demonstrate the problem, text continued below.

package publicoverridevsoverridepublic
{

       [Bindable]
       public class BaseClass
       {
              public var var1:String;

              public var var2:String;
       }
}


package publicoverridevsoverridepublic
{

       [Bindable]
       public class SubClassOverridePublic extends BaseClass
       {
              override public function set var1(value:String):void
              {
                     super.var1 = value;
              }

              override public function get var1():String
              {
                     return super.var1;
              }
       }
}

package publicoverridevsoverridepublic
{

       [Bindable]
       public class SubClassPublicOverride extends BaseClass
       {
              public override function set var1(value:String):void
              {
                     super.var1 = value;
              }

              public override function get var1():String
              {
                     return super.var1;
              }
       }
}

The attributes of SubClassPublicOverride in Flash Builder include a  _3612138var1 property.  It’s a private property that according to Flash Builder is write only (only includes a setter).  I’m not sure what the purpose of this property is, or more generally any of the private properties I’ve seen in Flash Builder with numeric prefixes like this.  And I’m not sure why it is believed only to have a setter.  But as it is private, it is not included in the results from describeType().

The attributes of SubClassOverridePublic in Flash Builder have the same _3612138var1 property but this time it is public and write only.

I've never heard of any language treating "public override" and "override public" as semantically different and assume this must be a bug.

Note that some Flex formatters out there are preconfigured to favor “override public” to “public override” (that’s actually what broke us – formatting the file).  If you’re not using describeType you probably don’t care.  But it’d be interesting to know what else might be different between “override public” and “public override”.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (FLEX-33182) override public in subclass results in public write only property. public override works as expected

Posted by "Michael Grove (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FLEX-33182?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Grove updated FLEX-33182:
---------------------------------

    Attachment: test.zip
    
> override public in subclass results in public write only property. public override works as expected
> ----------------------------------------------------------------------------------------------------
>
>                 Key: FLEX-33182
>                 URL: https://issues.apache.org/jira/browse/FLEX-33182
>             Project: Apache Flex
>          Issue Type: Bug
>    Affects Versions: Adobe Flex SDK 4.6 (Release)
>         Environment: Flash Builder 4.6
>            Reporter: Michael Grove
>         Attachments: test.zip
>
>
> I'll upload a zip of classes and test cases for flexunit that demonstrate this problem.  Here's the gist:
> We’ve found that the list of accessors is different if a derived class overrides a getter/setter with “public override” vs. “override public”.  “override public” introduces an additional write only public property as shown in both describeType output and in Flash Builder.
> Here are some simple classes that demonstrate the problem, text continued below.
> package publicoverridevsoverridepublic
> {
>        [Bindable]
>        public class BaseClass
>        {
>               public var var1:String;
>               public var var2:String;
>        }
> }
> package publicoverridevsoverridepublic
> {
>        [Bindable]
>        public class SubClassOverridePublic extends BaseClass
>        {
>               override public function set var1(value:String):void
>               {
>                      super.var1 = value;
>               }
>               override public function get var1():String
>               {
>                      return super.var1;
>               }
>        }
> }
> package publicoverridevsoverridepublic
> {
>        [Bindable]
>        public class SubClassPublicOverride extends BaseClass
>        {
>               public override function set var1(value:String):void
>               {
>                      super.var1 = value;
>               }
>               public override function get var1():String
>               {
>                      return super.var1;
>               }
>        }
> }
> The attributes of SubClassPublicOverride in Flash Builder include a  _3612138var1 property.  It’s a private property that according to Flash Builder is write only (only includes a setter).  I’m not sure what the purpose of this property is, or more generally any of the private properties I’ve seen in Flash Builder with numeric prefixes like this.  And I’m not sure why it is believed only to have a setter.  But as it is private, it is not included in the results from describeType().
> The attributes of SubClassOverridePublic in Flash Builder have the same _3612138var1 property but this time it is public and write only.
> I've never heard of any language treating "public override" and "override public" as semantically different and assume this must be a bug.
> Note that some Flex formatters out there are preconfigured to favor “override public” to “public override” (that’s actually what broke us – formatting the file).  If you’re not using describeType you probably don’t care.  But it’d be interesting to know what else might be different between “override public” and “public override”.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (FLEX-33182) override public in subclass results in public write only property. public override works as expected

Posted by "Michael Labriola (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FLEX-33182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13443391#comment-13443391 ] 

Michael Labriola commented on FLEX-33182:
-----------------------------------------

Correct. That is what I am saying. I am guessing its not adding extra variables so much as overriding a piece of code which only exists because of the code generation. Meaning that if the original variable were not declared as a variable but rather a getter/setter to begin with, I am guessing... and it is a guess based on my knowledge of that code... that you wouldn't see the same behavior
                
> override public in subclass results in public write only property. public override works as expected
> ----------------------------------------------------------------------------------------------------
>
>                 Key: FLEX-33182
>                 URL: https://issues.apache.org/jira/browse/FLEX-33182
>             Project: Apache Flex
>          Issue Type: Bug
>    Affects Versions: Adobe Flex SDK 4.6 (Release)
>         Environment: Flash Builder 4.6
>            Reporter: Michael Grove
>         Attachments: test.zip
>
>
> I'll upload a zip of classes and test cases for flexunit that demonstrate this problem.  Here's the gist:
> We’ve found that the list of accessors is different if a derived class overrides a getter/setter with “public override” vs. “override public”.  “override public” introduces an additional write only public property as shown in both describeType output and in Flash Builder.
> Here are some simple classes that demonstrate the problem, text continued below.
> package publicoverridevsoverridepublic
> {
>        [Bindable]
>        public class BaseClass
>        {
>               public var var1:String;
>               public var var2:String;
>        }
> }
> package publicoverridevsoverridepublic
> {
>        [Bindable]
>        public class SubClassOverridePublic extends BaseClass
>        {
>               override public function set var1(value:String):void
>               {
>                      super.var1 = value;
>               }
>               override public function get var1():String
>               {
>                      return super.var1;
>               }
>        }
> }
> package publicoverridevsoverridepublic
> {
>        [Bindable]
>        public class SubClassPublicOverride extends BaseClass
>        {
>               public override function set var1(value:String):void
>               {
>                      super.var1 = value;
>               }
>               public override function get var1():String
>               {
>                      return super.var1;
>               }
>        }
> }
> The attributes of SubClassPublicOverride in Flash Builder include a  _3612138var1 property.  It’s a private property that according to Flash Builder is write only (only includes a setter).  I’m not sure what the purpose of this property is, or more generally any of the private properties I’ve seen in Flash Builder with numeric prefixes like this.  And I’m not sure why it is believed only to have a setter.  But as it is private, it is not included in the results from describeType().
> The attributes of SubClassOverridePublic in Flash Builder have the same _3612138var1 property but this time it is public and write only.
> I've never heard of any language treating "public override" and "override public" as semantically different and assume this must be a bug.
> Note that some Flex formatters out there are preconfigured to favor “override public” to “public override” (that’s actually what broke us – formatting the file).  If you’re not using describeType you probably don’t care.  But it’d be interesting to know what else might be different between “override public” and “public override”.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (FLEX-33182) override public in subclass results in public write only property. public override works as expected

Posted by "Michael Grove (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FLEX-33182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13443653#comment-13443653 ] 

Michael Grove commented on FLEX-33182:
--------------------------------------

Switching the base class to be the following had no effect.

package publicoverridevsoverridepublic
{

	public class BaseClassNotBindable
	{
		private var _var1:String;
		private var _var2:String;
		
		public function set var1(value:String):void
		{
			this._var1 = value;	
		}
		
		public function get var1():String
		{
			return _var1;
		}
		
		public function set var2(value:String):void
		{
			this._var2 = value;	
		}
		
		public function get var2():String
		{
			return _var2;
		}
		
	}
}
                
> override public in subclass results in public write only property. public override works as expected
> ----------------------------------------------------------------------------------------------------
>
>                 Key: FLEX-33182
>                 URL: https://issues.apache.org/jira/browse/FLEX-33182
>             Project: Apache Flex
>          Issue Type: Bug
>    Affects Versions: Adobe Flex SDK 4.6 (Release)
>         Environment: Flash Builder 4.6
>            Reporter: Michael Grove
>         Attachments: test.zip
>
>
> I'll upload a zip of classes and test cases for flexunit that demonstrate this problem.  Here's the gist:
> We’ve found that the list of accessors is different if a derived class overrides a getter/setter with “public override” vs. “override public”.  “override public” introduces an additional write only public property as shown in both describeType output and in Flash Builder.
> Here are some simple classes that demonstrate the problem, text continued below.
> package publicoverridevsoverridepublic
> {
>        [Bindable]
>        public class BaseClass
>        {
>               public var var1:String;
>               public var var2:String;
>        }
> }
> package publicoverridevsoverridepublic
> {
>        [Bindable]
>        public class SubClassOverridePublic extends BaseClass
>        {
>               override public function set var1(value:String):void
>               {
>                      super.var1 = value;
>               }
>               override public function get var1():String
>               {
>                      return super.var1;
>               }
>        }
> }
> package publicoverridevsoverridepublic
> {
>        [Bindable]
>        public class SubClassPublicOverride extends BaseClass
>        {
>               public override function set var1(value:String):void
>               {
>                      super.var1 = value;
>               }
>               public override function get var1():String
>               {
>                      return super.var1;
>               }
>        }
> }
> The attributes of SubClassPublicOverride in Flash Builder include a  _3612138var1 property.  It’s a private property that according to Flash Builder is write only (only includes a setter).  I’m not sure what the purpose of this property is, or more generally any of the private properties I’ve seen in Flash Builder with numeric prefixes like this.  And I’m not sure why it is believed only to have a setter.  But as it is private, it is not included in the results from describeType().
> The attributes of SubClassOverridePublic in Flash Builder have the same _3612138var1 property but this time it is public and write only.
> I've never heard of any language treating "public override" and "override public" as semantically different and assume this must be a bug.
> Note that some Flex formatters out there are preconfigured to favor “override public” to “public override” (that’s actually what broke us – formatting the file).  If you’re not using describeType you probably don’t care.  But it’d be interesting to know what else might be different between “override public” and “public override”.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (FLEX-33182) override public in subclass results in public write only property. public override works as expected

Posted by "Michael Labriola (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FLEX-33182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13443373#comment-13443373 ] 

Michael Labriola commented on FLEX-33182:
-----------------------------------------

Whenever you have your own getter and setter and use the Bindable tag without specifying an event, the compiler renames your setter and creates a new one. The new setter checks if the variable has changed and then calls your setter. Its why it is wasteful to use [Bindable] with setters and not dispatch your own event.

That said, there are two things here. First, its really bad to override the setter that you happen to know exists only because of the Bindable tag. Talk about needing to know too much about the internal workings of the compiler and the class to extend it. Just using a getter/setter to begin with makes it so much clearer and so much less likely not to blow up.

Clearly, after that, the compiler could be smarter in its approach, but basically, I am guessing the combo of the bindable to originally generate the setter combined with the existence of an override setter is causing it to get caught in both passes taken to make binding work. Basically, the code was genned for the property of the base class and it is regenerating more code for the subclass.... so, basically, compiler issue yet... bad practice, yes.

                
> override public in subclass results in public write only property. public override works as expected
> ----------------------------------------------------------------------------------------------------
>
>                 Key: FLEX-33182
>                 URL: https://issues.apache.org/jira/browse/FLEX-33182
>             Project: Apache Flex
>          Issue Type: Bug
>    Affects Versions: Adobe Flex SDK 4.6 (Release)
>         Environment: Flash Builder 4.6
>            Reporter: Michael Grove
>         Attachments: test.zip
>
>
> I'll upload a zip of classes and test cases for flexunit that demonstrate this problem.  Here's the gist:
> We’ve found that the list of accessors is different if a derived class overrides a getter/setter with “public override” vs. “override public”.  “override public” introduces an additional write only public property as shown in both describeType output and in Flash Builder.
> Here are some simple classes that demonstrate the problem, text continued below.
> package publicoverridevsoverridepublic
> {
>        [Bindable]
>        public class BaseClass
>        {
>               public var var1:String;
>               public var var2:String;
>        }
> }
> package publicoverridevsoverridepublic
> {
>        [Bindable]
>        public class SubClassOverridePublic extends BaseClass
>        {
>               override public function set var1(value:String):void
>               {
>                      super.var1 = value;
>               }
>               override public function get var1():String
>               {
>                      return super.var1;
>               }
>        }
> }
> package publicoverridevsoverridepublic
> {
>        [Bindable]
>        public class SubClassPublicOverride extends BaseClass
>        {
>               public override function set var1(value:String):void
>               {
>                      super.var1 = value;
>               }
>               public override function get var1():String
>               {
>                      return super.var1;
>               }
>        }
> }
> The attributes of SubClassPublicOverride in Flash Builder include a  _3612138var1 property.  It’s a private property that according to Flash Builder is write only (only includes a setter).  I’m not sure what the purpose of this property is, or more generally any of the private properties I’ve seen in Flash Builder with numeric prefixes like this.  And I’m not sure why it is believed only to have a setter.  But as it is private, it is not included in the results from describeType().
> The attributes of SubClassOverridePublic in Flash Builder have the same _3612138var1 property but this time it is public and write only.
> I've never heard of any language treating "public override" and "override public" as semantically different and assume this must be a bug.
> Note that some Flex formatters out there are preconfigured to favor “override public” to “public override” (that’s actually what broke us – formatting the file).  If you’re not using describeType you probably don’t care.  But it’d be interesting to know what else might be different between “override public” and “public override”.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (FLEX-33182) override public in subclass results in public write only property. public override works as expected

Posted by "Steve Berube (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FLEX-33182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13443260#comment-13443260 ] 

Steve Berube commented on FLEX-33182:
-------------------------------------

Alex; Yes you can this is pretty common practice. Especially in code generators like GAS3 from the Granite project.
                
> override public in subclass results in public write only property. public override works as expected
> ----------------------------------------------------------------------------------------------------
>
>                 Key: FLEX-33182
>                 URL: https://issues.apache.org/jira/browse/FLEX-33182
>             Project: Apache Flex
>          Issue Type: Bug
>    Affects Versions: Adobe Flex SDK 4.6 (Release)
>         Environment: Flash Builder 4.6
>            Reporter: Michael Grove
>         Attachments: test.zip
>
>
> I'll upload a zip of classes and test cases for flexunit that demonstrate this problem.  Here's the gist:
> We’ve found that the list of accessors is different if a derived class overrides a getter/setter with “public override” vs. “override public”.  “override public” introduces an additional write only public property as shown in both describeType output and in Flash Builder.
> Here are some simple classes that demonstrate the problem, text continued below.
> package publicoverridevsoverridepublic
> {
>        [Bindable]
>        public class BaseClass
>        {
>               public var var1:String;
>               public var var2:String;
>        }
> }
> package publicoverridevsoverridepublic
> {
>        [Bindable]
>        public class SubClassOverridePublic extends BaseClass
>        {
>               override public function set var1(value:String):void
>               {
>                      super.var1 = value;
>               }
>               override public function get var1():String
>               {
>                      return super.var1;
>               }
>        }
> }
> package publicoverridevsoverridepublic
> {
>        [Bindable]
>        public class SubClassPublicOverride extends BaseClass
>        {
>               public override function set var1(value:String):void
>               {
>                      super.var1 = value;
>               }
>               public override function get var1():String
>               {
>                      return super.var1;
>               }
>        }
> }
> The attributes of SubClassPublicOverride in Flash Builder include a  _3612138var1 property.  It’s a private property that according to Flash Builder is write only (only includes a setter).  I’m not sure what the purpose of this property is, or more generally any of the private properties I’ve seen in Flash Builder with numeric prefixes like this.  And I’m not sure why it is believed only to have a setter.  But as it is private, it is not included in the results from describeType().
> The attributes of SubClassOverridePublic in Flash Builder have the same _3612138var1 property but this time it is public and write only.
> I've never heard of any language treating "public override" and "override public" as semantically different and assume this must be a bug.
> Note that some Flex formatters out there are preconfigured to favor “override public” to “public override” (that’s actually what broke us – formatting the file).  If you’re not using describeType you probably don’t care.  But it’d be interesting to know what else might be different between “override public” and “public override”.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (FLEX-33182) override public in subclass results in public write only property. public override works as expected

Posted by "Alex Harui (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FLEX-33182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13443203#comment-13443203 ] 

Alex Harui commented on FLEX-33182:
-----------------------------------

Might be a compiler issue.  I didn't think you could override a var with get/set functions at all.
                
> override public in subclass results in public write only property. public override works as expected
> ----------------------------------------------------------------------------------------------------
>
>                 Key: FLEX-33182
>                 URL: https://issues.apache.org/jira/browse/FLEX-33182
>             Project: Apache Flex
>          Issue Type: Bug
>    Affects Versions: Adobe Flex SDK 4.6 (Release)
>         Environment: Flash Builder 4.6
>            Reporter: Michael Grove
>         Attachments: test.zip
>
>
> I'll upload a zip of classes and test cases for flexunit that demonstrate this problem.  Here's the gist:
> We’ve found that the list of accessors is different if a derived class overrides a getter/setter with “public override” vs. “override public”.  “override public” introduces an additional write only public property as shown in both describeType output and in Flash Builder.
> Here are some simple classes that demonstrate the problem, text continued below.
> package publicoverridevsoverridepublic
> {
>        [Bindable]
>        public class BaseClass
>        {
>               public var var1:String;
>               public var var2:String;
>        }
> }
> package publicoverridevsoverridepublic
> {
>        [Bindable]
>        public class SubClassOverridePublic extends BaseClass
>        {
>               override public function set var1(value:String):void
>               {
>                      super.var1 = value;
>               }
>               override public function get var1():String
>               {
>                      return super.var1;
>               }
>        }
> }
> package publicoverridevsoverridepublic
> {
>        [Bindable]
>        public class SubClassPublicOverride extends BaseClass
>        {
>               public override function set var1(value:String):void
>               {
>                      super.var1 = value;
>               }
>               public override function get var1():String
>               {
>                      return super.var1;
>               }
>        }
> }
> The attributes of SubClassPublicOverride in Flash Builder include a  _3612138var1 property.  It’s a private property that according to Flash Builder is write only (only includes a setter).  I’m not sure what the purpose of this property is, or more generally any of the private properties I’ve seen in Flash Builder with numeric prefixes like this.  And I’m not sure why it is believed only to have a setter.  But as it is private, it is not included in the results from describeType().
> The attributes of SubClassOverridePublic in Flash Builder have the same _3612138var1 property but this time it is public and write only.
> I've never heard of any language treating "public override" and "override public" as semantically different and assume this must be a bug.
> Note that some Flex formatters out there are preconfigured to favor “override public” to “public override” (that’s actually what broke us – formatting the file).  If you’re not using describeType you probably don’t care.  But it’d be interesting to know what else might be different between “override public” and “public override”.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (FLEX-33182) override public in subclass results in public write only property. public override works as expected

Posted by "Steve Berube (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FLEX-33182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13443327#comment-13443327 ] 

Steve Berube commented on FLEX-33182:
-------------------------------------

We are overriding the setter and getter of the variable.
Here are some examples from adobe classes that do this
1. A class from adobe that does this
http://opensource.adobe.com/svn/opensource/flex/sdk/trunk/frameworks/projects/flash-integration/src/mx/flash/FlexContentHolder.as
2. http://help.adobe.com/en_US/flex/using/WS0DD82E88-6A07-4b57-BD24-02661DBF32EA.html

3. Here is the link that gives the discrete examples on using the override of a setter or getter.
http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf67eed-7fff.html#WS2db454920e96a9e51e63e3d11c0bf69084-79fb

Excerpt from the page: 
---
If the getter or setter overrides a getter or setter in a superclass, ensure that you include the override keyword, as the following example shows:

override public function get label():String {} 
override public function set label(value:String):void {}

---




                
> override public in subclass results in public write only property. public override works as expected
> ----------------------------------------------------------------------------------------------------
>
>                 Key: FLEX-33182
>                 URL: https://issues.apache.org/jira/browse/FLEX-33182
>             Project: Apache Flex
>          Issue Type: Bug
>    Affects Versions: Adobe Flex SDK 4.6 (Release)
>         Environment: Flash Builder 4.6
>            Reporter: Michael Grove
>         Attachments: test.zip
>
>
> I'll upload a zip of classes and test cases for flexunit that demonstrate this problem.  Here's the gist:
> We’ve found that the list of accessors is different if a derived class overrides a getter/setter with “public override” vs. “override public”.  “override public” introduces an additional write only public property as shown in both describeType output and in Flash Builder.
> Here are some simple classes that demonstrate the problem, text continued below.
> package publicoverridevsoverridepublic
> {
>        [Bindable]
>        public class BaseClass
>        {
>               public var var1:String;
>               public var var2:String;
>        }
> }
> package publicoverridevsoverridepublic
> {
>        [Bindable]
>        public class SubClassOverridePublic extends BaseClass
>        {
>               override public function set var1(value:String):void
>               {
>                      super.var1 = value;
>               }
>               override public function get var1():String
>               {
>                      return super.var1;
>               }
>        }
> }
> package publicoverridevsoverridepublic
> {
>        [Bindable]
>        public class SubClassPublicOverride extends BaseClass
>        {
>               public override function set var1(value:String):void
>               {
>                      super.var1 = value;
>               }
>               public override function get var1():String
>               {
>                      return super.var1;
>               }
>        }
> }
> The attributes of SubClassPublicOverride in Flash Builder include a  _3612138var1 property.  It’s a private property that according to Flash Builder is write only (only includes a setter).  I’m not sure what the purpose of this property is, or more generally any of the private properties I’ve seen in Flash Builder with numeric prefixes like this.  And I’m not sure why it is believed only to have a setter.  But as it is private, it is not included in the results from describeType().
> The attributes of SubClassOverridePublic in Flash Builder have the same _3612138var1 property but this time it is public and write only.
> I've never heard of any language treating "public override" and "override public" as semantically different and assume this must be a bug.
> Note that some Flex formatters out there are preconfigured to favor “override public” to “public override” (that’s actually what broke us – formatting the file).  If you’re not using describeType you probably don’t care.  But it’d be interesting to know what else might be different between “override public” and “public override”.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (FLEX-33182) override public in subclass results in public write only property. public override works as expected

Posted by "Steve Berube (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FLEX-33182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13443382#comment-13443382 ] 

Steve Berube commented on FLEX-33182:
-------------------------------------

The [bindable] on the set/get override was just an example. This issue occurs if the Class is marked as bindable as well (which is completely valid) as the subclass could add additional variables. The uploaded example was just simplified to show the issue.

                
> override public in subclass results in public write only property. public override works as expected
> ----------------------------------------------------------------------------------------------------
>
>                 Key: FLEX-33182
>                 URL: https://issues.apache.org/jira/browse/FLEX-33182
>             Project: Apache Flex
>          Issue Type: Bug
>    Affects Versions: Adobe Flex SDK 4.6 (Release)
>         Environment: Flash Builder 4.6
>            Reporter: Michael Grove
>         Attachments: test.zip
>
>
> I'll upload a zip of classes and test cases for flexunit that demonstrate this problem.  Here's the gist:
> We’ve found that the list of accessors is different if a derived class overrides a getter/setter with “public override” vs. “override public”.  “override public” introduces an additional write only public property as shown in both describeType output and in Flash Builder.
> Here are some simple classes that demonstrate the problem, text continued below.
> package publicoverridevsoverridepublic
> {
>        [Bindable]
>        public class BaseClass
>        {
>               public var var1:String;
>               public var var2:String;
>        }
> }
> package publicoverridevsoverridepublic
> {
>        [Bindable]
>        public class SubClassOverridePublic extends BaseClass
>        {
>               override public function set var1(value:String):void
>               {
>                      super.var1 = value;
>               }
>               override public function get var1():String
>               {
>                      return super.var1;
>               }
>        }
> }
> package publicoverridevsoverridepublic
> {
>        [Bindable]
>        public class SubClassPublicOverride extends BaseClass
>        {
>               public override function set var1(value:String):void
>               {
>                      super.var1 = value;
>               }
>               public override function get var1():String
>               {
>                      return super.var1;
>               }
>        }
> }
> The attributes of SubClassPublicOverride in Flash Builder include a  _3612138var1 property.  It’s a private property that according to Flash Builder is write only (only includes a setter).  I’m not sure what the purpose of this property is, or more generally any of the private properties I’ve seen in Flash Builder with numeric prefixes like this.  And I’m not sure why it is believed only to have a setter.  But as it is private, it is not included in the results from describeType().
> The attributes of SubClassOverridePublic in Flash Builder have the same _3612138var1 property but this time it is public and write only.
> I've never heard of any language treating "public override" and "override public" as semantically different and assume this must be a bug.
> Note that some Flex formatters out there are preconfigured to favor “override public” to “public override” (that’s actually what broke us – formatting the file).  If you’re not using describeType you probably don’t care.  But it’d be interesting to know what else might be different between “override public” and “public override”.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (FLEX-33182) override public in subclass results in public write only property. public override works as expected

Posted by "Alex Harui (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FLEX-33182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13443355#comment-13443355 ] 

Alex Harui commented on FLEX-33182:
-----------------------------------

Sorry, missed the [Bindable] metadata that transforms the vars into get/set pairs and generates the backing variable with the random number to prevent collisions.

                
> override public in subclass results in public write only property. public override works as expected
> ----------------------------------------------------------------------------------------------------
>
>                 Key: FLEX-33182
>                 URL: https://issues.apache.org/jira/browse/FLEX-33182
>             Project: Apache Flex
>          Issue Type: Bug
>    Affects Versions: Adobe Flex SDK 4.6 (Release)
>         Environment: Flash Builder 4.6
>            Reporter: Michael Grove
>         Attachments: test.zip
>
>
> I'll upload a zip of classes and test cases for flexunit that demonstrate this problem.  Here's the gist:
> We’ve found that the list of accessors is different if a derived class overrides a getter/setter with “public override” vs. “override public”.  “override public” introduces an additional write only public property as shown in both describeType output and in Flash Builder.
> Here are some simple classes that demonstrate the problem, text continued below.
> package publicoverridevsoverridepublic
> {
>        [Bindable]
>        public class BaseClass
>        {
>               public var var1:String;
>               public var var2:String;
>        }
> }
> package publicoverridevsoverridepublic
> {
>        [Bindable]
>        public class SubClassOverridePublic extends BaseClass
>        {
>               override public function set var1(value:String):void
>               {
>                      super.var1 = value;
>               }
>               override public function get var1():String
>               {
>                      return super.var1;
>               }
>        }
> }
> package publicoverridevsoverridepublic
> {
>        [Bindable]
>        public class SubClassPublicOverride extends BaseClass
>        {
>               public override function set var1(value:String):void
>               {
>                      super.var1 = value;
>               }
>               public override function get var1():String
>               {
>                      return super.var1;
>               }
>        }
> }
> The attributes of SubClassPublicOverride in Flash Builder include a  _3612138var1 property.  It’s a private property that according to Flash Builder is write only (only includes a setter).  I’m not sure what the purpose of this property is, or more generally any of the private properties I’ve seen in Flash Builder with numeric prefixes like this.  And I’m not sure why it is believed only to have a setter.  But as it is private, it is not included in the results from describeType().
> The attributes of SubClassOverridePublic in Flash Builder have the same _3612138var1 property but this time it is public and write only.
> I've never heard of any language treating "public override" and "override public" as semantically different and assume this must be a bug.
> Note that some Flex formatters out there are preconfigured to favor “override public” to “public override” (that’s actually what broke us – formatting the file).  If you’re not using describeType you probably don’t care.  But it’d be interesting to know what else might be different between “override public” and “public override”.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (FLEX-33182) override public in subclass results in public write only property. public override works as expected

Posted by "Alex Harui (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FLEX-33182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13443310#comment-13443310 ] 

Alex Harui commented on FLEX-33182:
-----------------------------------

I checked with Jeff Dyer, who is the creator of ActionScript 3.  He said:

---------BEGIN QUOTE ---------------
Overriding vars is not allowed in AS3. When I compile the code in the bug report with an asc.jar from last year, here are the errors I get:

jeff-dyers-imac:asc-main jeffdyer$ java -jar asc.jar t.as <http://t.as>  <http://t.as> 

[Compiler] Error #1017: The definition of base class Object was not found.
   t.as <http://t.as>  <http://t.as> , Ln 1, Col 1: 

   package publicoverridevsoverridepublic 
   ^

1 error found
jeff-dyers-imac:asc-main jeffdyer$ java -jar asc.jar -import builtin.abc t.as <http://t.as>  <http://t.as> 

[Compiler] Error #1023: Incompatible override.
   t.as <http://t.as>  <http://t.as> , Ln 20, Col 44: 

                 override public function set var1(value:String):void 
   ...........................................^

[Compiler] Error #1023: Incompatible override.
   t.as <http://t.as>  <http://t.as> , Ln 25, Col 44: 

                 override public function get var1():String 
   ...........................................^

[Compiler] Error #1023: Incompatible override.
   t.as <http://t.as>  <http://t.as> , Ln 38, Col 44: 

                 public override function set var1(value:String):void 
   ...........................................^

[Compiler] Error #1023: Incompatible override.
   t.as <http://t.as>  <http://t.as> , Ln 43, Col 44: 

                 public override function get var1():String 
   ...........................................^

4 errors found

------------- END QUOTE -------------

So, this is a compiler issue.  The compiler should not be allowing this to compile in the first place.  I assume you are using MXMLC?

                
> override public in subclass results in public write only property. public override works as expected
> ----------------------------------------------------------------------------------------------------
>
>                 Key: FLEX-33182
>                 URL: https://issues.apache.org/jira/browse/FLEX-33182
>             Project: Apache Flex
>          Issue Type: Bug
>    Affects Versions: Adobe Flex SDK 4.6 (Release)
>         Environment: Flash Builder 4.6
>            Reporter: Michael Grove
>         Attachments: test.zip
>
>
> I'll upload a zip of classes and test cases for flexunit that demonstrate this problem.  Here's the gist:
> We’ve found that the list of accessors is different if a derived class overrides a getter/setter with “public override” vs. “override public”.  “override public” introduces an additional write only public property as shown in both describeType output and in Flash Builder.
> Here are some simple classes that demonstrate the problem, text continued below.
> package publicoverridevsoverridepublic
> {
>        [Bindable]
>        public class BaseClass
>        {
>               public var var1:String;
>               public var var2:String;
>        }
> }
> package publicoverridevsoverridepublic
> {
>        [Bindable]
>        public class SubClassOverridePublic extends BaseClass
>        {
>               override public function set var1(value:String):void
>               {
>                      super.var1 = value;
>               }
>               override public function get var1():String
>               {
>                      return super.var1;
>               }
>        }
> }
> package publicoverridevsoverridepublic
> {
>        [Bindable]
>        public class SubClassPublicOverride extends BaseClass
>        {
>               public override function set var1(value:String):void
>               {
>                      super.var1 = value;
>               }
>               public override function get var1():String
>               {
>                      return super.var1;
>               }
>        }
> }
> The attributes of SubClassPublicOverride in Flash Builder include a  _3612138var1 property.  It’s a private property that according to Flash Builder is write only (only includes a setter).  I’m not sure what the purpose of this property is, or more generally any of the private properties I’ve seen in Flash Builder with numeric prefixes like this.  And I’m not sure why it is believed only to have a setter.  But as it is private, it is not included in the results from describeType().
> The attributes of SubClassOverridePublic in Flash Builder have the same _3612138var1 property but this time it is public and write only.
> I've never heard of any language treating "public override" and "override public" as semantically different and assume this must be a bug.
> Note that some Flex formatters out there are preconfigured to favor “override public” to “public override” (that’s actually what broke us – formatting the file).  If you’re not using describeType you probably don’t care.  But it’d be interesting to know what else might be different between “override public” and “public override”.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira