imadOmran / as3-commons

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

Generic (Vector) parameters for methods are incorrectly identified as Multiname types #51

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a class as follows and compile it to a SWF
package a.b
{
  public class GenericClass
  {
    public var v1:Vector.<int>;

    public function f1(p1:Vector.<int>):Vector.<int>
    {
      return null;
    }
  }
}
2. Load the resultant SWF and examine its structure using AS3-commons

What is the expected output? What do you see instead?
Examining the contents of the DoABCTag:
1. abcFile.instanceInfo[0].slotOrConstantTraits[0].typeMultiname is correctly 
an instance of MultinameG.
2. abcFile.instanceInfo[0].methodInfo[0].returnType also is correctly an 
instance of MultinameG.
3. However, abcFile.instanceInfo[0].methodInfo[0].argumentCollection[0].type is 
not an instance of MultinameG. Instead it's an instance of Qualifiedname. As 
such, there is no way to access the type of the vector (int in this case.)

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 davidarnogplus@gmail.com on 9 Apr 2011 at 10:11

GoogleCodeExporter commented 8 years ago
Hi,

I've made some changes to the as3commons-bytecode trunk. I changed the type of 
Argument.type to BaseMultiname so that it can contain either a QualifiedName or 
a MultinameG and changed the parsing accordingly.
I have very little time lately to do any opensource work so I haven't tested 
this thoroughly. If you are able to give this a testride and report back here 
I'd appreciate a very much.
Thanks a lot in advance!

cheers,

Roland

Original comment by ihatelivelyids on 11 Apr 2011 at 1:51

GoogleCodeExporter commented 8 years ago
Hi Roland,

I've never used Maven before, so may be doing something wrong. What I did was 
ensure I had a complete up to date copy of the trunk, downloaded Maven, added 
the flash player exe to my PATH variable and ran mvm.bat in the as3-commons 
base directory. I then get the following result:

[WARNING] [LAUNCHER] Using regular flashplayer tests
[WARNING] Unit test org.as3commons.bytecode.abc.enum.OpcodeTest failed.
[WARNING] Unit test org.as3commons.bytecode.io.AbcSerializerTest failed.
[WARNING] Unit test org.as3commons.bytecode.swf.SWFFileIOTest failed.
[WARNING] Unit test org.as3commons.bytecode.proxy.impl.ProxyFactoryTest failed.
[INFO] ------------------------------------------------------------------------
[INFO] Tests run: 263, Failures: 9, Errors: 13, Time Elapsed: 0 sec
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] AS3Commons Reflect ................................ SUCCESS [27.873s]
[INFO] AS3Commons Project ................................ SUCCESS [0.157s]
[INFO] AS3Commons ByteCode ............................... FAILURE [2:14.939s]
[INFO] AS3Commons Collections ............................ SKIPPED
[INFO] AS3Commons Concurrency ............................ SKIPPED
[INFO] AS3Commons Lang ................................... SKIPPED
[INFO] AS3Commons Logging ................................ SKIPPED
[INFO] AS3Commons Serialization .......................... SKIPPED
[INFO] AS3Commons UI ..................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------

I've attached the full build results in case they are of use to you. There are 
a lot of warnings in there about the configuration, so I'm guessing I'm missing 
a step, but don't know what.

David.

Original comment by davidarnogplus@gmail.com on 12 Apr 2011 at 8:40

Attachments:

GoogleCodeExporter commented 8 years ago
Oops, well, that was embarassing. I noticed that lately I've been running only 
half of the unit tests... So after a few refactorings I actually screwed up 
some functionality without noticing, damn...
I have fixed three of the four failing tests again, only ProxyFactoryTest is 
still failing, but I'll try and get that fixed a.s.a.p.
Thank you for reporting!

Original comment by ihatelivelyids on 12 Apr 2011 at 10:17

GoogleCodeExporter commented 8 years ago

Original comment by ihatelivelyids on 10 Aug 2011 at 7:15