Giter Site home page Giter Site logo

as3-commons's People

Contributors

bitsofinfo avatar caustic-air avatar cherreman avatar drewbourne avatar jghandour avatar leichtgewicht avatar martinheidegger avatar martinopic avatar rolandzwaga avatar vandammeb avatar

Watchers

 avatar  avatar

as3-commons's Issues

Type.forName() throws error if argument inherits from EventDispatcher

What steps will reproduce the problem?
1.var t:Type = Type.forName("flash.events.EventDispatcher");
2.compile and run
3.see exception in debug trace
<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    preinitialize="preinit()"
    layout="absolute"
    minWidth="1024"
    minHeight="768">

    <mx:Script>
        <![CDATA[
            import org.as3commons.reflect.Type;

            private function preinit():void
            {
                var t:Type = Type.forName("flash.events.EventDispatcher");
            }
        ]]>
    </mx:Script>

</mx:Application>

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

Message: Error #2007: Parameter type must be non-null.
Stack trace: TypeError: Error #2007: Parameter type must be non-null.
    at flash.events::Event()
    at
org.as3commons.lang::ClassUtils$/newInstance()[/home/christophe/IdeaProjects/as3
commons/as3-commons-lang/src/main/actionscript/org/as3commons/lang/ClassUtils.as
:309]
    at
org.as3commons.reflect::Type$/getTypeDescription()[/home/christophe/IdeaProjects
/as3commons/as3-commons-reflect/src/main/actionscript/org/as3commons/reflect/Typ
e.as:221]
    at
org.as3commons.reflect::Type$/forClass()[/home/christophe/IdeaProjects/as3common
s/as3-commons-reflect/src/main/actionscript/org/as3commons/reflect/Type.as:138]
    at
org.as3commons.reflect::Type$/forName()[/home/christophe/IdeaProjects/as3commons
/as3-commons-reflect/src/main/actionscript/org/as3commons/reflect/Type.as:108]
    at
TypeXmlParser$/parseParameters()[/home/christophe/IdeaProjects/as3commons/as3-co
mmons-reflect/src/main/actionscript/org/as3commons/reflect/Type.as:668]
    at
TypeXmlParser$/parseMethodsByModifier()[/home/christophe/IdeaProjects/as3commons
/as3-commons-reflect/src/main/actionscript/org/as3commons/reflect/Type.as:656]
    at
TypeXmlParser$/parseMethods()[/home/christophe/IdeaProjects/as3commons/as3-commo
ns-reflect/src/main/actionscript/org/as3commons/reflect/Type.as:631]
    at
org.as3commons.reflect::Type$/forClass()[/home/christophe/IdeaProjects/as3common
s/as3-commons-reflect/src/main/actionscript/org/as3commons/reflect/Type.as:148]
    at
org.as3commons.reflect::Type$/forName()[/home/christophe/IdeaProjects/as3commons
/as3-commons-reflect/src/main/actionscript/org/as3commons/reflect/Type.as:108]
    at
TypeXmlParser$/parseParameters()[/home/christophe/IdeaProjects/as3commons/as3-co
mmons-reflect/src/main/actionscript/org/as3commons/reflect/Type.as:668]
    at
TypeXmlParser$/parseConstructor()[/home/christophe/IdeaProjects/as3commons/as3-c
ommons-reflect/src/main/actionscript/org/as3commons/reflect/Type.as:622]
    at
org.as3commons.reflect::Type$/forClass()[/home/christophe/IdeaProjects/as3common
s/as3-commons-reflect/src/main/actionscript/org/as3commons/reflect/Type.as:146]
    at
org.as3commons.reflect::Type$/forName()[/home/christophe/IdeaProjects/as3commons
/as3-commons-reflect/src/main/actionscript/org/as3commons/reflect/Type.as:108]
    at TestReflect/preinit()[C:\Documents and Settings\tpatton\Adobe Flash
Builder Beta\TestReflect\src\TestReflect.mxml:14]
    at TestReflect/___TestReflect_Application1_preinitialize()[C:\Documents
and Settings\tpatton\Adobe Flash Builder
Beta\TestReflect\src\TestReflect.mxml:3]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at
mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.x\frameworks\projects\framew
ork\src\mx\core\UIComponent.as:9308]
    at
mx.core::UIComponent/initialize()[C:\autobuild\3.x\frameworks\projects\framework
\src\mx\core\UIComponent.as:5367]
    at
mx.core::Container/initialize()[C:\autobuild\3.x\frameworks\projects\framework\s
rc\mx\core\Container.as:2526]
    at
mx.core::Application/initialize()[C:\autobuild\3.x\frameworks\projects\framework
\src\mx\core\Application.as:846]
    at TestReflect/initialize()[C:\Documents and Settings\tpatton\Adobe Flash
Builder Beta\TestReflect\src\TestReflect.mxml:0]
    at
mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::childAdde
d()[C:\autobuild\3.x\frameworks\projects\framework\src\mx\managers\SystemManager
.as:2043]
    at
mx.managers::SystemManager/initializeTopLevelWindow()[C:\autobuild\3.x\framework
s\projects\framework\src\mx\managers\SystemManager.as:3273]
    at
mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::docFrameH
andler()[C:\autobuild\3.x\frameworks\projects\framework\src\mx\managers\SystemMa
nager.as:3097]
    at
mx.managers::SystemManager/docFrameListener()[C:\autobuild\3.x\frameworks\projec
ts\framework\src\mx\managers\SystemManager.as:2955]


What version of the product are you using? On what operating system?
as3commons-reflect.1.1.swc
Windows XP SP 2
Flash Builder 4 targeting Flex 3.4 and Flash Plasyer 10.

Please provide any additional information below.
tobiaspatton-at-gmail-dot-com

