FLEX-34941 Although not directly connected to this ticket, taking the opportunity to remove two unused (and identical) private static methods (for which, are they to be needed in the future, we have an alternative in mx.utils.ObjectUtil.getValue).
Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/908d2a2e Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/908d2a2e Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/908d2a2e Branch: refs/heads/develop Commit: 908d2a2e60a2c952a0d59d91efc697271b78d8d7 Parents: 9094071 Author: Mihai Chira <[email protected]> Authored: Wed Oct 21 12:35:48 2015 +0200 Committer: Mihai Chira <[email protected]> Committed: Wed Oct 21 12:35:48 2015 +0200 ---------------------------------------------------------------------- .../framework/src/mx/validators/Validator.as | 67 +++-------------- .../GlobalizationValidatorBase.as | 75 ++++---------------- 2 files changed, 21 insertions(+), 121 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/908d2a2e/frameworks/projects/framework/src/mx/validators/Validator.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/framework/src/mx/validators/Validator.as b/frameworks/projects/framework/src/mx/validators/Validator.as index f087348..81051a0 100644 --- a/frameworks/projects/framework/src/mx/validators/Validator.as +++ b/frameworks/projects/framework/src/mx/validators/Validator.as @@ -20,18 +20,15 @@ package mx.validators { -import flash.events.Event; -import flash.events.EventDispatcher; -import flash.events.IEventDispatcher; -import mx.binding.BindingManager; -import mx.core.IMXMLObject; -import mx.events.FlexEvent; -import mx.events.ValidationResultEvent; -import mx.managers.ISystemManager; -import mx.managers.SystemManager; -import mx.resources.IResourceManager; -import mx.resources.ResourceManager; -import mx.validators.IValidator; + import flash.events.Event; + import flash.events.EventDispatcher; + import flash.events.IEventDispatcher; + + import mx.core.IMXMLObject; + import mx.events.FlexEvent; + import mx.events.ValidationResultEvent; + import mx.resources.IResourceManager; + import mx.resources.ResourceManager; //-------------------------------------- // Events @@ -179,53 +176,7 @@ public class Validator extends EventDispatcher implements IMXMLObject,IValidator return result; } - /** - * @private - */ - private static function findObjectFromString(doc:Object, - value:String):Object - { - var obj:Object = doc; - var parts:Array = value.split("."); - var n:int = parts.length; - for (var i:int = 0; i < n; i++) - { - try - { - obj = obj[parts[i]]; - - // There's no guarantee that the objects have - // already been created when this function fires; - // for example, in the deferred instantiation case, - // this function fires before the object for validation - // has been created. - if (obj == null) - { - //return true; - } - } - catch(error:Error) - { - if ((error is TypeError) && - (error.message.indexOf("null has no properties") != -1)) - { - var resourceManager:IResourceManager = - ResourceManager.getInstance(); - var message:String = resourceManager.getString( - "validators", "fieldNotFound", [ value ]); - throw new Error(message); - } - else - { - throw error; - } - } - } - - return obj; - } - /** * @private */ http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/908d2a2e/frameworks/projects/spark/src/spark/validators/supportClasses/GlobalizationValidatorBase.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/spark/src/spark/validators/supportClasses/GlobalizationValidatorBase.as b/frameworks/projects/spark/src/spark/validators/supportClasses/GlobalizationValidatorBase.as index 218338a..a76fe1a 100644 --- a/frameworks/projects/spark/src/spark/validators/supportClasses/GlobalizationValidatorBase.as +++ b/frameworks/projects/spark/src/spark/validators/supportClasses/GlobalizationValidatorBase.as @@ -27,22 +27,18 @@ package spark.validators.supportClasses { -import flash.events.Event; -import flash.events.EventDispatcher; -import flash.events.IEventDispatcher; -import mx.binding.BindingManager; -import mx.core.IMXMLObject; -import mx.events.FlexEvent; -import mx.validators.IValidatorListener; -import mx.events.ValidationResultEvent; -import mx.validators.ValidationResult; -import mx.validators.IValidator; -import mx.managers.ISystemManager; -import mx.managers.SystemManager; -import mx.resources.IResourceManager; -import mx.resources.ResourceManager; - -import spark.globalization.supportClasses.GlobalizationBase; + import flash.events.Event; + import flash.events.IEventDispatcher; + + import mx.events.FlexEvent; + import mx.events.ValidationResultEvent; + import mx.resources.IResourceManager; + import mx.resources.ResourceManager; + import mx.validators.IValidator; + import mx.validators.IValidatorListener; + import mx.validators.ValidationResult; + + import spark.globalization.supportClasses.GlobalizationBase; //-------------------------------------- // Events @@ -978,53 +974,6 @@ public class GlobalizationValidatorBase extends GlobalizationBase /** * @private */ - private static function findObjectFromString(doc:Object, - value:String):Object - { - var obj:Object = doc; - var parts:Array = value.split("."); - - var n:int = parts.length; - for (var i:int = 0; i < n; i++) - { - try - { - obj = obj[parts[i]]; - - // There's no guarantee that the objects have - // already been created when this function fires; - // for example, in the deferred instantiation case, - // this function fires before the object for validation - // has been created. - if (!obj) - { - //return true; - } - } - catch (error:Error) - { - if ((error is TypeError) && - (error.message.indexOf("null has no properties") != -1)) - { - var resourceManager:IResourceManager = - ResourceManager.getInstance(); - var message:String = resourceManager.getString( - "validators", "fieldNotFound", [ value ]); - throw new Error(message); - } - else - { - throw error; - } - } - } - - return obj; - } - - /** - * @private - */ private static function trimString(str:String):String { var startIndex:int = 0;
