flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [35/50] git commit: [flex-falcon] [refs/heads/master] - report error instead of NPE if namespace isn't right
Date Mon, 26 Jun 2017 15:45:15 GMT
report error instead of NPE if namespace isn't right


Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/2f5a3751
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/2f5a3751
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/2f5a3751

Branch: refs/heads/master
Commit: 2f5a3751c54e0ef6d3dccd02de57941c0f0700c7
Parents: 3e8c099
Author: Alex Harui <aharui@apache.org>
Authored: Tue May 30 12:49:06 2017 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Tue May 30 12:49:49 2017 -0700

----------------------------------------------------------------------
 .../flex/compiler/internal/definitions/AccessorDefinition.java | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/2f5a3751/compiler/src/main/java/org/apache/flex/compiler/internal/definitions/AccessorDefinition.java
----------------------------------------------------------------------
diff --git a/compiler/src/main/java/org/apache/flex/compiler/internal/definitions/AccessorDefinition.java
b/compiler/src/main/java/org/apache/flex/compiler/internal/definitions/AccessorDefinition.java
index aadd143..575580e 100644
--- a/compiler/src/main/java/org/apache/flex/compiler/internal/definitions/AccessorDefinition.java
+++ b/compiler/src/main/java/org/apache/flex/compiler/internal/definitions/AccessorDefinition.java
@@ -31,6 +31,7 @@ import org.apache.flex.compiler.definitions.IInterfaceDefinition;
 import org.apache.flex.compiler.definitions.INamespaceDefinition;
 import org.apache.flex.compiler.definitions.IPackageDefinition;
 import org.apache.flex.compiler.definitions.ISetterDefinition;
+import org.apache.flex.compiler.problems.UnresolvedNamespaceProblem;
 import org.apache.flex.compiler.projects.ICompilerProject;
 import org.apache.flex.compiler.scopes.IDefinitionSet;
 import org.apache.flex.compiler.tree.as.IVariableNode;
@@ -163,6 +164,11 @@ public abstract class AccessorDefinition extends FunctionDefinition implements
I
                     {
                         INamespaceReference testDefRef = definition.getNamespaceReference();
                         INamespaceDefinition testNamespaceDef = testDefRef.resolveNamespaceReference(project);
+                        if (testNamespaceDef == null)
+                        {
+                        	project.getProblems().add(new UnresolvedNamespaceProblem(definition.getNode()));
+                        	return null;
+                        }
                         final boolean testBindable = ((NamespaceDefinition)testNamespaceDef).getAETNamespace().getName().equals(
                                 BindableHelper.bindableNamespaceDefinition.getAETNamespace().getName());
                         /* aharui: namespaces shouldn't have to match.  A subclass may only
override


Mime
View raw message