Return-Path: X-Original-To: apmail-flex-issues-archive@minotaur.apache.org Delivered-To: apmail-flex-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1E0A8107F4 for ; Fri, 6 Dec 2013 17:43:40 +0000 (UTC) Received: (qmail 545 invoked by uid 500); 6 Dec 2013 17:43:38 -0000 Delivered-To: apmail-flex-issues-archive@flex.apache.org Received: (qmail 498 invoked by uid 500); 6 Dec 2013 17:43:37 -0000 Mailing-List: contact issues-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flex.apache.org Delivered-To: mailing list issues@flex.apache.org Received: (qmail 486 invoked by uid 99); 6 Dec 2013 17:43:36 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Dec 2013 17:43:36 +0000 Date: Fri, 6 Dec 2013 17:43:36 +0000 (UTC) From: "Ben Burns (JIRA)" To: issues@flex.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (FLEX-33644) XMLEncoder improperly handles encoding the string "null". MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/FLEX-33644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13841462#comment-13841462 ] Ben Burns edited comment on FLEX-33644 at 12/6/13 5:42 PM: ----------------------------------------------------------- Thanks, Justin. I created a fork of my fiddle test case to demonstrate what you're saying. Personally I think the real problem is that anything would ever coerce to null, or that null would ever coerce to null. It's my opinion that null should only ever be coerced to false (or maybe the opposite to prevent weird coercion chains) in languages which support type coercion, and that for all other purposes, a == null should be identical to a === null. In lieu of making that change, I'd recommend auditing all flex XML processing code for null checks using the weak equality operator where they should in fact be using the strict equality operator. was (Author: benjamincburns): Thanks, Justin. I created a fork of my fiddle test case to demonstrate what you're saying. Personally I think the real problem is that anything would ever coerce to null, or that null would ever coerce to null. It's my opinion that null should only ever be coerced to false in languages which support type coercion, and that for all other purposes, a == null should be identical to a === null. In lieu of making that change, I'd recommend auditing all flex XML processing code for null checks using the weak equality operator where they should in fact be using the strict equality operator. > XMLEncoder improperly handles encoding the string "null". > --------------------------------------------------------- > > Key: FLEX-33644 > URL: https://issues.apache.org/jira/browse/FLEX-33644 > Project: Apache Flex > Issue Type: Bug > Components: RPC: General > Affects Versions: Adobe Flex SDK 3.0 (Release), Adobe Flex SDK 3.1 (Release), Adobe Flex SDK 3.2 (Release), Adobe Flex SDK 3.3 (Release), Adobe Flex SDK 3.4 (Release), Adobe Flex SDK 3.5 (Release), Adobe Flex SDK 3.6 (Release), Apache Flex 4.9.0 > Reporter: Ben Burns > Labels: rpc, soap, xml, xmlrpc > > The following code returns an empty string: > var enc:XMLEncoder = new XMLEncoder(); > enc.encode("null"); > However, SchemaMarshaller.marshall() correctly returns the string "null". > I believe the problems is that XML.appendChild (as used in XMLEncoder.setValue) for some reason treats the string "null" differently. I have no idea why. > If you're curious as to why I think this is a bug, see this StackOverflow question: > http://stackoverflow.com/questions/4456438/how-can-i-pass-the-string-null-through-wsdl-soap-from-as3-to-coldfusion-web > Finally, see this fiddle for examples: > http://wonderfl.net/c/jYIm -- This message was sent by Atlassian JIRA (v6.1#6144)