Repository: flex-falcon Updated Branches: refs/heads/develop 77e6353c8 -> 3cb605a9a
FLEX-35206 report error for bad mxmlcontent Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/3cb605a9 Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/3cb605a9 Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/3cb605a9 Branch: refs/heads/develop Commit: 3cb605a9acc25aab383fa797b0ef7cbd7529f62c Parents: 77e6353 Author: Alex Harui <[email protected]> Authored: Wed Dec 7 10:32:14 2016 -0800 Committer: Alex Harui <[email protected]> Committed: Wed Dec 7 10:32:14 2016 -0800 ---------------------------------------------------------------------- .../tree/mxml/MXMLClassReferenceNodeBase.java | 20 ++++++++++++++++---- .../problems/MXMLDuplicateChildTagProblem.java | 4 ++-- 2 files changed, 18 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/3cb605a9/compiler/src/main/java/org/apache/flex/compiler/internal/tree/mxml/MXMLClassReferenceNodeBase.java ---------------------------------------------------------------------- diff --git a/compiler/src/main/java/org/apache/flex/compiler/internal/tree/mxml/MXMLClassReferenceNodeBase.java b/compiler/src/main/java/org/apache/flex/compiler/internal/tree/mxml/MXMLClassReferenceNodeBase.java index fc8ed36..0de95b3 100644 --- a/compiler/src/main/java/org/apache/flex/compiler/internal/tree/mxml/MXMLClassReferenceNodeBase.java +++ b/compiler/src/main/java/org/apache/flex/compiler/internal/tree/mxml/MXMLClassReferenceNodeBase.java @@ -35,6 +35,7 @@ import org.apache.flex.compiler.definitions.IStyleDefinition; import org.apache.flex.compiler.definitions.IVariableDefinition; import org.apache.flex.compiler.internal.definitions.ClassDefinition; import org.apache.flex.compiler.internal.mxml.MXMLDialect; +import org.apache.flex.compiler.internal.mxml.MXMLTagData; import org.apache.flex.compiler.internal.projects.FlexProject; import org.apache.flex.compiler.internal.scopes.ASProjectScope; import org.apache.flex.compiler.internal.tree.as.NodeBase; @@ -469,11 +470,22 @@ abstract class MXMLClassReferenceNodeBase extends MXMLNodeBase implements IMXMLC // Handle child tags that are instance tags. IVariableDefinition defaultPropertyDefinition = getDefaultPropertyDefinition(builder); - if (defaultPropertyDefinition != null && !processedDefaultProperty) + if (defaultPropertyDefinition != null) { - // Since there is a default property and we haven't already processed it, - // assume this child instance tag is part of its value. - processDefaultPropertyContentUnit(builder, childTag, info); + if (processedDefaultProperty) + { + MXMLDuplicateChildTagProblem problem = new MXMLDuplicateChildTagProblem(childTag); + problem.childTag = defaultPropertyDefinition.getBaseName(); + problem.element = tag.getShortName(); + builder.addProblem(problem); + return ; + } + else + { + // Since there is a default property and we haven't already processed it, + // assume this child instance tag is part of its value. + processDefaultPropertyContentUnit(builder, childTag, info); + } } else { http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/3cb605a9/compiler/src/main/java/org/apache/flex/compiler/problems/MXMLDuplicateChildTagProblem.java ---------------------------------------------------------------------- diff --git a/compiler/src/main/java/org/apache/flex/compiler/problems/MXMLDuplicateChildTagProblem.java b/compiler/src/main/java/org/apache/flex/compiler/problems/MXMLDuplicateChildTagProblem.java index 2efba6f..b304e1a 100644 --- a/compiler/src/main/java/org/apache/flex/compiler/problems/MXMLDuplicateChildTagProblem.java +++ b/compiler/src/main/java/org/apache/flex/compiler/problems/MXMLDuplicateChildTagProblem.java @@ -38,7 +38,7 @@ public final class MXMLDuplicateChildTagProblem extends MXMLSemanticProblem element = tag.getParentTag().getName(); } - public final String childTag; + public String childTag; public final String childNamespace; - public final String element; + public String element; }
