You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by jm...@apache.org on 2013/05/11 05:45:14 UTC

[1/6] git commit: [flex-sdk] [refs/heads/develop] - missing a ;

Updated Branches:
  refs/heads/develop 3b98c1d09 -> c6885ea59


missing a ;


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/a615c6b9
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/a615c6b9
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/a615c6b9

Branch: refs/heads/develop
Commit: a615c6b969bdbefc2d0f5c0c82b97ab371381432
Parents: 3b98c1d
Author: Justin Mclean <jm...@apache.org>
Authored: Sat May 11 12:27:40 2013 +1000
Committer: Justin Mclean <jm...@apache.org>
Committed: Sat May 11 12:27:40 2013 +1000

----------------------------------------------------------------------
 .../framework/src/mx/collections/SortField.as      |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/a615c6b9/frameworks/projects/framework/src/mx/collections/SortField.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/framework/src/mx/collections/SortField.as b/frameworks/projects/framework/src/mx/collections/SortField.as
index 3435f7e..47eed0a 100644
--- a/frameworks/projects/framework/src/mx/collections/SortField.as
+++ b/frameworks/projects/framework/src/mx/collections/SortField.as
@@ -601,7 +601,7 @@ public class SortField extends EventDispatcher implements ISortField
             if (left is Date || right is Date)
             {
                 found = true;
-                _compareFunction = dateCompare
+                _compareFunction = dateCompare;
             }
         }
         else if (typeLeft == "xml" || typeRight == "xml")


[2/6] git commit: [flex-sdk] [refs/heads/develop] - Improved addAll and fixed issue with addItem when list is filtered

Posted by jm...@apache.org.
Improved addAll and fixed issue with addItem when list is filtered


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/01e92f10
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/01e92f10
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/01e92f10

Branch: refs/heads/develop
Commit: 01e92f1059fed85452b6169be20db5a9089657bf
Parents: a615c6b
Author: Justin Mclean <jm...@apache.org>
Authored: Sat May 11 12:28:39 2013 +1000
Committer: Justin Mclean <jm...@apache.org>
Committed: Sat May 11 12:28:39 2013 +1000

----------------------------------------------------------------------
 .../src/mx/collections/ListCollectionView.as       |   25 +++++++++-----
 1 files changed, 16 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/01e92f10/frameworks/projects/framework/src/mx/collections/ListCollectionView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/framework/src/mx/collections/ListCollectionView.as b/frameworks/projects/framework/src/mx/collections/ListCollectionView.as