Original issue reported on code.google.com by [email protected] on 25 Sep 2009 at 6:36

ByteCodeType.getImplementationNames fails.

What steps will reproduce the problem?
1. Try ByteCodeType.getImplementationNames() for any interface.
2. ?
3. Fail.

Latest version.

public function getImplementationNames(intf:Class):Array {
     Assert.hasText(interfaceName, "interfaceName argument must not be empty or null");
     var interfaceName:String = getQualifiedClassName(intf);


should be

public function getImplementationNames(intf:Class):Array {
     var interfaceName:String = getQualifiedClassName(intf);
     Assert.hasText(interfaceName, "interfaceName argument must not be empty or null");



Original issue reported on code.google.com by [email protected] on 10 Mar 2011 at 10:09

ClassUtils.isInterface returning True for Object class

What steps will reproduce the problem?
1. Call ClassUtils.isInterface(Object);

What is the expected output? What do you see instead?
Expect false, but get true instead

Please provide any additional information below.
There needs to be an extra check if the specified class is Object, than
return false as an exception (The describeType() XML for the Object class
doesn't have an <extendsClass/> element).

I've replace the isInterface code with the same code I ised in my previous
patch for the Type.isInterface property. I also added an extra unit test
for ClassUtils.isInterface().

Patches are attached.

Original issue reported on code.google.com by ihatelivelyids on 3 Sep 2009 at 7:45

Attachments:

Flex 4 Build

This is a request for the project to begin deploying artifacts built against 
the Flex 4 SDK.

When building a Flex 4 project using flex-mojos, it will report an SDK version 
mismatch error and fail the build. An easy fix is to set flex-mojos' 
ignoreVersionIssues flag to true, however this will likely lead to instability 
issues, especially if other libraries are not flex 4 compatible.

Great work on the libraries!

Original issue reported on code.google.com by [email protected] on 26 Jul 2010 at 10:01

Type fields cache may be set to bogus contents in certain circumstances

Way back I submitted a patch related to the way constructor introspection was 
implemented by as3-commons-reflect:

(see note in XmlTypeProvider#getType())
// Add the Type to the cache before assigning any values to prevent looping.
// Due to the work-around implemented for constructor argument types
// in getTypeDescription(), an instance is created, which could also
// lead to infinite recursion if the constructor uses Type.forName().
// Therefore it is important to seed the cache before calling
// getTypeDescription.

Starting with revision 284, a related problem was introduced in class Type by 
caching the fields HashArray. The cache isn't invalidated if any of the 
constituent member arrays change.

For example, if a constructor of class X uses Type.getField() (directly or 
indirectly) and Type.forClass(X) is called, then the fields cache of the Type 
instance for X will be bogus (e.g., an empty HashArray). Since the fields cache 
is never invalidated, it remains bogus even after the end of the introspection 
recursion.

I'm attaching a patch file to fix this issue. The patch is based on rev. 521.


Original issue reported on code.google.com by [email protected] on 5 Dec 2010 at 3:49

Attachments:

2 warnings in org.as3commons

What steps will reproduce the problem?
1. Compile the reflect library and/or link to it.

3608: 'getClassLogger' has been deprecated since 2.0.  Please use 
'org.as3commons.logging.getClassLogger()'.  ClassNotFoundError.as   /as3-commons/[s
ource path] 
as3-commons-reflect-src-main-actionscript/org/as3commons/reflect/errors line 36 
Flex Problem

3608: 'getClassLogger' has been deprecated since 2.0.  Please use 
'org.as3commons.logging.getClassLogger()'.  Type.as /as3-commons/[source path] 
as3-commons-reflect-src-main-actionscript/org/as3commons/reflect    line 97 Flex 
Problem


I am using the code from the SVN, trunk version from today.

Original issue reported on code.google.com by [email protected] on 10 Feb 2011 at 12:55

Type.for.... methods only reference current ApplicationDomain, add optional param

What steps will reproduce the problem?
1. Load in an external swf containing a class you wish to use. Wait for
Event.Complete.
2. Call Type.forName() with the name of a class contained in the external swf.
3. Class will not be found

4. WORKAROUND: on the loader, load with the LoaderContext.applicationDomain
property set to ApplicationDomain.currentDomain (merging class definitions).
5. Type.forName() returns the correct result.

What is the expected output? What do you see instead?
Throws and error, class not found

What version of the product are you using? On what operating system?
Latest from source

Please provide any additional information below.
Provide optional parameter to Type.for... methods of
(applicationDomain:ApplicationDomain = null) to allow accessing external
libraries.

Original issue reported on code.google.com by carrymass on 10 Aug 2009 at 3:19

Type for a class that implements interfaces doesn't combine the metadata declared in the interfaces

What steps will reproduce the problem?
1. Create an interface and decorate it with arbitrary metadata
2. Create a class that implements this interface
3. Instantiate a Type instance for this class
4. Verify that metadata of the interface will not be returned by the Type
instance

What is the expected output? What do you see instead?
IMHO it would be logical that the metadata from the implemented interfaces
is combined with the metadata of the implementing class.
This is of course open to discussion, but in case you agree, I've attached
a patch that will take care of this. (Oh, and I added some ASDoc for the
properties as well...)

Original issue reported on code.google.com by ihatelivelyids on 9 Jun 2009 at 8:58

Attachments:

Parameter name and default value missing from org.as3commons.reflect.Parameter

I've noticed that Parameter object does not indicate the name of the parameter.

The only identification provided comes from the Parameter#index property.  
Also, while the Parameter#isOptional property does imply that the parameter has 
a default value, the default value itself is not provided.

Are these limitations of the ActionScript type information or of the 
as3-commons-reflect library?  If the latter, please consider this a feature 
request to support providing the name and default value of parameters.

Original issue reported on code.google.com by [email protected] on 27 Jan 2011 at 9:46

Maven build is wrong.

Maven build is wrong.  Released versions cannot have snapshot dependencies.

RE:

<artifactId>as3commons-reflect</artifactId>
<packaging>swc</packaging>
<version>1.1</version>
<name>AS3Commons Reflect</name>
<url>http://code.google.com/p/as3-commons</url>
<description>
  Library providing a reflection API for ActionScript 3.0
</description>
<inceptionYear>2007</inceptionYear>

<dependencies>
                <dependency>
                        <groupId>org.as3commons</groupId>
                        <artifactId>as3commons-lang</artifactId>
                        <version>1.0.0-SNAPSHOT</version>
                        <type>swc</type>
                </dependency>
                <dependency>
                        <groupId>org.as3commons</groupId>
                        <artifactId>as3commons-logging</artifactId>
                        <version>1.1</version>
                        <type>swc</type>
                </dependency>
</dependencies>

Also, why is there no relased as3commons-lang artifact?

Original issue reported on code.google.com by [email protected] on 22 Feb 2010 at 9:23

ByteCodeType.forInstance() fails for instances of private/helper classes

Using: as3commons-bytecode-0.9.8-SNAPSHOT.swc
       as3commons-reflect-1.3.5-SNAPSHOT.swc
       as3commons-lang-0.3.3-SNAPSHOT.swc

The following example code fails with a stack like this:

Error: A class with the name 'Test.as$0::Helper' could not be found.
    at org.as3commons.lang::ClassUtils$/forName()[C:\projects\as3-commons\as3-commons-lang\src\main\actionscript\org\as3commons\lang\ClassUtils.as:84]
    at org.as3commons.lang::ClassUtils$/forInstance()[C:\projects\as3-commons\as3-commons-lang\src\main\actionscript\org\as3commons\lang\ClassUtils.as:50]
    at org.as3commons.bytecode.reflect::ByteCodeType$/forInstance()[C:\projects\as3-commons\as3-commons-bytecode\src\main\actionscript\org\as3commons\bytecode\reflect\ByteCodeType.as:137]

You may want to refer to issue #36, which has been "fixed" and closed, for 
additional details.  However, the fix was directed at ByteCodeType.forName(), 
which doens't actually seem to be involved here.  Indeed, with the latest 
build, ByteCodeType.forInstance() is still failing.

---------------

// Test.as

package
{
    import org.as3commons.bytecode.reflect.ByteCodeType;

    public class Test extends Sprite
    {
        public function Test()
        {
            ByteCodeType.forInstance(new Helper()); // ERROR!
        }
    }
}

class Helper { }

Original issue reported on code.google.com by [email protected] on 1 Feb 2011 at 1:36

Accessor's isReadable() and isWriteable() are incorrect

What steps will reproduce the problem?
1. call isWriteable() for some read only property (with "get" function only)
What is the expected output? What do you see instead?
expected "false", got true

What version of the product are you using? On what operating system?
Latest from SVN as for 19/07/2009

Please provide any additional information below.
I've fixed with this patch
public function isReadable():Boolean
        {
            return (_access == AccessorAccess.READ_ONLY || _access ==
AccessorAccess.READ_WRITE) ? true : false;
        }

 public function isWriteable():Boolean
        {
            return (_access == AccessorAccess.WRITE_ONLY || _access ==
AccessorAccess.READ_WRITE) ? true : false;
        }

Original issue reported on code.google.com by [email protected] on 19 Jul 2009 at 12:24

setter accessor not invoked when using MethodInvokers.ivoke

When setter and getter accessors exist on an object using the
MethodInvokers invoke method only invokes the get accessor when passing
parameters to the method. example
class Person
{
  var m_email:String;
  public function get email() "String
  {...}

  public function set email( email:String ) : void
  { m_email = email; }
}

code example:
var objPerson:Person = new Person();

var params:Array = new Array();
params.push( "[email protected]" );
var m:MethodInvoker = new MethodInvoker();
m.target = objPerson;
m.method = "email";
m.arguments = params;
var returnValue:* = m.invoke();

I would expect the setter methodto be called because
the params is passed and it matches the method signature of the set email
function but the get method is called. Is there a different syntax required
here to invoke the setter?
I am using the as3commons-reflect-1.0.0 swc for this example.

Original issue reported on code.google.com by [email protected] on 5 Feb 2010 at 1:51

New Type property proposition: isInterface

Right now there is no clear way of determining whether an arbitrary type is
a Class or an interface.
Therefore I propose a new property on the Type class called 'isInterface'
which will return true if the specified Type is an interface.

In the describeType() XML there's not really a clear way of determining
this, so far all I can figure out is to check for the existence of an
<extendsClass/> element under the <factory> element. Only in the case that
'Object' is passed in as the clazz argument will this not work, therefore
for this one class there needs to be an exception in the code.

I have attached a patch file for the Type.as file that implements
aforementioned property plus a patch file for the TypeTest.as file that
adds a few tests for the new property.

cheers,

Roland

Original issue reported on code.google.com by ihatelivelyids on 1 Sep 2009 at 4:09

Attachments:

org.as3commons package

The current namespace feels a bit awkward. Perhaps the following alternative 
might be better?

flash.common.*
fl.common.* 

Original issue reported on code.google.com by [email protected] on 19 Feb 2010 at 9:36

StringUtils.equals("\\", "\\") returns false

What steps will reproduce the problem?
1. Make the call: StringUtils.equals("\\", "\\")
2. Result: returns false


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

Should return true. Are there any known issues around the area?

What version of the product are you using? On what operating system?
as3commons-lang 0.2

Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 17 Feb 2011 at 7:46

org.as3commons.reflect.Type.isDynamic wrong?

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 [email protected] on 15 Nov 2010 at 3:37

ByteCodeType.clazz null for private/helper class

Using: as3commons-bytecode-0.9.7.swc,
       as3commons-reflect-1.3.4.swc

Is it expected that ByteCodeType.clazz will contain null for 
private/helper classes, as shown in the following example?  Or,
is this a bug?

The code below clearly already has access to the Helper class
directly when it calls ByteCodeType.forClass().  However, in my
real code, I have a generic function which takes an Object
instance and need to determine its class.  The  instance might
be an instance of an internal/private class.

-----------

// Test.as

package
{
    import org.as3commons.bytecode.reflect.ByteCodeType;

    import flash.display.Sprite;

    public class Test extends Sprite
    {
        public function Test()
        {
            ByteCodeType.fromLoader(loaderInfo);
            var t1:ByteCodeType = ByteCodeType.forClass(Test);
            var t2:ByteCodeType = ByteCodeType.forClass(Helper);
            trace(t1.clazz); // "[class Test]"
            trace(t2.clazz); // "null"  
        }
    }
}

class Helper { }

Original issue reported on code.google.com by [email protected] on 1 Feb 2011 at 12:45

checksums published in Maven are incorrect

The checksums (md5 and sha1) being published in the yoolab maven repository
are incorrect. This seems to be the case for many, if not all, artifacts.
For example, a maven build using as3commons-reflect-1.3 as a dependency
fails when checksum validation is turned on.

If I download the as3commons-reflect-1.3.pom from the yooolab maven
repository and the same pom from the subversion version control repository,
they are identical when I do a diff on them. I also get the same MD5 and
SAH1 checksums for them. But those checksums do not match those published
in the as3commons-reflect-1.3.pom.sha1 and as3commons-reflect-1.3.pom.md5
files in the yoolab repo.

Maven 2.2.0 had a bug in it that it published (i.e. deployed) bad checksums
(see http://jira.codehaus.org/browse/MNG-4235) Is it possible as3-commons
is using v 2.2.0? 

Original issue reported on code.google.com by [email protected] on 23 Apr 2010 at 7:30

Type cache is 'aggresive and forever' with no way to change this

The cache of Type instances is currently a static Object, which emans that
every Type instance ever created will stay in memory for the entire
lifespan of an application.
Changing the cache into a Dictionary object with weak keys can negate this
problem.

I've attached a patch for the Type class that does this, it also adds a new
static method called resetCache(), calling this recreates the cache
dicitonary, optionally you can specify the weakKeys parameter which will e
passed on to the Dictionary constructor.

The Dictionary is created with weak keys by default.

Original issue reported on code.google.com by ihatelivelyids on 17 Sep 2009 at 2:08

org.as3commons.lang.ClassUtils.forName() fails when getting declaring type of method in RSL

What steps will reproduce the problem?
1. Load an RSL swf via URLLoader, and call 
ByteCodeType.fromByteArray(loader.data, tempDomain) where loader refers to the 
URLLoader instance and temp domain is a domain you created.
2. Get the ByteCodeType for some class in that RSL and iterate through its 
methods, tracing their declaringType:
      var type:ByteCodeType = ByteCodeType.forName(className,tempDomain);
      for each(var j:ByteCodeMethod in type.methods){
           trace(j.declaringType);
      }
3. Enjoy the resulting stacktrace:

TypeError: Error #1009: Cannot access a property or method of a null object 
reference.
    at org.as3commons.reflect::JSONTypeProvider/getType()[C:\projects\as3-commons\as3-commons-reflect\src\main\actionscript\org\as3commons\reflect\JSONTypeProvider.as:44]
    at org.as3commons.reflect::Type$/forClass()[C:\projects\as3-commons\as3-commons-reflect\src\main\actionscript\org\as3commons\reflect\Type.as:171]
    at org.as3commons.reflect::Type$/forName()[C:\projects\as3-commons\as3-commons-reflect\src\main\actionscript\org\as3commons\reflect\Type.as:147]
    at org.as3commons.reflect::Method/get declaringType()[C:\projects\as3-commons\as3-commons-reflect\src\main\actionscript\org\as3commons\reflect\Method.as:84]


If you dig deeply enough, the root issue is that 
tempDomain.getDefinition(className) is returning null in 
org.as3commons.lang.ClassUtils.forName().


I can work around this issue by loading RSLs via Loader and calling 
ByteCodeType.fromLoader instead.

Original issue reported on code.google.com by [email protected] on 24 Mar 2011 at 7:16

Enhancement: Determining if a Class "informally" implements an interface

What steps will reproduce the problem?
1. ClassUtils.isImplementationOf only checks whether a class officially 
implements an interface (i.e. whether the class definition includes the phrase 
"Class extends Whatever implements Interface").
2. There is no method for determining whether a class actually contains all of 
the methods necessary to fulfill an interface's implementation.

What is the expected output? What do you see instead?
A method for determining if a class implements all of the methods necessary to 
fulfill an interface.

What version of the product are you using? On what operating system?
Latest trunk, revision 317, Windows XP.

Please provide any additional information below.
Attached is a patch to ClassUtils that introduces a new method, 
"isInformalImplementationOf", that functions as desired.  The patch also adds 
appropriate tests to ClassUtilsTest.  This functionality is useful when 
applying a standard interface wrapper around classes for which one lacks source 
control.

Original issue reported on code.google.com by [email protected] on 26 Jul 2010 at 12:28

Usage of flash.utils.describeType can be expensive, consider caching the results.

When using flash.utils.describeType to describe a large class can be improved 
if the results are cached for later use. Borrowing from the Flex SDK, usage of 
DescribeTypeCache and DescribeTypeCacheRecord (minus the Flex SDK 
dependencies) can improved performance.

Original issue reported on code.google.com by [email protected] on 19 Feb 2010 at 9:45

Attachments:

Invalid assignment.

public function AbstractMember(name:String, type:String, declaringType:String, 
isStatic:Boolean, applicationDomain:ApplicationDomain, metaData:HashArray = 
null) {
                        super(metaData);
                        _name = name;
                        _isStatic = isStatic;
                        typeName = type;
                        declaringTypeName = declaringType;
                        applicationDomain = applicationDomain;
                }

should be (the last line must use 'this' for class property reference):

public function AbstractMember(name:String, type:String, declaringType:String, 
isStatic:Boolean, applicationDomain:ApplicationDomain, metaData:HashArray = 
null) {
                        super(metaData);
                        _name = name;
                        _isStatic = isStatic;
                        typeName = type;
                        declaringTypeName = declaringType;
                        this.applicationDomain = applicationDomain;
                }

Original issue reported on code.google.com by [email protected] on 10 Nov 2010 at 9:05

StringUtils.equals do not behave like expected

(Originally posted on the Spring ActionScript Jira.)

I use org.as3commons.lang.StringUtils to compare Strings in my code. 

In some cases the equals method does not behave like expected, i.e. the given 
FlexUnit testcase fails: 

Assert.assertEquals("Expressions are not equal", false, 
StringUtils.equals("in","notin")); 

What I expect is this testcase does not fail.

Original issue reported on code.google.com by christophe.herreman on 16 Dec 2009 at 8:59

DateUtils.getDaysDiff incorrect on DST boundaries

The following fails:

var start:Date = new Date(2010, 10, 7);
var end:Date = new Date(2010, 10, 8);
Assert.assertEquals(1, DateUtils.getDaysDiff(start, end));

A patch to fix this would be to substitute the getDaysDiff function with:

var startMillis:Number = startDate.getTime();
var endMillis:Number = endDate.getTime();
var dstOffset:Number = (startDate.getTimezoneOffset() - 
endDate.getTimezoneOffset()) * MILLIS_PER_MINUTE;
return Math.ceil((endMillis - startMillis + dstOffset)/ MILLIS_PER_DAY);

Original issue reported on code.google.com by [email protected] on 16 Aug 2010 at 5:55

Retrieve ArrayElementType metadata from a property

What steps will reproduce the problem?
1. Create a new class with an Array property.
2. Add [ArrayElementType("qualified.Clazz")], [Bindable] and [Transient] to 
that property.
3. Try to retrieve all metadata tags from that property at runtime with 
"accessorProperty".metaData 

What is the expected output? What do you see instead?
metaData array should contain ArrayElementType, Bindable and Transient 
Metadata, but only Bindable and Transient appear.

What version of the product are you using? On what operating system?
I'm using as3commons-reflect-1.3.swc on a Windows XP machine with Eclipse and 
FlexBuilder 3.

Please provide any additional information below.
I've noticed that only TRANSIENT and BINDABLE static consts are defined in 
class Metadata.as 
(http://as3-commons.googlecode.com/svn/trunk/as3-commons-reflect/src/main/action
script/org/as3commons/reflect/Metadata.as). Is it the reason of the issue? I'm 
doing anything wrong?


I'm sorry if it isn't really a bug. Thanks!

Original issue reported on code.google.com by [email protected] on 3 Feb 2011 at 11:49

Attachments:

Type generates stack trace error for bindable properties in Flex

What steps will reproduce the problem?
1. Create a bindable property of a custom type in Flex Builder (Flash Builder)
2. Call Type.forClass() method on that Type
3. See stack trace error.

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

This happens because when a property is marked [Bindable], the Flex
preprocessor inserts an Event (PropertyChangeEvent). Event has non
defaulted arguments in the constructor, and for some reason those are not
making it into the parsed arguments.

---------

Message: Error #2007: Parameter type must be non-null.
Stack trace: TypeError: Error #2007: Parameter type must be non-null.
    at flash.events::Event()
    at
org.as3commons.lang::ClassUtils$/newInstance()[/Users/evan.gifford/Documents/Fle
x
Builder 3/AS3Commons_Lang/src/org/as3commons/lang/ClassUtils.as:309]
    at
org.as3commons.reflect::Type$/getTypeDescription()[/Users/evan.gifford/Documents
/Flex
Builder 3/AS3Commons_Reflect/src/org/as3commons/reflect/Type.as:223]
    at
org.as3commons.reflect::Type$/forClass()[/Users/evan.gifford/Documents/Flex
Builder 3/AS3Commons_Reflect/src/org/as3commons/reflect/Type.as:138]
    at
org.as3commons.reflect::Type$/forName()[/Users/evan.gifford/Documents/Flex
Builder 3/AS3Commons_Reflect/src/org/as3commons/reflect/Type.as:108]
    at TypeXmlParser$/parseParameters()[/Users/evan.gifford/Documents/Flex
Builder 3/AS3Commons_Reflect/src/org/as3commons/reflect/Type.as:672]
    at
TypeXmlParser$/parseMethodsByModifier()[/Users/evan.gifford/Documents/Flex
Builder 3/AS3Commons_Reflect/src/org/as3commons/reflect/Type.as:660]
    at TypeXmlParser$/parseMethods()[/Users/evan.gifford/Documents/Flex
Builder 3/AS3Commons_Reflect/src/org/as3commons/reflect/Type.as:635]
    at
org.as3commons.reflect::Type$/forClass()[/Users/evan.gifford/Documents/Flex
Builder 3/AS3Commons_Reflect/src/org/as3commons/reflect/Type.as:148]
    at
org.as3commons.reflect::Type$/forInstance()[/Users/evan.gifford/Documents/Flex
Builder 3/AS3Commons_Reflect/src/org/as3commons/reflect/Type.as:83]
    at
org.as3commons.xstream.mapper::Mapper$/resolveTypeByReflection()[/Users/evan.gif
ford/Documents/Flex
Builder 3/AS3Commons-XStream /src/org/as3commons/xstream/mapper/Mapper.as:17]
    at
org.as3commons.xstream.converters.reflection::ReflectionConverter/map()[/Users/e
van.gifford/Documents/Flex
Builder 3/AS3Commons-XStream
/src/org/as3commons/xstream/converters/reflection/ReflectionConverter.as:58]
    at
org.as3commons.xstream.converters.reflection::ReflectionConverter/fromXML()[/Use
rs/evan.gifford/Documents/Flex
Builder 3/AS3Commons-XStream
/src/org/as3commons/xstream/converters/reflection/ReflectionConverter.as:43]
    at
org.as3commons.xstream.core::XMLToAS$/objectFromXML()[/Users/evan.gifford/Docume
nts/Flex
Builder 3/AS3Commons-XStream /src/org/as3commons/xstream/core/XMLToAS.as:32]
    at
org.as3commons.xstream.converters.basic::ArrayConverter/fromXML()[/Users/evan.gi
fford/Documents/Flex
Builder 3/AS3Commons-XStream
/src/org/as3commons/xstream/converters/basic/ArrayConverter.as:19]
    at
org.as3commons.xstream.core::XMLToAS$/objectFromXML()[/Users/evan.gifford/Docume
nts/Flex
Builder 3/AS3Commons-XStream /src/org/as3commons/xstream/core/XMLToAS.as:32]
    at
org.as3commons.xstream::XStream/fromXML()[/Users/evan.gifford/Documents/Flex 
Builder
3/AS3Commons-XStream /src/org/as3commons/xstream/XStream.as:33]
    at LAB_BigList/xmlLoaderComplete()[/Users/evan.gifford/Documents/Flex
Builder 3/LAB_BigList/src/LAB_BigList.mxml:33]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/onComplete()

Original issue reported on code.google.com by [email protected] on 26 Oct 2009 at 6:23

bug in the reflect package class Type method forName crashes my springactionscript context.



Hi,

The bug simply crashes my complex springactionscript config.

In the class Type, method forName there is an error which "looses" the 
application domain given as parameter in some cases.

try {
if (_cache[name]) {
result = _cache[name];
} else {
result = Type.forClass(org.as3commons.lang.ClassUtils.forNa me(name, 
applicationDomain));
}
}

should be

try {
if (_cache[name]) {
result = _cache[name];
} else {
result = Type.forClass(org.as3commons.lang.ClassUtils.forNa me(name, 
applicationDomain), applicationDomain);
}
}

note the last applicationdomain. If omitted the Type.forClass is looking things 
up in the wrong applicationDomain.

After adding this extra application domain my bug was solved.

cheers,

Arnoud


Original issue reported on code.google.com by [email protected] on 21 Mar 2010 at 12:56

reflect is broken at r. 540 (re: DescribeType.as)

What steps will reproduce the problem?
1. Update Reflect to r. 540 
2. Rebuild as3-commons reflect

What is the expected output? What do you see instead?
The following errors occur in DescribeType.as:

Description Resource    Path    Location    Type
1202: Access of undefined property FLASH10_FLAGS in package 
avmplus.    DescribeType.as /AS3Commons/trunk/as3-commons-reflect/src/main/actionsc
ript/avmplus    line 19 Flex Problem
1202: Access of undefined property FLASH10_FLAGS in package 
avmplus.    DescribeType.as /AS3Commons/trunk/as3-commons-reflect/src/main/actionsc
ript/avmplus    line 19 Flex Problem
1202: Access of undefined property HIDE_NSURI_METHODS in package 
avmplus.    DescribeType.as /AS3Commons/trunk/as3-commons-reflect/src/main/actionsc
ript/avmplus    line 8  Flex Problem
1202: Access of undefined property HIDE_NSURI_METHODS in package 
avmplus.    DescribeType.as /AS3Commons/trunk/as3-commons-reflect/src/main/actionsc
ript/avmplus    line 8  Flex Problem
1202: Access of undefined property HIDE_OBJECT in package 
avmplus.    DescribeType.as /AS3Commons/trunk/as3-commons-reflect/src/main/actionsc
ript/avmplus    line 18 Flex Problem
1202: Access of undefined property HIDE_OBJECT in package 
avmplus.    DescribeType.as /AS3Commons/trunk/as3-commons-reflect/src/main/actionsc
ript/avmplus    line 18 Flex Problem
1202: Access of undefined property INCLUDE_ACCESSORS in package 
avmplus.    DescribeType.as /AS3Commons/trunk/as3-commons-reflect/src/main/actionsc
ript/avmplus    line 12 Flex Problem
1202: Access of undefined property INCLUDE_ACCESSORS in package 
avmplus.    DescribeType.as /AS3Commons/trunk/as3-commons-reflect/src/main/actionsc
ript/avmplus    line 12 Flex Problem
1202: Access of undefined property INCLUDE_BASES in package 
avmplus.    DescribeType.as /AS3Commons/trunk/as3-commons-reflect/src/main/actionsc
ript/avmplus    line 9  Flex Problem
1202: Access of undefined property INCLUDE_BASES in package 
avmplus.    DescribeType.as /AS3Commons/trunk/as3-commons-reflect/src/main/actionsc
ript/avmplus    line 9  Flex Problem
1202: Access of undefined property INCLUDE_CONSTRUCTOR in package 
avmplus.    DescribeType.as /AS3Commons/trunk/as3-commons-reflect/src/main/actionsc
ript/avmplus    line 15 Flex Problem
1202: Access of undefined property INCLUDE_CONSTRUCTOR in package 
avmplus.    DescribeType.as /AS3Commons/trunk/as3-commons-reflect/src/main/actionsc
ript/avmplus    line 15 Flex Problem
1202: Access of undefined property INCLUDE_INTERFACES in package 
avmplus.    DescribeType.as /AS3Commons/trunk/as3-commons-reflect/src/main/actionsc
ript/avmplus    line 10 Flex Problem
1202: Access of undefined property INCLUDE_INTERFACES in package 
avmplus.    DescribeType.as /AS3Commons/trunk/as3-commons-reflect/src/main/actionsc
ript/avmplus    line 10 Flex Problem
1202: Access of undefined property INCLUDE_METADATA in package 
avmplus.    DescribeType.as /AS3Commons/trunk/as3-commons-reflect/src/main/actionsc
ript/avmplus    line 14 Flex Problem
1202: Access of undefined property INCLUDE_METADATA in package 
avmplus.    DescribeType.as /AS3Commons/trunk/as3-commons-reflect/src/main/actionsc
ript/avmplus    line 14 Flex Problem
1202: Access of undefined property INCLUDE_METHODS in package 
avmplus.    DescribeType.as /AS3Commons/trunk/as3-commons-reflect/src/main/actionsc
ript/avmplus    line 13 Flex Problem
1202: Access of undefined property INCLUDE_METHODS in package 
avmplus.    DescribeType.as /AS3Commons/trunk/as3-commons-reflect/src/main/actionsc
ript/avmplus    line 13 Flex Problem
1202: Access of undefined property INCLUDE_TRAITS in package 
avmplus.    DescribeType.as /AS3Commons/trunk/as3-commons-reflect/src/main/actionsc
ript/avmplus    line 16 Flex Problem
1202: Access of undefined property INCLUDE_TRAITS in package 
avmplus.    DescribeType.as /AS3Commons/trunk/as3-commons-reflect/src/main/actionsc
ript/avmplus    line 16 Flex Problem
1202: Access of undefined property INCLUDE_VARIABLES in package 
avmplus.    DescribeType.as /AS3Commons/trunk/as3-commons-reflect/src/main/actionsc
ript/avmplus    line 11 Flex Problem
1202: Access of undefined property INCLUDE_VARIABLES in package 
avmplus.    DescribeType.as /AS3Commons/trunk/as3-commons-reflect/src/main/actionsc
ript/avmplus    line 11 Flex Problem
1202: Access of undefined property USE_ITRAITS in package 
avmplus.    DescribeType.as /AS3Commons/trunk/as3-commons-reflect/src/main/actionsc
ript/avmplus    line 17 Flex Problem
1202: Access of undefined property USE_ITRAITS in package 
avmplus.    DescribeType.as /AS3Commons/trunk/as3-commons-reflect/src/main/actionsc
ript/avmplus    line 17 Flex Problem



What version of the product are you using? On what operating system?
r. 540 on Windows 7, built in Eclipse 3.6.1 with FB4 plug-in.

Please provide any additional information below.
Not sure what version I previously had checked out, but going back to r. 471 
resolved errors.

Original issue reported on code.google.com by [email protected] on 10 Dec 2010 at 2:53

Wrong getDaysDiff() with days in different Daylight Saving Times

When doing relative date calculations, operations like addDays() and 
getDateDiff() often get used one after another. It is expected to have 
consistent dates/differences all the time, but run the following code snippet 
with the 0.3.2 version of as3-commons-lang:

var today:Date = new Date();
for (var i:int = 0; i < 300; i++) {
    var plusDate:Date = DateUtils.addDays(today, i);
    var plus:int = DateUtils.getDaysDiff(today, plusDate);

    var minusDate:Date = DateUtils.addDays(today, -i);
    var minus:int = DateUtils.getDaysDiff(today, minusDate);

    if (plus != i) {
        trace(i + ": Plus= " + plus + " [" + plusDate + "]");  
    } 
    if (minus != -i) {
        trace(i + ":  Minus=" + minus + " [" + minusDate + "]");  
    } 
}

When date1 and date2 are from different Daylight Saving Times, getDaysDiff() 
returns one day too many or too few (executed at 22:18:12 EST on 01/31/2011): 

41: Plus= 42 [Sun Mar 13 23:18:12 GMT-0400 2011]
42: Plus= 43 [Mon Mar 14 23:18:12 GMT-0400 2011]
...
86: Plus= 87 [Wed Apr 27 23:18:12 GMT-0400 2011]
86:  Minus=-85 [Sat Nov 6 23:18:12 GMT-0400 2010]

Compare with "correct" output inside the same DST:
40: Plus= 40 [Sat Mar 12 22:18:12 GMT-0500 2011]

That doesn't happen with 0.3.0 version.
Understood we have to agree, what adding a day means - always "24" hours or 
just a date change. And if time should be changed with the timezone offset 
change. In the example above if the today() time were 23:xx, adding 41 days 
would roll into next day, March 14, though days difference would still remain 
42... 

For my projects to not deal with that complexity, for date-only operations I've 
implemented Julian Day Number-based functions. 
Here is a good source of calendars info: 
http://www.tondering.dk/main/index.php/calendar-information
It'd be nice to have something like that implemented in as3-commons.

Original issue reported on code.google.com by [email protected] on 1 Feb 2011 at 3:44

Revision 291 is broken.


org.as3commons.emit.SWFReader.as shows an error on line 40.
1119: Access of possibly undefined property COMPRESSED_SWF_IDENTIFIER through a 
reference with static type Class.


org.as3commons.serialization.xml.core.ASToXML.as shows an error on line 51.
1136: Incorrect number of arguments.  Expected 5.

Thanks!

Original issue reported on code.google.com by [email protected] on 23 Jun 2010 at 5:05

Private function outside of a package reported as a SlotOrConstantTrait

What steps will reproduce the problem?
1. Create a SWC containing one file - a/b/var1.as - with the following content:

package a.b
{
  public var var1:int = func1();
}
function func1():int { return 1; }

2. Extract the SWF, and load as a byte array. Then use the following code to 
create an array of abcTags:
var data:ByteArray = // load the SWF into the byte array
var io:SWFFileIO = new SWFFileIO();
var swfFile:SWFFile = io.read(data);
var abcTags:Array = swfFile.getTagsByType(DoABCTag);

3. Examine the DoABCTag associated with var1.

What is the expected output? What do you see instead?
I would expect to see two traits in scriptInfo[0].traits. The first one ought 
to be a SlotOrConstantTrait containing details of var1. The second ought to be 
a MethodTrait containing details of func1.

Instead there are two SlotOrConstantTrait entries. The first is correct; the 
second contains details of func1, presented as a variable.

What version of the product are you using? On what operating system?
as3commons-bytecode-1.0-RC3.swc
as3commons-lang-0.3.2.swc
Windows 7, 64 bit. 

Please provide any additional information below.
I am testing this using an AIR application built using Flex SDK 4.5. I'm 
assuming this makes no difference to the structure of either the SWC or the way 
as3-commons behaves. Please let me know if it's worth me re-testing using 
another configuration.

Original issue reported on code.google.com by [email protected] on 6 Apr 2011 at 9:37

Vote for mergin logging branch of martin heidegger to trunk

Just trying to work with as3commons logging. It's quite difficult if I
don't want to write my own code for...
...limited Logger variants
...LogLevel is not configurable
...output is hardcoded in Loggers
...output is nasty ("(new Date()).toString()", full class name !!)

I found that logging branch of martin heidegger. It is really handy and
highly configureable.
Seems that some experience of as2lib went into that work...

I vote for merging this approach to trunk!





Original issue reported on code.google.com by [email protected] on 19 May 2010 at 5:23

No way of asscertaining if a Type is an interface

What steps will reproduce the problem?
1. Use one of the Type.for...() methods to return a type.
2. No method is available to determine isInterface().
3. WORKAROUND: use ClassUtils.isInterface(type.clazz) to determine if is
interface. 

What is the expected output? What do you see instead?
Expect method directly on type object for determining interface

What version of the product are you using? On what operating system?
latest source

Please provide any additional information below.
Tiny feature improvement.

Original issue reported on code.google.com by carrymass on 10 Aug 2009 at 3:32

Metadata cannot be retrieved for private/helper classes

The following program fails with this error:

  Error: A class with the name 'Test.as$0::Helper' could not be found.

The same thing happens when ByteCodeType.forInstance or the similar Type 
methods are used.

Is this expected?  Is this a limitation of AS3 or a problem in the 
as3-commons-reflect library?

It would be very useful if private/helper classes could be treated just like 
any other class with respect to reflection.

------------

// Test.as

package
{
    import org.as3commons.bytecode.reflect.ByteCodeType;

    public class Test extends Sprite
    {
        public function Test()
        {
            ByteCodeType.forClass(Helper); // ERROR!
        }
    }
}

class Helper { }

Original issue reported on code.google.com by [email protected] on 27 Jan 2011 at 7:54

Memory leak causes AIR runbtime to remain in memory

What steps will reproduce the problem?
1. Create an AIR application
2. Add this code in a creattion_complete handler (or anywhere else):
var clazz:Class = ClassUtils.forName(this.className);
var type:Type = Type.forClass(clazz); 
3. Close the application
4. Check Windows Task Manager and see that the process 'adl.exe' remains active

What is the expected output? What do you see instead?
adl.exe ought to have been stopped along with the cl,osing of the
application, but it didn't.

What version of the product are you using? On what operating system?
Latest SVN version.

Please provide any additional information below.
I've attached patches that contain the fix for this issue. It turns out
there was a circular reference between the Type and AbstractMember classes.

Original issue reported on code.google.com by ihatelivelyids on 11 May 2009 at 7:44

Attachments:

Provide src/asdoc archive download

Not an issue really.

Quite a good idea to provide this commons toolkit. Is it possible to 
provide a zipped asdoc (and src) for users to download? That'd be 
convenient for offline usage.

Original issue reported on code.google.com by [email protected] on 30 Jul 2009 at 2:55

method "hasKey" of MapFx cannot be triggered by flex data binding mechanism

What steps will reproduce the problem?
1.unzip attached zip file.
2.import the project into flash builder
3.compile the project with flex sdk 4.1
4.run the application.

The second checkbox should be selected as I bind it to the method "hasKey" of 
the specified map. but it's not.

I am working with as3commons-collections-1.1.swc on XP with flex SDK 4.1

I also provided a patch in the zip file, hope this can help you.

Thanks,
Edison
[email protected]

Original issue reported on code.google.com by [email protected] on 10 Mar 2011 at 9:03

Attachments:

vector type causes Type.forInstance() to fail

What steps will reproduce the problem?
1.create a vector, e.g., var v:Vector.<User> = new Vector.<User>();
2.var type:Type = Type.forInstance( v );

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

expected 'Vector' but got ClassNotFoundError thrown from ClassUtils.forName() 
line 84.


What version of the product are you using? On what operating system?
lang-0.3.swc, reflect-1.3.swc


Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 26 Oct 2010 at 11:40

Interfaces missing from the SWC

What steps will reproduce the problem?
1. Create a project that uses as3commons-bytecode-1.0-RC3.swc
2. Reference a class that uses AbcFile, AbcDeserializer, SWFFile, SWFFileIO and 
DoABCTag (don't know which of these causes the problem)
3. It will fail to build as IClonable and IEquals cannot be resolved.

What version of the product are you using? On what operating system?
as3commons-bytecode-1.0-RC3.swc


Original issue reported on code.google.com by [email protected] on 28 Mar 2011 at 6:50

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.