Return-Path: X-Original-To: apmail-incubator-flex-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-flex-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CC82AD245 for ; Mon, 17 Dec 2012 16:43:12 +0000 (UTC) Received: (qmail 24555 invoked by uid 500); 17 Dec 2012 16:43:12 -0000 Delivered-To: apmail-incubator-flex-dev-archive@incubator.apache.org Received: (qmail 24432 invoked by uid 500); 17 Dec 2012 16:43:11 -0000 Mailing-List: contact flex-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: flex-dev@incubator.apache.org Delivered-To: mailing list flex-dev@incubator.apache.org Received: (qmail 24415 invoked by uid 99); 17 Dec 2012 16:43:11 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Dec 2012 16:43:11 +0000 Date: Mon, 17 Dec 2012 16:43:11 +0000 (UTC) From: "Maxime Cowez (JIRA)" To: flex-dev@incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (FLEX-33311) Nullpointer in ConstraintLayout when executing Transition on content 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-33311?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Maxime Cowez updated FLEX-33311: -------------------------------- Attachment: SpecifiableListWrapperHorizontalSkin.mxml SpecifiableListWrapper.as Custom component and skin to recreate the error. > Nullpointer in ConstraintLayout when executing Transition on content > -------------------------------------------------------------------- > > Key: FLEX-33311 > URL: https://issues.apache.org/jira/browse/FLEX-33311 > Project: Apache Flex > Issue Type: Bug > Components: Spark: Layout, Transitions > Affects Versions: Apache Flex 4.8 (parity release) > Reporter: Maxime Cowez > Priority: Trivial > Attachments: SpecifiableListWrapper.as, SpecifiableListWrapperHorizontalSkin.mxml > > > In some very specific cases `ConstraintLayout` will throw a nullpointer error when a component inside it is playing a transition. I tried a few things and found out that: > - `parseConstraints()` creates a new `rowBaselines` Vector (or empties it if it exists) > - some other process calls `clearConstraintCache()` in the middle of the execution of `parseConstraints()`, setting `rowBaselines` back to `null` > - `parseConstraints()` calls `parseElementConstraints()` which tries to access elements in `rowBaselines` and throws a nullpointer error > I know very little about how Effects and Transitions work, so the "some other process" part is a bit of a mistery to me. > Here is some code to reproduce the error consistently. My apologies for the complexity, but I couldn't get a simpler example to trigger the error. > > > > > > > > > > > > > > > > > > > > > > As you may notice, the constraint columns and rows are a copy of those used in FormItemSkin. I left only the content columns necessary to trigger the error (yup, remove the `helpContentGroup` and the error's gone). SpecifiableListWrapper is a custom component which I will attach, along with the specific skin that has the Transition that triggers the error. > Workaround: subclass ConstraintLayout (or FormItemLayout), override `measure()`, put a try/cacth block around it and use this custom layout. > public class FormItemLayout extends spark.layouts.FormItemLayout { > override public function measure():void { > try { > super.measure(); > } > catch (e:Error) { } > } > } > Not exactly pretty but it works without apparent side effects. > Quick fix (but probably not the ideal solution): just test whether `rowBaselines` exists before trying to access it > > if (rowBaselines && rowBaselines[bIndex][1]) ... > instead of > if (rowBaselines[bIndex][1]) ... -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira