Return-Path: X-Original-To: apmail-flex-commits-archive@www.apache.org Delivered-To: apmail-flex-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EFCAB18A5F for ; Thu, 22 Oct 2015 22:08:47 +0000 (UTC) Received: (qmail 3896 invoked by uid 500); 22 Oct 2015 22:08:47 -0000 Delivered-To: apmail-flex-commits-archive@flex.apache.org Received: (qmail 3860 invoked by uid 500); 22 Oct 2015 22:08:47 -0000 Mailing-List: contact commits-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 commits@flex.apache.org Received: (qmail 3852 invoked by uid 99); 22 Oct 2015 22:08:47 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Oct 2015 22:08:47 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 926C2E392F; Thu, 22 Oct 2015 22:08:47 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: joshtynjala@apache.org To: commits@flex.apache.org Date: Thu, 22 Oct 2015 22:08:47 -0000 Message-Id: <06a3924074fc480c8d194222d46e47b1@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/2] git commit: [flex-falcon] [refs/heads/develop] - LinkageChecker: fixed bug where isExternal() would return the wrong result if the externs member variable were non-null, but initExterns() had not finished adding values yet Repository: flex-falcon Updated Branches: refs/heads/develop f94011d6c -> 20a04c5be LinkageChecker: fixed bug where isExternal() would return the wrong result if the externs member variable were non-null, but initExterns() had not finished adding values yet Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/d0598b34 Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/d0598b34 Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/d0598b34 Branch: refs/heads/develop Commit: d0598b34713dc7e758cf395cba47b67e45bf272b Parents: afe290e Author: Josh Tynjala Authored: Thu Oct 22 15:08:14 2015 -0700 Committer: Josh Tynjala Committed: Thu Oct 22 15:08:14 2015 -0700 ---------------------------------------------------------------------- .../compiler/internal/targets/LinkageChecker.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/d0598b34/compiler/src/org/apache/flex/compiler/internal/targets/LinkageChecker.java ---------------------------------------------------------------------- diff --git a/compiler/src/org/apache/flex/compiler/internal/targets/LinkageChecker.java b/compiler/src/org/apache/flex/compiler/internal/targets/LinkageChecker.java index 686e503..596d425 100644 --- a/compiler/src/org/apache/flex/compiler/internal/targets/LinkageChecker.java +++ b/compiler/src/org/apache/flex/compiler/internal/targets/LinkageChecker.java @@ -95,10 +95,15 @@ public class LinkageChecker */ private void initExterns() throws InterruptedException { - externs = new HashSet(4096); + // using a temporary local variable instead of adding to the externs + // member variable directly. isExternal() checks if the member variable + // is null. since isExternal() may be called by multiple threads, we + // don't want to set the member variable before all externs are added, + // or the isExternal() method could return the wrong result + HashSet foundExterns = new HashSet(4096); // first add the user defined externals - externs.addAll(targetSettings.getExterns()); + foundExterns.addAll(targetSettings.getExterns()); // next add all of the symbols from external libraries IWorkspace w = project.getWorkspace(); @@ -127,13 +132,14 @@ public class LinkageChecker // the external library path. ICompilationUnit.UnitType type = unit.getCompilationUnitType(); if (type != UnitType.EMBED_UNIT) - externs.addAll(unit.getQualifiedNames()); + foundExterns.addAll(unit.getQualifiedNames()); } } // -includes-classes (compc only) is allow to override externs for // monkey patching. - externs.removeAll(targetSettings.getIncludeClasses()); + foundExterns.removeAll(targetSettings.getIncludeClasses()); + externs = foundExterns; } }