index dcffed1..30c4694 100644
--- a/frameworks/projects/framework/src/mx/collections/ListCollectionView.as
+++ b/frameworks/projects/framework/src/mx/collections/ListCollectionView.as
@@ -570,7 +570,10 @@ public class ListCollectionView extends Proxy
      */
     public function addItem(item:Object):void
     {
-        addItemAt(item, length);
+		if (localIndex)
+        	addItemAt(item, localIndex.length);
+		else
+			addItemAt(item, length);
     }
 
     /**
@@ -622,7 +625,10 @@ public class ListCollectionView extends Proxy
      */
     public function addAll(addList:IList):void
     {
-        addAllAt(addList, length);
+		if (localIndex)
+			addAllAt(addList, localIndex.length);
+		else
+			addAllAt(addList, length);
     }
     
     /**
@@ -649,16 +655,17 @@ public class ListCollectionView extends Proxy
         }
         
         var length:int = addList.length;
+		var maxLength:int = length
+			
+		// incremental index may be out of bounds because of filtering,
+		// so add this item to the end.
+		if (index > maxLength)
+			index = maxLength;
+
         for (var i:int=0; i < length; i++)
         {
             var insertIndex:int = i + index;
-            
-            // incremental index may be out of bounds because of filtering,
-            // so add this item to the end.
-            var currentLength:int = this.length;
-            if (insertIndex > currentLength)
-                insertIndex = currentLength;
-            
+			
             this.addItemAt(addList.getItemAt(i), insertIndex);
         }
     }


[5/6] git commit: [flex-sdk] [refs/heads/develop] - removed duplicate variable

Posted by jm...@apache.org.
removed duplicate variable


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/54ce8e1d
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/54ce8e1d
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/54ce8e1d

Branch: refs/heads/develop
Commit: 54ce8e1d4561b1f4fc2717f7bbe05a2c0b9d596a
Parents: 7490dc6
Author: Justin Mclean <jm...@apache.org>
Authored: Sat May 11 13:39:11 2013 +1000
Committer: Justin Mclean <jm...@apache.org>
Committed: Sat May 11 13:39:11 2013 +1000

----------------------------------------------------------------------
 .../src/mx/collections/ListCollectionView.as       |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/54ce8e1d/frameworks/projects/framework/src/mx/collections/ListCollectionView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/framework/src/mx/collections/ListCollectionView.as b/frameworks/projects/framework/src/mx/collections/ListCollectionView.as
index 746a3e2..6dec2829 100644
--- a/frameworks/projects/framework/src/mx/collections/ListCollectionView.as
+++ b/frameworks/projects/framework/src/mx/collections/ListCollectionView.as
@@ -928,7 +928,7 @@ public class ListCollectionView extends Proxy
 
         if (index == -1)
         {
-            var message:String = resourceManager.getString(
+            message = resourceManager.getString(
                 "collections", "unknownProperty", [ name ]);
             throw new Error(message);
         }


[3/6] git commit: [flex-sdk] [refs/heads/develop] - FLEX-15903 added check for filter function to stop RTE fixed up comment spacing

Posted by jm...@apache.org.
FLEX-15903 added check for filter function to stop RTE
fixed up comment spacing


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/d79d9ba8
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/d79d9ba8
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/d79d9ba8

Branch: refs/heads/develop
Commit: d79d9ba8f0c4cd29a6ab621ea100bc9a8973edf3
Parents: 01e92f1
Author: Justin Mclean <jm...@apache.org>
Authored: Sat May 11 13:02:30 2013 +1000
Committer: Justin Mclean <jm...@apache.org>
Committed: Sat May 11 13:02:30 2013 +1000

----------------------------------------------------------------------
 .../src/mx/collections/ListCollectionView.as       |   26 ++++++++------
 1 files changed, 15 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/d79d9ba8/frameworks/projects/framework/src/mx/collections/ListCollectionView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/framework/src/mx/collections/ListCollectionView.as b/frameworks/projects/framework/src/mx/collections/ListCollectionView.as
index 30c4694..9c8ee8d 100644
--- a/frameworks/projects/framework/src/mx/collections/ListCollectionView.as
+++ b/frameworks/projects/framework/src/mx/collections/ListCollectionView.as
@@ -594,7 +594,7 @@ public class ListCollectionView extends Proxy
         }
 
         var listIndex:int = index;
-        //if we're sorted addItemAt is meaningless, just add to the end
+        // if we're sorted addItemAt is meaningless, just add to the end
         if (localIndex && sort)
         {
             listIndex = list.length;
@@ -735,16 +735,20 @@ public class ListCollectionView extends Proxy
      */
     private function getFilteredItemIndex(item:Object):int
     { 
-        //loc is wrong 
-        //the intent of this function is to find where this new item 
-        //should be in the filtered list, by looking at the main list 
-        //for it's neighbor that is also in this filtered list 
-        //and trying to insert item after that neighbor in the insert locao filtered list 
+        // loc is wrong 
+        // the intent of this function is to find where this new item 
+        // should be in the filtered list, by looking at the main list 
+        // for it's neighbor that is also in this filtered list 
+        // and trying to insert item after that neighbor in the insert locao filtered list 
     
-        //1st get the position in the original list 
+        // 1st get the position in the original list 
         var loc:int = list.getItemIndex(item); 
+		
+		// something gone wrong and list is not filtered so just return loc to stop RTE
+		if (filterFunction == null)
+			return loc;
     
-        //if it's 0 then item must be also the first in the filtered list 
+        // if it's 0 then item must be also the first in the filtered list 
         if (loc == 0) 
             return 0; 
     
@@ -756,7 +760,7 @@ public class ListCollectionView extends Proxy
             { 
                 var len:int = localIndex.length; 
                 // get the index of the item in the filtered set 
-                //for (var j:int = 0; j < len; j++) 
+                // for (var j:int = 0; j < len; j++) 
                 for (var j:int = 0; j < len; j++) 
                 { 
                     if (localIndex[j] == prevItem) 
@@ -765,8 +769,8 @@ public class ListCollectionView extends Proxy
             } 
         } 
 
-        //turns out that there are no neighbors of item in the filtered 
-        //list, so item is the 1st item 
+        // turns out that there are no neighbors of item in the filtered 
+        // list, so item is the 1st item 
         return 0; 
     }
     


