royale-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [royale-compiler] 02/02: fix the thread-safety
Date Mon, 23 Jul 2018 17:43:55 GMT
This is an automated email from the ASF dual-hosted git repository.

aharui pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git

commit 3b152192dcd83172f696d31d75c595b05bb0682f
Author: Alex Harui <aharui@apache.org>
AuthorDate: Mon Jul 23 10:43:43 2018 -0700

    fix the thread-safety
---
 .../compiler/internal/definitions/ClassDefinitionBase.java     | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/definitions/ClassDefinitionBase.java
b/compiler/src/main/java/org/apache/royale/compiler/internal/definitions/ClassDefinitionBase.java
index e61a283..fd595e7 100644
--- a/compiler/src/main/java/org/apache/royale/compiler/internal/definitions/ClassDefinitionBase.java
+++ b/compiler/src/main/java/org/apache/royale/compiler/internal/definitions/ClassDefinitionBase.java
@@ -435,7 +435,7 @@ public abstract class ClassDefinitionBase extends TypeDefinitionBase implements
 	        	{
 		        	if (baseDefinitions == null)
 		        	{
-		        		baseDefinitions = new ArrayList<IDefinition>();
+		        		ArrayList<IDefinition> bases = new ArrayList<IDefinition>();
 		        		
 			            // We're trying to determine whether this class
 			            // is derived from a specified class ('type').
@@ -444,8 +444,9 @@ public abstract class ClassDefinitionBase extends TypeDefinitionBase implements
 			            while (iter.hasNext())
 			            {
 			                IClassDefinition cls = iter.next();
-			                baseDefinitions.add(cls);
+			                bases.add(cls);
 			            }
+			            baseDefinitions = bases;
 		        	}
 	        	}
             	if ((CompilerDiagnosticsConstants.diagnostics & CompilerDiagnosticsConstants.CLASS_DEFINITION_BASE)
== CompilerDiagnosticsConstants.CLASS_DEFINITION_BASE)
@@ -463,7 +464,7 @@ public abstract class ClassDefinitionBase extends TypeDefinitionBase implements
 	        	{
 	            	if (implDefinitions == null)
 	            	{
-		        		implDefinitions = new ArrayList<IDefinition>();
+		        		ArrayList<IDefinition> impls = new ArrayList<IDefinition>();
 		        		
 			            // We're trying to determine whether this class
 			            // implements a specified interface ('type').
@@ -473,8 +474,9 @@ public abstract class ClassDefinitionBase extends TypeDefinitionBase implements
 			            while (iter.hasNext())
 			            {
 			                IInterfaceDefinition intf = iter.next();
-			                implDefinitions.add(intf);
+			                impls.add(intf);
 			            }
+			            implDefinitions = impls;
 	            	}
 	        	}
             	if ((CompilerDiagnosticsConstants.diagnostics & CompilerDiagnosticsConstants.CLASS_DEFINITION_BASE)
== CompilerDiagnosticsConstants.CLASS_DEFINITION_BASE)


Mime
View raw message