incubator-flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Berube (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLEX-33182) override public in subclass results in public write only property. public override works as expected
Date Tue, 28 Aug 2012 18:08:07 GMT

    [ 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

Mime
View raw message