sushihangover / as3-commons

Automatically exported from code.google.com/p/as3-commons
1 stars 0 forks source link

org.as3commons.reflect.Type.isDynamic wrong? #32

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.create an class
2.new instance this class ,and then flash.utils.describeType(instance),I get 
something like:
<type name="net.kentop.uirenderer.form::ItemDefine" base="Object" 
isDynamic="false" isFinal="false" isStatic="false">
where isDynamic is false.
3.use Type.forInstance(instance),I got type.isDynamic is true.

What is the expected output? What do you see instead?

When var type:Type = Type.forInstance(instance); The type.isDynamic should be 
false ,but I got true.

I have make a test:

When I flash.utils.describeType(Clazz),I got below:
<type name="net.kentop.uirenderer.form::ItemDefine" base="Class" 
isDynamic="true" isFinal="true" isStatic="true">

where base is "Class" ,and isDynamic is true.

describeType(instance) and describeType(clazz) aren't same thing. am i right?

btw : thanks you all . you are doing an good job

Original issue reported on code.google.com by 601...@qq.com on 15 Nov 2010 at 3:37

GoogleCodeExporter commented 8 years ago
When I continue research this Issue,I found :

var describe:XML = flash.utils.describeType(target);
var isDynamic:Boolean = (describe.@isDynamic as String) == "true";

describe.@isDynamic is XMLList , but not "Boolean".

Original comment by 601...@qq.com on 15 Nov 2010 at 4:14

GoogleCodeExporter commented 8 years ago
Hi,

I've briefly investigated this issue and have found that describeType doesn't 
always return reliable data. For instance, one of the test classes is called 
'ComplexClass' and its class declaration look like this:

public class ComplexClass

Yet, when I trace the unit tests I see this XML return by describeType():

<type name="org.as3commons.reflect.testclasses::ComplexClass" base="Class" 
isDynamic="true" isFinal="true" isStatic="true">

That seems to be all wrong, right? Maybe this is a problem with the flashplayer 
I'm using? I have no idea what's going on here, but it seems to be all wrong.

Original comment by ihatelivelyids on 25 Nov 2010 at 2:05

GoogleCodeExporter commented 8 years ago
I'm changing the status of this bug to 'Won't fix' since the data retrieved 
from the native describeType() is faulty. Unfortunately there's nothing we can 
do about that.
The as3commons-reflect library has however been augmented with the new 
describeTypeJSON support. It seems that this native method does yield the 
correct data. This will only be available in flashplayer 10.1 and higher 
though. (Since from that versionb the describeTypeJSON method was exposed)

Original comment by ihatelivelyids on 11 Jan 2011 at 12:02