[6/6] git commit: [flex-sdk] [refs/heads/develop] - Added sort and remove all test

Posted by jm...@apache.org.
Added sort and remove all test


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/c6885ea5
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/c6885ea5
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/c6885ea5

Branch: refs/heads/develop
Commit: c6885ea5974a99411a8b81e47e96e22f39d8c360
Parents: 54ce8e1
Author: Justin Mclean <jm...@apache.org>
Authored: Sat May 11 13:39:54 2013 +1000
Committer: Justin Mclean <jm...@apache.org>
Committed: Sat May 11 13:39:54 2013 +1000

----------------------------------------------------------------------
 .../Methods/ArrayCollection_Methods.mxml           |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/c6885ea5/mustella/tests/collections/ArrayCollection/Methods/ArrayCollection_Methods.mxml
----------------------------------------------------------------------
diff --git a/mustella/tests/collections/ArrayCollection/Methods/ArrayCollection_Methods.mxml b/mustella/tests/collections/ArrayCollection/Methods/ArrayCollection_Methods.mxml
index 7949e4d..81eef2b 100644
--- a/mustella/tests/collections/ArrayCollection/Methods/ArrayCollection_Methods.mxml
+++ b/mustella/tests/collections/ArrayCollection/Methods/ArrayCollection_Methods.mxml
@@ -199,7 +199,20 @@
 		<AssertMethodValue method="value = application.ac.contains(application.players[11])" value="false" />
 	
 	   </body>
-        </TestCase>     
+        </TestCase>   
+		
+		<TestCase testID="ArrayCollection_Method_sortAndRemoveAll" keywords="[ArrayCollection, Method, itemUpdated,contains]">
+			<setup>
+				<AssertPropertyValue target="application.ac" propertyName ="length" value="4"/>
+				<RunCode code ="application.ready();application.ac.sort();application.ac.removeAll();" />
+				<AssertPropertyValue target="application.ac" propertyName ="length" value="0"/>
+			</setup>
+			<body>
+				<AssertPropertyValue target="ac" propertyName ="length" value="4"/>
+				<AssertMethodValue method="value = application.ac.contains(application.players[11])" value="false" />
+				
+			</body>
+		</TestCase>  
         
     </testCases>
 </UnitTester>


Re: [4/6] git commit: [flex-sdk] [refs/heads/develop] - FLEX-24296 throw out of range error if passed negative index

Posted by Alex Harui <ah...@adobe.com>.
Like it!


On 5/10/13 11:45 PM, "Justin Mclean" <ju...@classsoftware.com> wrote:

> Hi,
> 
>> Like I said, probably not worth your time.  The overhead of proxy is known
>> to be pretty high.
> 
> Looking at the code I'm not even sure what the try catch is in there as there
> nothing that can throw an exception.
> 
> It probably could be simplified to (it may even be faster).
> 
>     override flash_proxy function getProperty(name:*):*
>     {
>         if (name is QName)
>             name = name.localName;
> 
>         var n:Number = parseInt(String(name));
> 
> if (isNaN(n))
>         {
>             message = resourceManager.getString(
>                 "collections", "unknownProperty", [ name ]);
>             throw new Error(message);
>         }
>         else
>         {
>    // If caller passed in a number such as 5.5, it will be floored.
>             return getItemAt(int(n));
>         }
>     }
> 
> getItemAt with throw correct exception if n < 0
> 
> Justin

-- 
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui


Re: [4/6] git commit: [flex-sdk] [refs/heads/develop] - FLEX-24296 throw out of range error if passed negative index

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

> Like I said, probably not worth your time.  The overhead of proxy is known
> to be pretty high.

Looking at the code I'm not even sure what the try catch is in there as there nothing that can throw an exception.

