You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@royale.apache.org by GitBox <gi...@apache.org> on 2018/05/18 11:56:34 UTC

[GitHub] carlosrovira closed pull request #239: Update AMFBinaryData.as

carlosrovira closed pull request #239: Update AMFBinaryData.as
URL: https://github.com/apache/royale-asjs/pull/239
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/frameworks/projects/Network/src/main/royale/org/apache/royale/net/remoting/amf/AMFBinaryData.as b/frameworks/projects/Network/src/main/royale/org/apache/royale/net/remoting/amf/AMFBinaryData.as
index 40067d3ba..abefb6807 100644
--- a/frameworks/projects/Network/src/main/royale/org/apache/royale/net/remoting/amf/AMFBinaryData.as
+++ b/frameworks/projects/Network/src/main/royale/org/apache/royale/net/remoting/amf/AMFBinaryData.as
@@ -150,6 +150,8 @@ public class AMFBinaryData
     private var stringCount:int = 0;
     private var traitCount:int = 0;
     private var objectCount:int = 0;
+	
+	private var flexTraitFound:Boolean = false;
     
     public var pos:int = 0;
         
@@ -871,11 +873,20 @@ public class AMFBinaryData
     {
         var ref:int = this.readUInt29();
         if ((ref & 1) == 0)
-            return this.getObject(ref >> 1);
+		{
+            this.flexTraitFound = false;
+			return this.getObject(ref >> 1);
+		}
         else 
         {
             var traits:Traits = this.readTraits(ref);
-            var obj:Object;
+			if (traits.alias == "flex.messaging.io.ArrayCollection"
+                    || traits.alias == "flex.messaging.io.ObjectProxy")
+			{
+				traits.alias = "";
+				this.flexTraitFound = true;
+			}
+			var obj:Object;
             if (traits.alias) {
                 var c:Class = getClassByAlias(traits.alias);
                 if (c)
@@ -892,13 +903,10 @@ public class AMFBinaryData
             }
             this.rememberObject(obj);
             if (traits.externalizable)
-            {
-                if (obj[CLASS_ALIAS] == "flex.messaging.io.ArrayCollection"
-                    || obj[CLASS_ALIAS] == "flex.messaging.io.ObjectProxy")
-                    return this.readObject();
+				if (this.flexTraitFound)
+                    obj = this.readObject();
                 else
-                    obj[EXTERNALIZED_FIELD] = this.readObject();
-            } 
+					obj[EXTERNALIZED_FIELD] = this.readObject();
             else 
             {
                 for (var i:int in traits.props)


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services