eliminate circularities from package and reflection output
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/c11b36f2 Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/c11b36f2 Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/c11b36f2 Branch: refs/heads/feature-autobuild/maven-archetypes Commit: c11b36f279bef87445d2a6f60254ccc1fb94296d Parents: bdc4023 Author: Alex Harui <aha...@apache.org> Authored: Fri Sep 30 08:08:31 2016 -0700 Committer: Alex Harui <aha...@apache.org> Committed: Fri Sep 30 08:08:31 2016 -0700 ---------------------------------------------------------------------- .../codegen/js/jx/PackageFooterEmitter.java | 23 +++++++++++--------- .../codegen/js/jx/PackageHeaderEmitter.java | 6 ++--- .../flexjs/projects/overrides/Test_result.js | 2 -- .../projects/overrides/classes/A_result.js | 2 -- .../projects/overrides/interfaces/IA_result.js | 2 -- 5 files changed, 16 insertions(+), 19 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c11b36f2/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/PackageFooterEmitter.java ---------------------------------------------------------------------- diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/PackageFooterEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/PackageFooterEmitter.java index fc4b4de..7509699 100644 --- a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/PackageFooterEmitter.java +++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/PackageFooterEmitter.java @@ -34,6 +34,7 @@ import org.apache.flex.compiler.internal.codegen.js.JSSessionModel.BindableVarIn import org.apache.flex.compiler.internal.codegen.js.JSSessionModel.ImplicitBindableImplementation; import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter; import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSDocEmitter; +import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitter; import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitterTokens; import org.apache.flex.compiler.internal.codegen.js.utils.EmitterUtils; import org.apache.flex.compiler.internal.driver.js.goog.JSGoogConfiguration; @@ -245,6 +246,8 @@ public class PackageFooterEmitter extends JSSubEmitter implements public void collectReflectionData(ITypeNode tnode) { + JSFlexJSEmitter fjs = (JSFlexJSEmitter)getEmitter(); + varData = new ArrayList<VariableData>(); accessorData = new ArrayList<AccessorData>(); methodData = new ArrayList<MethodData>(); @@ -293,7 +296,7 @@ public class PackageFooterEmitter extends JSSubEmitter implements bindableAccessor.name = name; bindableAccessor.access = "readwrite"; bindableAccessor.type = bindableVars.get(name).type; - bindableAccessor.declaredBy = getEmitter().formatQualifiedName(tnode.getQualifiedName()); + bindableAccessor.declaredBy = fjs.formatQualifiedName(tnode.getQualifiedName(), true); bindableAccessor.isStatic = isStatic; //attribute the metadata from the var definition to the Bindable Accessor implementation if (metaData != null) @@ -313,7 +316,7 @@ public class PackageFooterEmitter extends JSSubEmitter implements data.name = name; data.isStatic = isStatic; String qualifiedTypeName = varNode.getVariableTypeNode().resolveType(getProject()).getQualifiedName(); - data.type = getEmitter().formatQualifiedName(qualifiedTypeName); + data.type = fjs.formatQualifiedName(qualifiedTypeName, true); if (metaData != null) { @@ -331,8 +334,8 @@ public class PackageFooterEmitter extends JSSubEmitter implements AccessorData staticEventDispatcher = new AccessorData(); staticEventDispatcher.name = BindableEmitter.STATIC_DISPATCHER_GETTER; staticEventDispatcher.access = "readonly"; - staticEventDispatcher.type = getEmitter().formatQualifiedName(BindableEmitter.DISPATCHER_CLASS_QNAME); - staticEventDispatcher.declaredBy = getEmitter().formatQualifiedName(tnode.getQualifiedName()); + staticEventDispatcher.type = fjs.formatQualifiedName(BindableEmitter.DISPATCHER_CLASS_QNAME, true); + staticEventDispatcher.declaredBy = fjs.formatQualifiedName(tnode.getQualifiedName(), true); staticEventDispatcher.isStatic = true; accessorData.add(staticEventDispatcher); } @@ -371,11 +374,11 @@ public class PackageFooterEmitter extends JSSubEmitter implements } else data.access = "readwrite"; } accessorMap.put(data.name, data); - data.type = getEmitter().formatQualifiedName(data.type); + data.type = fjs.formatQualifiedName(data.type, true); IClassNode declarer = (IClassNode)fnNode.getAncestorOfType(IClassNode.class); - String declarant = getEmitter().formatQualifiedName(tnode.getQualifiedName()); + String declarant = fjs.formatQualifiedName(tnode.getQualifiedName(), true); if (declarer != null) - declarant = getEmitter().formatQualifiedName(declarer.getQualifiedName()); + declarant = fjs.formatQualifiedName(declarer.getQualifiedName(), true); data.declaredBy = declarant; data.isStatic = isStatic; IMetaTagsNode metaData = fnNode.getMetaTags(); @@ -407,15 +410,15 @@ public class PackageFooterEmitter extends JSSubEmitter implements if (!(qualifiedTypeName.equals("") || qualifiedTypeName.equals("void"))) { qualifiedTypeName = fnNode.getReturnTypeNode().resolveType(getProject()).getQualifiedName(); } - data.type = getEmitter().formatQualifiedName(qualifiedTypeName); + data.type = fjs.formatQualifiedName(qualifiedTypeName, true); ITypeNode declarer; if (isInterface) declarer = (IInterfaceNode)fnNode.getAncestorOfType(IInterfaceNode.class); else declarer = (IClassNode)fnNode.getAncestorOfType(IClassNode.class); - String declarant = getEmitter().formatQualifiedName(tnode.getQualifiedName()); + String declarant = fjs.formatQualifiedName(tnode.getQualifiedName(), true); if (declarer != null) - declarant = getEmitter().formatQualifiedName(declarer.getQualifiedName()); + declarant = fjs.formatQualifiedName(declarer.getQualifiedName(), true); data.declaredBy = declarant; IMetaTagsNode metaData = fnNode.getMetaTags(); if (metaData != null) http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c11b36f2/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/PackageHeaderEmitter.java ---------------------------------------------------------------------- diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/PackageHeaderEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/PackageHeaderEmitter.java index 585ace8..56bfeb8 100644 --- a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/PackageHeaderEmitter.java +++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/PackageHeaderEmitter.java @@ -130,7 +130,7 @@ public class PackageHeaderEmitter extends JSSubEmitter implements write(JSGoogEmitterTokens.GOOG_PROVIDE); write(ASEmitterTokens.PAREN_OPEN); write(ASEmitterTokens.SINGLE_QUOTE); - write(getEmitter().formatQualifiedName(qname)); + write(((JSFlexJSEmitter)getEmitter()).formatQualifiedName(qname, true)); write(ASEmitterTokens.SINGLE_QUOTE); write(ASEmitterTokens.PAREN_CLOSE); writeNewline(ASEmitterTokens.SEMICOLON); @@ -315,7 +315,7 @@ public class PackageHeaderEmitter extends JSSubEmitter implements write(JSGoogEmitterTokens.GOOG_REQUIRE); write(ASEmitterTokens.PAREN_OPEN); write(ASEmitterTokens.SINGLE_QUOTE); - write(getEmitter().formatQualifiedName(imp)); + write(((JSFlexJSEmitter)getEmitter()).formatQualifiedName(imp, true)); write(ASEmitterTokens.SINGLE_QUOTE); write(ASEmitterTokens.PAREN_CLOSE); writeNewline(ASEmitterTokens.SEMICOLON); @@ -342,7 +342,7 @@ public class PackageHeaderEmitter extends JSSubEmitter implements write(JSGoogEmitterTokens.GOOG_REQUIRE); write(ASEmitterTokens.PAREN_OPEN); write(ASEmitterTokens.SINGLE_QUOTE); - write(getEmitter().formatQualifiedName(imp)); + write(((JSFlexJSEmitter)getEmitter()).formatQualifiedName(imp, true)); write(ASEmitterTokens.SINGLE_QUOTE); write(ASEmitterTokens.PAREN_CLOSE); writeNewline(ASEmitterTokens.SEMICOLON); http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c11b36f2/compiler-jx/src/test/resources/flexjs/projects/overrides/Test_result.js ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/flexjs/projects/overrides/Test_result.js b/compiler-jx/src/test/resources/flexjs/projects/overrides/Test_result.js index 2a1c92a..1ff92d3 100644 --- a/compiler-jx/src/test/resources/flexjs/projects/overrides/Test_result.js +++ b/compiler-jx/src/test/resources/flexjs/projects/overrides/Test_result.js @@ -22,8 +22,6 @@ goog.provide('Test'); goog.require('classes.A'); -goog.require('classes.C'); -goog.require('interfaces.IC'); http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c11b36f2/compiler-jx/src/test/resources/flexjs/projects/overrides/classes/A_result.js ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/flexjs/projects/overrides/classes/A_result.js b/compiler-jx/src/test/resources/flexjs/projects/overrides/classes/A_result.js index 0eea031..31cb53a 100644 --- a/compiler-jx/src/test/resources/flexjs/projects/overrides/classes/A_result.js +++ b/compiler-jx/src/test/resources/flexjs/projects/overrides/classes/A_result.js @@ -21,9 +21,7 @@ goog.provide('classes.A'); -goog.require('classes.B'); goog.require('interfaces.IA'); -goog.require('interfaces.IB'); http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c11b36f2/compiler-jx/src/test/resources/flexjs/projects/overrides/interfaces/IA_result.js ---------------------------------------------------------------------- diff --git a/compiler-jx/src/test/resources/flexjs/projects/overrides/interfaces/IA_result.js b/compiler-jx/src/test/resources/flexjs/projects/overrides/interfaces/IA_result.js index ec8a343..722bc2e 100644 --- a/compiler-jx/src/test/resources/flexjs/projects/overrides/interfaces/IA_result.js +++ b/compiler-jx/src/test/resources/flexjs/projects/overrides/interfaces/IA_result.js @@ -21,8 +21,6 @@ goog.provide('interfaces.IA'); -goog.require('classes.B'); -goog.require('interfaces.IB');