It probably could be simplified to (it may even be faster).

    override flash_proxy function getProperty(name:*):*
    {
        if (name is QName)
            name = name.localName;

        var n:Number = parseInt(String(name));

	if (isNaN(n))
        {
            message = resourceManager.getString(
                "collections", "unknownProperty", [ name ]);
            throw new Error(message);
        }
        else
        {
	    // If caller passed in a number such as 5.5, it will be floored.
            return getItemAt(int(n));
        }
    }

getItemAt with throw correct exception if n < 0

Justin

Re: [4/6] git commit: [flex-sdk] [refs/heads/develop] - FLEX-24296 throw out of range error if passed negative index

Posted by Alex Harui <ah...@adobe.com>.


On 5/10/13 11:21 PM, "Justin Mclean" <ju...@classsoftware.com> wrote:

> Hi,
> 
>> This method is often used in loops so normally I would just let it RTE
>> instead of adding an if statement.
> The overhead of getItemAt is going to be far greater than the if > 0 check but
> I'll take a look in scout to see if it makes any difference.
Like I said, probably not worth your time.  The overhead of proxy is known
to be pretty high.

> 
> Thanks,
> Justin

-- 
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui


Re: [4/6] git commit: [flex-sdk] [refs/heads/develop] - FLEX-24296 throw out of range error if passed negative index

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

> This method is often used in loops so normally I would just let it RTE
> instead of adding an if statement.
The overhead of getItemAt is going to be far greater than the if > 0 check but I'll take a look in scout to see if it makes any difference.

Thanks,
Justin

Re: [4/6] git commit: [flex-sdk] [refs/heads/develop] - FLEX-24296 throw out of range error if passed negative index

Posted by Alex Harui <ah...@adobe.com>.
No need to change this commit, this is just for the record so I can search
the archives for GIGO someday.  This is certainly a friendly thing to do,
and proxy is so slow that you probably won't be able to measure the effect
of the extra if statement, but this would otherwise be an example of a
change that violates the GIGO principle (Garbage In, Garbage Out).

This method is often used in loops so normally I would just let it RTE
instead of adding an if statement.  Again, in FlexJS, I hope we can have
friendlier debug versions of things like this so you don't pay in
production.


On 5/10/13 8:45 PM, "jmclean@apache.org" <jm...@apache.org> wrote:

> FLEX-24296 throw out of range error if passed negative index
> 
> 
> Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
> Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/7490dc68
> Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/7490dc68
> Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/7490dc68
> 
> Branch: refs/heads/develop
> Commit: 7490dc6895ad483e715556d0d2db4315a806d38b
> Parents: d79d9ba
> Author: Justin Mclean <jm...@apache.org>
> Authored: Sat May 11 13:09:01 2013 +1000
> Committer: Justin Mclean <jm...@apache.org>
> Committed: Sat May 11 13:09:01 2013 +1000
> 
> ----------------------------------------------------------------------
>  .../src/mx/collections/ListCollectionView.as       |    8 ++++++++
>  1 files changed, 8 insertions(+), 0 deletions(-)
> ----------------------------------------------------------------------
> 
> 
> http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/7490dc68/frameworks/proje
> cts/framework/src/mx/collections/ListCollectionView.as
> ----------------------------------------------------------------------
> diff --git 
> a/frameworks/projects/framework/src/mx/collections/ListCollectionView.as
> b/frameworks/projects/framework/src/mx/collections/ListCollectionView.as
> index 9c8ee8d..746a3e2 100644
> --- a/frameworks/projects/framework/src/mx/collections/ListCollectionView.as
> +++ b/frameworks/projects/framework/src/mx/collections/ListCollectionView.as
> @@ -911,6 +911,14 @@ public class ListCollectionView extends Proxy
>          {
>              // If caller passed in a number such as 5.5, it will be floored.
>              var n:Number = parseInt(String(name));
> +   
> +   if (n < 0)
> +   {
> +    var message:String = resourceManager.getString(
> +     "collections", "outOfBounds", [ -1 ]);
> +    throw new RangeError(message);
> +   }
> +   
>              if (!isNaN(n))
>                  index = int(n);
>          }
> 

-- 
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui


Re: [4/6] git commit: [flex-sdk] [refs/heads/develop] - FLEX-24296 throw out of range error if passed negative index

Posted by Alex Harui <ah...@adobe.com>.
No need to change this commit, this is just for the record so I can search
the archives for GIGO someday.  This is certainly a friendly thing to do,
and proxy is so slow that you probably won't be able to measure the effect
of the extra if statement, but this would otherwise be an example of a
change that violates the GIGO principle (Garbage In, Garbage Out).

This method is often used in loops so normally I would just let it RTE
instead of adding an if statement.  Again, in FlexJS, I hope we can have
friendlier debug versions of things like this so you don't pay in
production.


On 5/10/13 8:45 PM, "jmclean@apache.org" <jm...@apache.org> wrote:

> FLEX-24296 throw out of range error if passed negative index
> 
> 
> Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
> Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/7490dc68
> Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/7490dc68
> Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/7490dc68
> 
> Branch: refs/heads/develop
> Commit: 7490dc6895ad483e715556d0d2db4315a806d38b
> Parents: d79d9ba
> Author: Justin Mclean <jm...@apache.org>
> Authored: Sat May 11 13:09:01 2013 +1000
> Committer: Justin Mclean <jm...@apache.org>
> Committed: Sat May 11 13:09:01 2013 +1000
> 
> ----------------------------------------------------------------------
>  .../src/mx/collections/ListCollectionView.as       |    8 ++++++++
>  1 files changed, 8 insertions(+), 0 deletions(-)
> ----------------------------------------------------------------------
> 
> 
> http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/7490dc68/frameworks/proje
> cts/framework/src/mx/collections/ListCollectionView.as
> ----------------------------------------------------------------------
> diff --git 
> a/frameworks/projects/framework/src/mx/collections/ListCollectionView.as
> b/frameworks/projects/framework/src/mx/collections/ListCollectionView.as
> index 9c8ee8d..746a3e2 100644
> --- a/frameworks/projects/framework/src/mx/collections/ListCollectionView.as
> +++ b/frameworks/projects/framework/src/mx/collections/ListCollectionView.as
> @@ -911,6 +911,14 @@ public class ListCollectionView extends Proxy
>          {
>              // If caller passed in a number such as 5.5, it will be floored.
>              var n:Number = parseInt(String(name));
> +   
> +   if (n < 0)
> +   {
> +    var message:String = resourceManager.getString(
> +     "collections", "outOfBounds", [ -1 ]);
> +    throw new RangeError(message);
> +   }
> +   
>              if (!isNaN(n))
>                  index = int(n);
>          }
> 

-- 
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui


[4/6] git commit: [flex-sdk] [refs/heads/develop] - FLEX-24296 throw out of range error if passed negative index

Posted by jm...@apache.org.
FLEX-24296 throw out of range error if passed negative index


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/7490dc68
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/7490dc68
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/7490dc68

Branch: refs/heads/develop
Commit: 7490dc6895ad483e715556d0d2db4315a806d38b
Parents: d79d9ba
Author: Justin Mclean <jm...@apache.org>
Authored: Sat May 11 13:09:01 2013 +1000
Committer: Justin Mclean <jm...@apache.org>
Committed: Sat May 11 13:09:01 2013 +1000

----------------------------------------------------------------------
 .../src/mx/collections/ListCollectionView.as       |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/7490dc68/frameworks/projects/framework/src/mx/collections/ListCollectionView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/framework/src/mx/collections/ListCollectionView.as b/frameworks/projects/framework/src/mx/collections/ListCollectionView.as
index 9c8ee8d..746a3e2 100644
--- a/frameworks/projects/framework/src/mx/collections/ListCollectionView.as
+++ b/frameworks/projects/framework/src/mx/collections/ListCollectionView.as
@@ -911,6 +911,14 @@ public class ListCollectionView extends Proxy
         {
             // If caller passed in a number such as 5.5, it will be floored.
             var n:Number = parseInt(String(name));
+			
+			if (n < 0)
+			{
+				var message:String = resourceManager.getString(
+					"collections", "outOfBounds", [ -1 ]);
+				throw new RangeError(message);
+			}
+			
             if (!isNaN(n))
                 index = int(n);
         }