This is an automated email from the ASF dual-hosted git repository. aharui pushed a commit to branch feature/rename in repository https://gitbox.apache.org/repos/asf/royale-compiler.git
commit 87472e6ba89daea2a2ff7e58f08f1f88feceaa24 Author: Alex Harui <[email protected]> AuthorDate: Thu Nov 16 18:04:24 2017 -0800 no errors compiling swf compiler --- .../royale/compiler/config/Configurator.java | 27 ++------------ .../compiler/internal/config/TargetSettings.java | 22 +++++------ compiler-externc/build.xml | 24 +++++++++++- .../codegen/js/royale/JSRoyaleEmitter.java | 2 +- compiler/build.xml | 1 + .../definitions/references/IReferenceMName.java | 5 ++- .../internal/as/codegen/ABCGeneratingReducer.java | 5 ++- .../compiler/internal/as/codegen/ABCGenerator.java | 7 +++- .../as/codegen/MXMLClassDirectiveProcessor.java | 3 +- .../compiler/internal/caches/AssetTagCache.java | 3 +- .../compiler/internal/caches/CSSDocumentCache.java | 1 + .../compiler/internal/caches/FileScopeCache.java | 3 +- .../royale/compiler/internal/caches/SWFCache.java | 1 + .../compiler/internal/clients/CLIFactory.java | 2 +- .../internal/config/RoyaleTargetSettings.java | 8 +++- .../royale/compiler/internal/css/CSSManager.java | 6 +-- .../internal/definitions/DefinitionBase.java | 31 ++++++++-------- .../internal/definitions/NamespaceDefinition.java | 6 ++- .../definitions/references/BuiltinReference.java | 11 +++--- .../definitions/references/LexicalReference.java | 17 +++++---- .../definitions/references/NotATypeReference.java | 10 ++--- .../references/ParameterizedReference.java | 19 +++++----- .../references/ResolvedQualifiersReference.java | 13 ++++--- .../definitions/references/ResolvedReference.java | 10 ++--- .../compiler/internal/embedding/EmbedData.java | 7 +++- .../embedding/transcoders/ImageTranscoder.java | 2 +- .../embedding/transcoders/JPEGTranscoder.java | 2 +- .../embedding/transcoders/MovieTranscoder.java | 5 ++- .../embedding/transcoders/ScalableTranscoder.java | 2 +- .../embedding/transcoders/SkinTranscoder.java | 2 +- .../embedding/transcoders/TranscoderBase.java | 2 +- .../embedding/transcoders/XMLTranscoder.java | 2 +- .../internal/projects/CompilerProject.java | 5 +-- .../internal/projects/LibraryPathManager.java | 2 +- .../compiler/internal/projects/RoyaleProject.java | 9 +++-- .../projects/RoyaleProjectConfigurator.java | 43 +++++++++++++++++++--- .../internal/targets/RoyaleFrame1Info.java | 2 +- .../compiler/internal/tree/as/EmbedNode.java | 2 +- .../compiler/internal/tree/as/IdentifierNode.java | 3 +- .../internal/units/CompilationUnitBase.java | 2 +- .../internal/units/EmbedCompilationUnit.java | 19 ++++++---- .../units/ResourceBundleCompilationUnit.java | 6 ++- .../units/ResourceModuleCompilationUnit.java | 4 +- .../internal/units/SWCCompilationUnit.java | 12 +++--- .../internal/units/StyleModuleCompilationUnit.java | 4 +- .../units/requests/ABCBytesRequestResult.java | 8 ++-- .../units/requests/SWFTagsRequestResult.java | 9 +++-- ...edCouldNotDetermineSampleFrameCountProblem.java | 2 +- .../problems/EmbedScalingGridValueProblem.java | 2 +- .../problems/EmbedUnsupportedAttributeProblem.java | 2 +- .../EmbedUnsupportedSamplingRateProblem.java | 2 +- .../java/org/apache/royale/swc/SWCLibrary.java | 3 +- .../java/org/apache/royale/swc/SWCManager.java | 12 ++++-- 53 files changed, 245 insertions(+), 169 deletions(-) diff --git a/compiler-common/src/main/java/org/apache/royale/compiler/config/Configurator.java b/compiler-common/src/main/java/org/apache/royale/compiler/config/Configurator.java index 34bd165..e58f3ff 100644 --- a/compiler-common/src/main/java/org/apache/royale/compiler/config/Configurator.java +++ b/compiler-common/src/main/java/org/apache/royale/compiler/config/Configurator.java @@ -39,7 +39,6 @@ import org.apache.royale.compiler.internal.config.TargetSettings; import org.apache.royale.compiler.internal.config.localization.LocalizationManager; import org.apache.royale.compiler.internal.config.localization.ResourceBundleLocalizer; import org.apache.royale.compiler.mxml.IMXMLNamespaceMapping; -import org.apache.royale.compiler.problems.ANELibraryNotAllowedProblem; import org.apache.royale.compiler.problems.ConfigurationProblem; import org.apache.royale.compiler.problems.ICompilerProblem; import org.apache.royale.compiler.projects.ICompilerProject; @@ -262,7 +261,7 @@ public class Configurator implements ICompilerSettings, IConfigurator, ICompiler } private ConfigurationBuffer cfgbuf; - private Configuration configuration; + protected Configuration configuration; private Class<? extends Configuration> configurationClass; private Map<String, Object> args, more; @@ -279,11 +278,11 @@ public class Configurator implements ICompilerSettings, IConfigurator, ICompiler private boolean isConfigurationDirty; private boolean configurationSuccess; - private Collection<ICompilerProblem> configurationProblems; + protected Collection<ICompilerProblem> configurationProblems; private boolean extrasRequireDefaultVariable; private IPathResolver configurationPathResolver; - private ICompilerProject project; + protected ICompilerProject project; // // IConfigurator related methods @@ -534,26 +533,6 @@ public class Configurator implements ICompilerSettings, IConfigurator, ICompiler } /** - * Test if the SWC is explicitly on the external library path. - * - * @param library - * @param externalLibraryFiles - * @return true if the library is on the external library path, false otherwise. - */ - private boolean isOnExternalLibrayPath(ISWC library, List<File> externalLibraryFiles) - { - File aneFile = library.getSWCFile(); - - for (File file : externalLibraryFiles) - { - if (file.equals(aneFile)) - return true; - } - - return false; - } - - /** * Apply the follow source-path rules: * * 1. If source-path is empty, the target file's directory will be added to diff --git a/compiler-common/src/main/java/org/apache/royale/compiler/internal/config/TargetSettings.java b/compiler-common/src/main/java/org/apache/royale/compiler/internal/config/TargetSettings.java index e0c75ca..b5aff29 100644 --- a/compiler-common/src/main/java/org/apache/royale/compiler/internal/config/TargetSettings.java +++ b/compiler-common/src/main/java/org/apache/royale/compiler/internal/config/TargetSettings.java @@ -52,20 +52,20 @@ public class TargetSettings implements ITargetSettings this.project = project; } - private File output; - private File defaultCSS; + protected File output; + protected File defaultCSS; - private List<File> themes; - private Collection<File> externalLibraryPath; - private Collection<File> includeLibraries; - private List<RSLSettings> rslLibraryPath; - private Set<File> includeSources; - private Map<String, File> includeFiles; + protected List<File> themes; + protected Collection<File> externalLibraryPath; + protected Collection<File> includeLibraries; + protected List<RSLSettings> rslLibraryPath; + protected Set<File> includeSources; + protected Map<String, File> includeFiles; - private final Configuration configuration; - private final ICompilerProject project; + protected final Configuration configuration; + protected final ICompilerProject project; - private Set<String> externalLinkageLibraries; + protected Set<String> externalLinkageLibraries; /** * @return the accessible diff --git a/compiler-externc/build.xml b/compiler-externc/build.xml index 9e86c2e..7dee418 100644 --- a/compiler-externc/build.xml +++ b/compiler-externc/build.xml @@ -40,7 +40,9 @@ <pathconvert property="compiler-jx" dirsep="/"> <path location="${basedir}/../compiler-jx"/> </pathconvert> - + + <property name="sdk" value="${compiler-jx}/lib"/> + <!-- Properties can be overridden locally by loading a local.properties file --> <!-- Java 8 users probably need javadoc.params=-Xdoclint:none --> <property file="${compiler-externc}/local.properties"/> @@ -97,7 +99,7 @@ </target> --> - <target name="main" > + <target name="compile" > <mkdir dir="${compiler-externc}/target/classes"/> <javac debug="${javac.debug}" deprecation="${javac.deprecation}" destdir="${compiler-externc}/target/classes" includeAntRuntime="true" includes="**/*.java" source="${javac.src}" target="${javac.src}"> @@ -111,6 +113,24 @@ </javac> </target> + <target name="main" depends="compile" > + <mkdir dir="${sdk}"/> + <copy file="${basedir}/../LICENSE.base" tofile="${compiler-externc}/target/classes/META-INF/LICENSE"/> + <copy file="${basedir}/../NOTICE.base" tofile="${compiler-externc}/target/classes/META-INF/NOTICE"/> + <jar file="${sdk}/externc.jar" basedir="${compiler-externc}/target/classes" includes="**/*.properties,org/apache/**/*,META-INF/**/*"> + <include name="META-INF/LICENSE"/> + <include name="META-INF/NOTICE"/> + <manifest> + <attribute name="Sealed" value="${manifest.sealed}"/> + <attribute name="Implementation-Title" value="${manifest.Implementation-Title}"/> + <attribute name="Implementation-Version" value="${manifest.Implementation-Version}.${build.number}"/> + <attribute name="Implementation-Vendor" value="${manifest.Implementation-Vendor}"/> + <attribute name="Class-Path" value="external/commons-cli.jar external/commons-io.jar external/guava.jar google/closure-compiler/compiler.jar ../../compiler/lib/compiler-common.jar ../../lib/compiler-common.jar .."/> + <!-- The .. in the line above allows the compiler to load the env.properties file --> + </manifest> + </jar> + </target> + <!-- CLEANUP diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/royale/JSRoyaleEmitter.java b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/royale/JSRoyaleEmitter.java index 4769d3b..1d199fa 100644 --- a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/royale/JSRoyaleEmitter.java +++ b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/royale/JSRoyaleEmitter.java @@ -37,6 +37,7 @@ import org.apache.royale.compiler.definitions.INamespaceDefinition; import org.apache.royale.compiler.definitions.IPackageDefinition; import org.apache.royale.compiler.definitions.ITypeDefinition; import org.apache.royale.compiler.definitions.metadata.IMetaTagAttribute; +import org.apache.royale.compiler.embedding.EmbedAttribute; import org.apache.royale.compiler.internal.codegen.as.ASEmitterTokens; import org.apache.royale.compiler.internal.codegen.js.JSSessionModel.ImplicitBindableImplementation; import org.apache.royale.compiler.internal.codegen.js.goog.JSGoogEmitter; @@ -65,7 +66,6 @@ import org.apache.royale.compiler.internal.codegen.js.utils.EmitterUtils; import org.apache.royale.compiler.internal.codegen.mxml.royale.MXMLRoyaleEmitter; import org.apache.royale.compiler.internal.definitions.AccessorDefinition; import org.apache.royale.compiler.internal.definitions.FunctionDefinition; -import org.apache.royale.compiler.internal.embedding.EmbedAttribute; import org.apache.royale.compiler.internal.embedding.EmbedData; import org.apache.royale.compiler.internal.embedding.EmbedMIMEType; import org.apache.royale.compiler.internal.projects.CompilerProject; diff --git a/compiler/build.xml b/compiler/build.xml index 86c084f..d4a729d 100644 --- a/compiler/build.xml +++ b/compiler/build.xml @@ -77,6 +77,7 @@ <path id="classpath"> <fileset dir="${compiler}/lib/external" includes="**/*.jar"/> + <fileset dir="${compiler}/lib" includes="compiler-common.jar"/> <fileset dir="${compiler}/../compiler-build-tools/target/classes" includes="**/*.class"/> </path> diff --git a/compiler/src/main/java/org/apache/royale/compiler/definitions/references/IReferenceMName.java b/compiler/src/main/java/org/apache/royale/compiler/definitions/references/IReferenceMName.java index 0d25fc4..db335b3 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/definitions/references/IReferenceMName.java +++ b/compiler/src/main/java/org/apache/royale/compiler/definitions/references/IReferenceMName.java @@ -20,7 +20,8 @@ package org.apache.royale.compiler.definitions.references; import org.apache.royale.abc.semantics.Name; -import org.apache.royale.compiler.internal.scopes.ASScope; +import org.apache.royale.compiler.scopes.IASScope; +import org.apache.royale.compiler.projects.ICompilerProject; /** * An <code>IReferenceMName</code> is for IReferences that have MNames @@ -35,5 +36,5 @@ public interface IReferenceMName extends IReference * @param scope The scope where the reference is used from. * @return An AET {@link Name} representing this reference */ - Name getMName(ICompilerProject project, ASScope scope); + Name getMName(ICompilerProject project, IASScope scope); } diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/as/codegen/ABCGeneratingReducer.java b/compiler/src/main/java/org/apache/royale/compiler/internal/as/codegen/ABCGeneratingReducer.java index 8a75b10..2d5e5e6 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/as/codegen/ABCGeneratingReducer.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/as/codegen/ABCGeneratingReducer.java @@ -46,6 +46,7 @@ import org.apache.royale.compiler.definitions.IConstantDefinition; import org.apache.royale.compiler.definitions.IDefinition; import org.apache.royale.compiler.definitions.ITypeDefinition; import org.apache.royale.compiler.definitions.IVariableDefinition; +import org.apache.royale.compiler.definitions.references.INamespaceResolvedReference; import org.apache.royale.compiler.exceptions.CodegenInterruptedException; import org.apache.royale.compiler.exceptions.DuplicateLabelException; import org.apache.royale.compiler.exceptions.UnknownControlFlowTargetException; @@ -3503,8 +3504,8 @@ public class ABCGeneratingReducer result.addAll(index); // The namespace is ignored by AVM. We choose to use the default // namespace at the current scope. - final Namespace ns = NamespaceDefinition - .getDefaultNamespaceDefinition(currentScope.getLocalASScope()) + final Namespace ns = ((INamespaceResolvedReference)NamespaceDefinition + .getDefaultNamespaceDefinition(currentScope.getLocalASScope())) .resolveAETNamespace(currentScope.getProject()); final Name multinameLA = new Name( CONSTANT_MultinameLA, diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/as/codegen/ABCGenerator.java b/compiler/src/main/java/org/apache/royale/compiler/internal/as/codegen/ABCGenerator.java index 6433730..3530fcb 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/as/codegen/ABCGenerator.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/as/codegen/ABCGenerator.java @@ -24,6 +24,7 @@ import static org.apache.royale.abc.ABCConstants.*; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; +import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.Map; @@ -43,6 +44,7 @@ import org.apache.royale.abc.visitors.IMethodBodyVisitor; import org.apache.royale.abc.visitors.IMethodVisitor; import org.apache.royale.abc.visitors.IScriptVisitor; import org.apache.royale.abc.visitors.IVisitor; +import org.apache.royale.compiler.embedding.IEmbedData; import org.apache.royale.compiler.exceptions.BURMAbortException; import org.apache.royale.compiler.exceptions.CodegenInterruptedException; import org.apache.royale.compiler.exceptions.MissingBuiltinException; @@ -179,8 +181,11 @@ public class ABCGenerator implements ICodeGenerator Set<EmbedData> embeds = global_scope.getEmbeds(); EmbedCompilationUnitFactory.collectEmbedDatas(project, (IFileNodeAccumulator)root_node, embeds, global_scope.getProblems()); + Set<IEmbedData> iembeds = new HashSet<IEmbedData>(); + for (EmbedData embed : embeds) + iembeds.add(embed); ICompilerProblem[] problemsArray = global_scope.getProblems().toArray(IABCBytesRequestResult.ZEROPROBLEMS); - return new ABCBytesRequestResult(generatedBytes, problemsArray, embeds); + return new ABCBytesRequestResult(generatedBytes, problemsArray, iembeds); } /** diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/as/codegen/MXMLClassDirectiveProcessor.java b/compiler/src/main/java/org/apache/royale/compiler/internal/as/codegen/MXMLClassDirectiveProcessor.java index 66a4e21..700ec29 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/as/codegen/MXMLClassDirectiveProcessor.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/as/codegen/MXMLClassDirectiveProcessor.java @@ -133,6 +133,7 @@ import org.apache.royale.compiler.definitions.IClassDefinition; import org.apache.royale.compiler.definitions.IDefinition; import org.apache.royale.compiler.definitions.ITypeDefinition; import org.apache.royale.compiler.definitions.references.IReference; +import org.apache.royale.compiler.definitions.references.IReferenceMName; import org.apache.royale.compiler.definitions.references.IResolvedQualifiersReference; import org.apache.royale.compiler.definitions.references.ReferenceFactory; import org.apache.royale.compiler.exceptions.CodegenInterruptedException; @@ -373,7 +374,7 @@ public class MXMLClassDirectiveProcessor extends ClassDirectiveProcessor // This type was stored in the EventDefinition // that the MXMLEventSpecifierNode refers to. EventDefinition eventDefinition = (EventDefinition)eventNode.getDefinition(); - Name eventTypeName = eventDefinition.getTypeReference().getMName( + Name eventTypeName = ((IReferenceMName)eventDefinition.getTypeReference()).getMName( project, (ASScope)eventDefinition.getContainingScope()); Vector<Name> paramTypes = new Vector<Name>(); paramTypes.add(eventTypeName); diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/caches/AssetTagCache.java b/compiler/src/main/java/org/apache/royale/compiler/internal/caches/AssetTagCache.java index 5fc66a4..8022db6 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/caches/AssetTagCache.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/caches/AssetTagCache.java @@ -22,6 +22,7 @@ package org.apache.royale.compiler.internal.caches; import java.util.Collection; import java.util.LinkedList; +import org.apache.royale.compiler.caches.IAssetTagCache; import org.apache.royale.swc.ISWC; import org.apache.royale.swc.ISWCScript; import org.apache.royale.swc.SWCManager; @@ -142,7 +143,7 @@ public class AssetTagCache extends ConcurrentCacheStoreBase<AssetTagCache.AssetT throw new IllegalArgumentException("expect AssetTagCacheKey but got " + key.getClass().getSimpleName()); final AssetTagCacheKey assetTagCacheKey = (AssetTagCacheKey)key; - final ITagContainer tagContainer = swcManager.getSWFCache().get(SWFCache.createKey(assetTagCacheKey.swc, assetTagCacheKey.swfPath)); + final ITagContainer tagContainer = ((SWFCache)swcManager.getSWFCache()).get(SWFCache.createKey(assetTagCacheKey.swc, assetTagCacheKey.swfPath)); final SymbolClassTag symbolClassTag = getSymbolClass(tagContainer); if (symbolClassTag == null) return new AssetTagCacheValue(null); diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/caches/CSSDocumentCache.java b/compiler/src/main/java/org/apache/royale/compiler/internal/caches/CSSDocumentCache.java index 8d3f9ce..10c7cd4 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/caches/CSSDocumentCache.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/caches/CSSDocumentCache.java @@ -30,6 +30,7 @@ import org.antlr.runtime.ANTLRFileStream; import org.antlr.runtime.ANTLRInputStream; import org.apache.commons.io.IOUtils; +import org.apache.royale.compiler.caches.ICSSDocumentCache; import org.apache.royale.compiler.config.Configuration; import org.apache.royale.compiler.css.ICSSDocument; import org.apache.royale.compiler.css.ICSSFontFace; diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/caches/FileScopeCache.java b/compiler/src/main/java/org/apache/royale/compiler/internal/caches/FileScopeCache.java index a7b1381..8b447a0 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/caches/FileScopeCache.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/caches/FileScopeCache.java @@ -23,6 +23,7 @@ import java.io.IOException; import java.lang.ref.SoftReference; import java.util.Collection; +import org.apache.royale.compiler.caches.IFileScopeCache; import org.apache.royale.compiler.internal.abc.ABCScopeBuilder; import org.apache.royale.compiler.internal.scopes.ASFileScope; import org.apache.royale.compiler.internal.scopes.SWCFileScopeProvider; @@ -103,7 +104,7 @@ public class FileScopeCache extends ConcurrentCacheStoreBase<Collection<IASScope final FileScopeCacheKey fileScopeCacheKey = (FileScopeCacheKey)key; final CacheStoreKeyBase swfCacheKey = SWFCache.createKey(fileScopeCacheKey.swc, fileScopeCacheKey.swfPath); - final ITagContainer tags = swcManager.getSWFCache().get(swfCacheKey); + final ITagContainer tags = ((SWFCache)swcManager.getSWFCache()).get(swfCacheKey); final DoABCTag abcTag = SWFCache.findDoABCTagByName(tags, fileScopeCacheKey.scriptName); if (abcTag != null) diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/caches/SWFCache.java b/compiler/src/main/java/org/apache/royale/compiler/internal/caches/SWFCache.java index 4e173e6..7325ff7 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/caches/SWFCache.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/caches/SWFCache.java @@ -29,6 +29,7 @@ import java.util.Collection; import java.util.List; import java.util.zip.ZipFile; +import org.apache.royale.compiler.caches.ISWFCache; import org.apache.royale.compiler.problems.FileInLibraryNotFoundProblem; import org.apache.royale.swc.ISWC; import org.apache.royale.swc.SWC; diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/clients/CLIFactory.java b/compiler/src/main/java/org/apache/royale/compiler/internal/clients/CLIFactory.java index 3057f7e..48cad1b 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/clients/CLIFactory.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/clients/CLIFactory.java @@ -48,7 +48,7 @@ public class CLIFactory * * @return Apache Common CLI options */ - @SuppressWarnings("static-access") + @SuppressWarnings("static") public static Options getOptionsForASC() { if (ascOptions != null) diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/config/RoyaleTargetSettings.java b/compiler/src/main/java/org/apache/royale/compiler/internal/config/RoyaleTargetSettings.java index e1d9311..e3d966c 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/config/RoyaleTargetSettings.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/config/RoyaleTargetSettings.java @@ -35,6 +35,7 @@ import org.apache.royale.compiler.config.Configurator; import org.apache.royale.compiler.config.RSLSettings; import org.apache.royale.compiler.internal.projects.LibraryPathManager; import org.apache.royale.compiler.projects.ICompilerProject; +import org.apache.royale.compiler.projects.IRoyaleProject; import org.apache.royale.compiler.targets.ITargetSettings; import org.apache.royale.utils.FilenameNormalization; import com.google.common.collect.ImmutableList; @@ -47,6 +48,11 @@ import com.google.common.collect.ImmutableList; */ public class RoyaleTargetSettings extends TargetSettings { + public RoyaleTargetSettings(Configuration configuration, ICompilerProject project) + { + super(configuration, project); + } + /** * @return the externalLibraryPath */ @@ -55,7 +61,7 @@ public class RoyaleTargetSettings extends TargetSettings { if (externalLibraryPath == null) { - List<File> files = Configurator.toFileList(project != null ? project.getCompilerExternalLibraryPath(configuration) : + List<File> files = Configurator.toFileList(project != null ? ((IRoyaleProject)project).getCompilerExternalLibraryPath(configuration) : configuration.getCompilerExternalLibraryPath()); Set<File> expandedFiles = LibraryPathManager.discoverSWCFilePathsAsFiles(files.toArray(new File[files.size()])); diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/css/CSSManager.java b/compiler/src/main/java/org/apache/royale/compiler/internal/css/CSSManager.java index d7c5c1c..a454e19 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/css/CSSManager.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/css/CSSManager.java @@ -177,7 +177,7 @@ public class CSSManager implements ICSSManager public ICSSDocument getDefaultCSS(final File swcFile) { final ISWCManager swcManager = royaleProject.getWorkspace().getSWCManager(); - final CSSDocumentCache cache = swcManager.getCSSDocumentCache(); + final CSSDocumentCache cache = (CSSDocumentCache)swcManager.getCSSDocumentCache(); final ISWC swc = swcManager.get(swcFile); return cache.getDefaultsCSS(swc, royaleProject.getCompatibilityVersion()); } @@ -231,7 +231,7 @@ public class CSSManager implements ICSSManager { final ImmutableList.Builder<ICSSDocument> builder = new ImmutableList.Builder<ICSSDocument>(); final ISWCManager swcManager = royaleProject.getWorkspace().getSWCManager(); - final CSSDocumentCache cssCache = swcManager.getCSSDocumentCache(); + final CSSDocumentCache cssCache = (CSSDocumentCache)swcManager.getCSSDocumentCache(); for (final IFileSpecification themeFile : royaleProject.getThemeFiles()) { try @@ -283,7 +283,7 @@ public class CSSManager implements ICSSManager @Override public ICSSDocument getCSS(String cssFilename) { - final CSSDocumentCache cache = royaleProject.getWorkspace().getSWCManager().getCSSDocumentCache(); + final CSSDocumentCache cache = (CSSDocumentCache)royaleProject.getWorkspace().getSWCManager().getCSSDocumentCache(); final CacheStoreKeyBase key = CSSDocumentCache.createKey(cssFilename); final ICSSDocument css = cache.get(key); diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/definitions/DefinitionBase.java b/compiler/src/main/java/org/apache/royale/compiler/internal/definitions/DefinitionBase.java index ab085a0..61fb92a 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/definitions/DefinitionBase.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/definitions/DefinitionBase.java @@ -50,6 +50,7 @@ import org.apache.royale.compiler.definitions.metadata.IDeprecationInfo; import org.apache.royale.compiler.definitions.metadata.IMetaTag; import org.apache.royale.compiler.definitions.metadata.IMetaTagAttribute; import org.apache.royale.compiler.definitions.references.INamespaceReference; +import org.apache.royale.compiler.definitions.references.INamespaceResolvedReference; import org.apache.royale.compiler.definitions.references.IReference; import org.apache.royale.compiler.filespecs.IFileSpecification; import org.apache.royale.compiler.internal.common.Counter; @@ -143,7 +144,7 @@ public abstract class DefinitionBase implements IDocumentableDefinition, IDefini // "internal" is implied; therefore this field will be a reference to the internal // namespace for the package containing the class. However, some types of definitions, // such as a for a function parameter, do have a null namespace reference. - private INamespaceReference namespaceReference; + private INamespaceResolvedReference namespaceReference; // The name stored for this definition. See getStorageName() for details. private final String storageName; @@ -807,7 +808,7 @@ public abstract class DefinitionBase implements IDocumentableDefinition, IDefini public void setNamespaceReference(INamespaceReference value) { - namespaceReference = value; + namespaceReference = (INamespaceResolvedReference)value; NamespaceDefinition.setContainingDefinitionOfReference(value, this); } @@ -1450,12 +1451,12 @@ public abstract class DefinitionBase implements IDocumentableDefinition, IDefini * in DefinitionBase because it is common to VariableDefinition, * GetterDefinition, and SetterDefinition. */ - public String getArrayElementType(RoyaleProject project) + public String getArrayElementType(ICompilerProject project) { if (getTypeAsDisplayString().equals(IASLanguageConstants.Array)) { return getPropertyMetaTagValue( - project, IMetaAttributeConstants.ATTRIBUTE_ARRAYELEMENTTYPE); + (RoyaleProject)project, IMetaAttributeConstants.ATTRIBUTE_ARRAYELEMENTTYPE); } return null; @@ -1468,12 +1469,12 @@ public abstract class DefinitionBase implements IDocumentableDefinition, IDefini * This method is in DefinitionBase because it is common to * VariableDefinition, GetterDefinition, and SetterDefinition. */ - public String getInstanceType(RoyaleProject project) + public String getInstanceType(ICompilerProject project) { - if (getTypeAsDisplayString().equals(project.getDeferredInstanceInterface())) + if (getTypeAsDisplayString().equals(((RoyaleProject)project).getDeferredInstanceInterface())) { return getPropertyMetaTagValue( - project, IMetaAttributeConstants.ATTRIBUTE_INSTANCETYPE); + (RoyaleProject)project, IMetaAttributeConstants.ATTRIBUTE_INSTANCETYPE); } return null; @@ -1485,10 +1486,10 @@ public abstract class DefinitionBase implements IDocumentableDefinition, IDefini * DefinitionBase because it is common to VariableDefinition, * GetterDefinition, and SetterDefinition. */ - public String getPercentProxy(RoyaleProject project) + public String getPercentProxy(ICompilerProject project) { IMetaTag metaTag = getPropertyMetaTag( - project, IMetaAttributeConstants.ATTRIBUTE_PERCENT_PROXY); + (RoyaleProject)project, IMetaAttributeConstants.ATTRIBUTE_PERCENT_PROXY); return metaTag != null ? metaTag.getValue() : null; } @@ -1500,10 +1501,10 @@ public abstract class DefinitionBase implements IDocumentableDefinition, IDefini * This method is in DefinitionBase because it is common to * VariableDefinition, GetterDefinition, and SetterDefinition. */ - public boolean hasRichTextContent(RoyaleProject project) + public boolean hasRichTextContent(ICompilerProject project) { IMetaTag metaTag = getPropertyMetaTag( - project, IMetaAttributeConstants.ATTRIBUTE_RICHTEXTCONTENT); + (RoyaleProject)project, IMetaAttributeConstants.ATTRIBUTE_RICHTEXTCONTENT); return metaTag != null; } @@ -1515,10 +1516,10 @@ public abstract class DefinitionBase implements IDocumentableDefinition, IDefini * This method is in DefinitionBase because it is common to * VariableDefinition, GetterDefinition, and SetterDefinition. */ - public boolean hasCollapseWhiteSpace(RoyaleProject project) + public boolean hasCollapseWhiteSpace(ICompilerProject project) { IMetaTag metaTag = getPropertyMetaTag( - project, IMetaAttributeConstants.ATTRIBUTE_COLLAPSEWHITESPACE); + (RoyaleProject)project, IMetaAttributeConstants.ATTRIBUTE_COLLAPSEWHITESPACE); return metaTag != null; } @@ -1531,10 +1532,10 @@ public abstract class DefinitionBase implements IDocumentableDefinition, IDefini * This method is in DefinitionBase because it is common to * VariableDefinition, GetterDefinition, and SetterDefinition. */ - public boolean isColor(RoyaleProject project) + public boolean isColor(ICompilerProject project) { IMetaTag metaTag = getPropertyMetaTag( - project, IMetaAttributeConstants.ATTRIBUTE_INSPECTABLE); + (RoyaleProject)project, IMetaAttributeConstants.ATTRIBUTE_INSPECTABLE); if (metaTag == null) return false; diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/definitions/NamespaceDefinition.java b/compiler/src/main/java/org/apache/royale/compiler/internal/definitions/NamespaceDefinition.java index ea0bba4..fc1fd10 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/definitions/NamespaceDefinition.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/definitions/NamespaceDefinition.java @@ -46,6 +46,8 @@ import org.apache.royale.compiler.definitions.IDefinition; import org.apache.royale.compiler.definitions.IFunctionDefinition; import org.apache.royale.compiler.definitions.INamespaceDefinition; import org.apache.royale.compiler.definitions.IPackageDefinition; +import org.apache.royale.compiler.definitions.references.INamespaceReference; +import org.apache.royale.compiler.definitions.references.INamespaceResolvedReference; import org.apache.royale.compiler.filespecs.IFileSpecification; import org.apache.royale.compiler.internal.projects.CompilerProject; import org.apache.royale.compiler.internal.scopes.ASFileScope; @@ -72,7 +74,7 @@ import org.apache.royale.utils.StringEncoder; * After a namespace definition is in the symbol table, it should always be * accessed through the read-only <code>INamespaceDefinition</code> interface. */ -public abstract class NamespaceDefinition extends DefinitionBase implements INamespaceDefinition, INamespaceReference +public abstract class NamespaceDefinition extends DefinitionBase implements INamespaceDefinition, INamespaceResolvedReference { private static PublicNamespaceDefinition PUBLIC = new PublicNamespaceDefinition(); private static UserDefinedNamespaceDefinition AS3 = new UserDefinedNamespaceDefinition(INamespaceConstants.AS3, INamespaceConstants.AS3URI); @@ -1481,7 +1483,7 @@ public abstract class NamespaceDefinition extends DefinitionBase implements INam } } - private static class UserDefinedNamespaceReference implements INamespaceReference + private static class UserDefinedNamespaceReference implements INamespaceResolvedReference { private static INamespaceReference getQualifierNamespaceIfExists(ASScope scope, INamespaceDecorationNode node) { diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/definitions/references/BuiltinReference.java b/compiler/src/main/java/org/apache/royale/compiler/internal/definitions/references/BuiltinReference.java index a713721..96422f9 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/definitions/references/BuiltinReference.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/definitions/references/BuiltinReference.java @@ -23,9 +23,10 @@ import org.apache.royale.abc.semantics.Name; import org.apache.royale.compiler.common.DependencyType; import org.apache.royale.compiler.constants.IASLanguageConstants; import org.apache.royale.compiler.definitions.IDefinition; -import org.apache.royale.compiler.definitions.references.IReference; +import org.apache.royale.compiler.definitions.references.IReferenceMName; import org.apache.royale.compiler.internal.definitions.DefinitionBase; import org.apache.royale.compiler.internal.scopes.ASScope; +import org.apache.royale.compiler.scopes.IASScope; import org.apache.royale.compiler.projects.ICompilerProject; /** @@ -37,7 +38,7 @@ import org.apache.royale.compiler.projects.ICompilerProject; * which should be the global <code>Function</code> type, and not some * <code>Function</code> type defined in some other random namespace. */ -public class BuiltinReference implements IReference +public class BuiltinReference implements IReferenceMName { /** * Constructor. @@ -56,13 +57,13 @@ public class BuiltinReference implements IReference } @Override - public IDefinition resolve(ICompilerProject project, ASScope scope, + public IDefinition resolve(ICompilerProject project, IASScope scope, DependencyType dependencyType, boolean canEscapeWith) { IDefinition definition = project.getBuiltinType(builtinType); - scope.addDependencyOnBuiltinType(project, builtinType, dependencyType); + ((ASScope)scope).addDependencyOnBuiltinType(project, builtinType, dependencyType); return definition; } @@ -74,7 +75,7 @@ public class BuiltinReference implements IReference } @Override - public Name getMName(ICompilerProject project, ASScope scope) + public Name getMName(ICompilerProject project, IASScope scope) { IDefinition def = project.getBuiltinType(builtinType); if (def == null) diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/definitions/references/LexicalReference.java b/compiler/src/main/java/org/apache/royale/compiler/internal/definitions/references/LexicalReference.java index a47fa1f..92f1281 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/definitions/references/LexicalReference.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/definitions/references/LexicalReference.java @@ -25,10 +25,11 @@ import org.apache.royale.abc.semantics.Nsset; import org.apache.royale.compiler.common.DependencyType; import org.apache.royale.compiler.definitions.IDefinition; import org.apache.royale.compiler.definitions.INamespaceDefinition; -import org.apache.royale.compiler.definitions.references.IReference; +import org.apache.royale.compiler.definitions.references.IReferenceMName; import org.apache.royale.compiler.internal.definitions.NamespaceDefinition; import org.apache.royale.compiler.internal.scopes.ASScope; import org.apache.royale.compiler.projects.ICompilerProject; +import org.apache.royale.compiler.scopes.IASScope; import java.util.ArrayList; import java.util.Set; @@ -40,7 +41,7 @@ import static org.apache.royale.abc.ABCConstants.CONSTANT_Multiname; * reference from a source file such as the type annotation in * <code>var x:String</code>. */ -public class LexicalReference implements IReference +public class LexicalReference implements IReferenceMName { /** * Constructor. @@ -58,17 +59,17 @@ public class LexicalReference implements IReference return name; } - public Set<INamespaceDefinition> getNamespaceSet(ICompilerProject project, ASScope scope) + public Set<INamespaceDefinition> getNamespaceSet(ICompilerProject project, IASScope scope) { - return scope.getNamespaceSetForName(project, getName()); + return ((ASScope)scope).getNamespaceSetForName(project, getName()); } @Override - public IDefinition resolve(ICompilerProject project, ASScope scope, + public IDefinition resolve(ICompilerProject project, IASScope scope, DependencyType depencencyType, boolean canEscapeWith) { - return scope.findProperty(project, getName(), depencencyType, canEscapeWith); + return ((ASScope)scope).findProperty(project, getName(), depencencyType, canEscapeWith); } @Override @@ -78,10 +79,10 @@ public class LexicalReference implements IReference } @Override - public Name getMName(ICompilerProject project, ASScope scope) + public Name getMName(ICompilerProject project, IASScope scope) { Name n = null; - Set<INamespaceDefinition> namespaceSet = scope.getNamespaceSetForName(project, name); + Set<INamespaceDefinition> namespaceSet = ((ASScope)scope).getNamespaceSetForName(project, name); ArrayList<Namespace> ns_set = new ArrayList<Namespace>(namespaceSet.size()); for (INamespaceDefinition namespace : namespaceSet) diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/definitions/references/NotATypeReference.java b/compiler/src/main/java/org/apache/royale/compiler/internal/definitions/references/NotATypeReference.java index c619374..223016c 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/definitions/references/NotATypeReference.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/definitions/references/NotATypeReference.java @@ -22,8 +22,8 @@ package org.apache.royale.compiler.internal.definitions.references; import org.apache.royale.abc.semantics.Name; import org.apache.royale.compiler.common.DependencyType; import org.apache.royale.compiler.definitions.IDefinition; -import org.apache.royale.compiler.definitions.references.IReference; -import org.apache.royale.compiler.internal.scopes.ASScope; +import org.apache.royale.compiler.definitions.references.IReferenceMName; +import org.apache.royale.compiler.scopes.IASScope; import org.apache.royale.compiler.projects.ICompilerProject; /** @@ -42,7 +42,7 @@ import org.apache.royale.compiler.projects.ICompilerProject; * something was specified for the base class so we can report the correct error * when we try and resolve it. */ -public class NotATypeReference implements IReference +public class NotATypeReference implements IReferenceMName { /** * Constructor. @@ -61,7 +61,7 @@ public class NotATypeReference implements IReference } @Override - public IDefinition resolve(ICompilerProject project, ASScope scope, + public IDefinition resolve(ICompilerProject project, IASScope scope, DependencyType dependencyType, boolean canEscapeWith) { @@ -75,7 +75,7 @@ public class NotATypeReference implements IReference } @Override - public Name getMName(ICompilerProject project, ASScope scope) + public Name getMName(ICompilerProject project, IASScope scope) { return null; } diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/definitions/references/ParameterizedReference.java b/compiler/src/main/java/org/apache/royale/compiler/internal/definitions/references/ParameterizedReference.java index c8dbd42..9082269 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/definitions/references/ParameterizedReference.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/definitions/references/ParameterizedReference.java @@ -26,27 +26,28 @@ import org.apache.royale.compiler.definitions.AppliedVectorDefinitionFactory; import org.apache.royale.compiler.definitions.IDefinition; import org.apache.royale.compiler.definitions.ITypeDefinition; import org.apache.royale.compiler.definitions.references.IReference; -import org.apache.royale.compiler.internal.scopes.ASScope; +import org.apache.royale.compiler.definitions.references.IReferenceMName; +import org.apache.royale.compiler.scopes.IASScope; import org.apache.royale.compiler.projects.ICompilerProject; /** - * Implementation of {@link IReference} representing a parameterized type, such + * Implementation of {@link IReferenceMName} representing a parameterized type, such * as {@code Vector.<Foo>}. */ -public class ParameterizedReference implements IReference +public class ParameterizedReference implements IReferenceMName { /** * Constructor. */ public ParameterizedReference(IReference name, IReference param) { - this.name = name; - this.param = param; + this.name = (IReferenceMName)name; + this.param = (IReferenceMName)param; } - private final IReference name; + private final IReferenceMName name; - private final IReference param; + private final IReferenceMName param; @Override public String getName() @@ -55,7 +56,7 @@ public class ParameterizedReference implements IReference } @Override - public IDefinition resolve(ICompilerProject project, ASScope scope, + public IDefinition resolve(ICompilerProject project, IASScope scope, DependencyType dependencyType, boolean canEscapeWith) { @@ -80,7 +81,7 @@ public class ParameterizedReference implements IReference } @Override - public Name getMName(ICompilerProject project, ASScope scope) + public Name getMName(ICompilerProject project, IASScope scope) { Name baseName = name.getMName(project, scope); Name paramName = param.getMName(project, scope); diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/definitions/references/ResolvedQualifiersReference.java b/compiler/src/main/java/org/apache/royale/compiler/internal/definitions/references/ResolvedQualifiersReference.java index 28ca21f..1561d13 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/definitions/references/ResolvedQualifiersReference.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/definitions/references/ResolvedQualifiersReference.java @@ -31,12 +31,13 @@ import org.apache.royale.abc.semantics.Nsset; import org.apache.royale.compiler.common.DependencyType; import org.apache.royale.compiler.definitions.IDefinition; import org.apache.royale.compiler.definitions.INamespaceDefinition; -import org.apache.royale.compiler.definitions.references.IReference; +import org.apache.royale.compiler.definitions.references.IReferenceMName; import org.apache.royale.compiler.definitions.references.IResolvedQualifiersReference; import org.apache.royale.compiler.internal.definitions.AmbiguousDefinition; import org.apache.royale.compiler.internal.definitions.NamespaceDefinition; import org.apache.royale.compiler.internal.projects.CompilerProject; import org.apache.royale.compiler.internal.scopes.ASScope; +import org.apache.royale.compiler.scopes.IASScope; import org.apache.royale.compiler.projects.ICompilerProject; import org.apache.royale.compiler.units.ICompilationUnit; import com.google.common.collect.ImmutableSet; @@ -46,7 +47,7 @@ import com.google.common.collect.Iterables; * Implementation of {@link IReference} representing a reference where all the * qualifiers have been resolved to namespace definitions. */ -public class ResolvedQualifiersReference implements IResolvedQualifiersReference +public class ResolvedQualifiersReference implements IResolvedQualifiersReference, IReferenceMName { /** * Constructor. @@ -69,17 +70,17 @@ public class ResolvedQualifiersReference implements IResolvedQualifiersReference } @Override - public IDefinition resolve(ICompilerProject project, ASScope scope, + public IDefinition resolve(ICompilerProject project, IASScope scope, DependencyType dependencyType, boolean canEscapeWith) { if (qualifiers.size() == 1) { INamespaceDefinition qualifier = Iterables.getOnlyElement(qualifiers); - return scope.findPropertyQualified(project, qualifier, getName(), dependencyType, canEscapeWith); + return ((ASScope)scope).findPropertyQualified(project, qualifier, getName(), dependencyType, canEscapeWith); } - return ((CompilerProject)project).getCacheForScope(scope).findPropertyMultiname(this, dependencyType); + return ((CompilerProject)project).getCacheForScope((ASScope)scope).findPropertyMultiname(this, dependencyType); } @Override @@ -107,7 +108,7 @@ public class ResolvedQualifiersReference implements IResolvedQualifiersReference } @Override - public Name getMName(ICompilerProject project, ASScope scope) + public Name getMName(ICompilerProject project, IASScope scope) { return getMName(); } diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/definitions/references/ResolvedReference.java b/compiler/src/main/java/org/apache/royale/compiler/internal/definitions/references/ResolvedReference.java index ee6835c..4ca38db 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/definitions/references/ResolvedReference.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/definitions/references/ResolvedReference.java @@ -22,9 +22,9 @@ package org.apache.royale.compiler.internal.definitions.references; import org.apache.royale.abc.semantics.Name; import org.apache.royale.compiler.common.DependencyType; import org.apache.royale.compiler.definitions.IDefinition; -import org.apache.royale.compiler.definitions.references.IReference; +import org.apache.royale.compiler.definitions.references.IReferenceMName; import org.apache.royale.compiler.internal.definitions.DefinitionBase; -import org.apache.royale.compiler.internal.scopes.ASScope; +import org.apache.royale.compiler.scopes.IASScope; import org.apache.royale.compiler.projects.ICompilerProject; /** @@ -37,7 +37,7 @@ import org.apache.royale.compiler.projects.ICompilerProject; * then we know what it is; we don't need to walk up the scope chain to resolve * it. */ -public class ResolvedReference implements IReference +public class ResolvedReference implements IReferenceMName { /** * Constructor. @@ -56,7 +56,7 @@ public class ResolvedReference implements IReference } @Override - public IDefinition resolve(ICompilerProject project, ASScope scope, + public IDefinition resolve(ICompilerProject project, IASScope scope, DependencyType dependencyType, boolean canEscapeWith) { @@ -70,7 +70,7 @@ public class ResolvedReference implements IReference } @Override - public Name getMName(ICompilerProject project, ASScope scope) + public Name getMName(ICompilerProject project, IASScope scope) { if (definition instanceof DefinitionBase) return ((DefinitionBase)definition).getMName(project); diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/embedding/EmbedData.java b/compiler/src/main/java/org/apache/royale/compiler/internal/embedding/EmbedData.java index 1152a01..a247cf4 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/embedding/EmbedData.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/embedding/EmbedData.java @@ -35,6 +35,9 @@ import org.apache.royale.compiler.definitions.IFunctionDefinition; import org.apache.royale.compiler.definitions.IFunctionDefinition.FunctionClassification; import org.apache.royale.compiler.definitions.IGetterDefinition; import org.apache.royale.compiler.definitions.INamespaceDefinition; +import org.apache.royale.compiler.embedding.EmbedAttribute; +import org.apache.royale.compiler.embedding.IEmbedData; +import org.apache.royale.compiler.embedding.transcoders.ITranscoder; import org.apache.royale.compiler.internal.definitions.ClassDefinition; import org.apache.royale.compiler.internal.embedding.transcoders.DataTranscoder; import org.apache.royale.compiler.internal.embedding.transcoders.ImageTranscoder; @@ -200,7 +203,7 @@ public class EmbedData implements IEmbedData Collection<ICompilationUnit> referencingCUs = project.getCompilationUnits(containingSourceFilename); for (ICompilationUnit cu : referencingCUs) { - project.addUnfoundReferencedSourceFileDependency(value, cu); + ((RoyaleProject)project).addUnfoundReferencedSourceFileDependency(value, cu); } hadError = true; } @@ -412,7 +415,7 @@ public class EmbedData implements IEmbedData return false; } - Workspace workspace = project.getWorkspace(); + Workspace workspace = (Workspace)project.getWorkspace(); switch (mimeType) { case JPEG: diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/embedding/transcoders/ImageTranscoder.java b/compiler/src/main/java/org/apache/royale/compiler/internal/embedding/transcoders/ImageTranscoder.java index 2938d47..14361cc 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/embedding/transcoders/ImageTranscoder.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/embedding/transcoders/ImageTranscoder.java @@ -29,7 +29,7 @@ import java.util.List; import java.util.Map; import org.apache.royale.compiler.common.ISourceLocation; -import org.apache.royale.compiler.internal.embedding.EmbedAttribute; +import org.apache.royale.compiler.embedding.EmbedAttribute; import org.apache.royale.compiler.internal.embedding.EmbedData; import org.apache.royale.compiler.internal.workspaces.Workspace; import org.apache.royale.compiler.problems.EmbedExceptionWhileTranscodingProblem; diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/embedding/transcoders/JPEGTranscoder.java b/compiler/src/main/java/org/apache/royale/compiler/internal/embedding/transcoders/JPEGTranscoder.java index b88db98..e71ead5 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/embedding/transcoders/JPEGTranscoder.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/embedding/transcoders/JPEGTranscoder.java @@ -38,7 +38,7 @@ import javax.imageio.stream.MemoryCacheImageOutputStream; import org.apache.commons.io.IOUtils; import org.apache.royale.compiler.common.ISourceLocation; -import org.apache.royale.compiler.internal.embedding.EmbedAttribute; +import org.apache.royale.compiler.embedding.EmbedAttribute; import org.apache.royale.compiler.internal.embedding.EmbedData; import org.apache.royale.compiler.internal.workspaces.Workspace; import org.apache.royale.compiler.problems.EmbedExceptionWhileTranscodingProblem; diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/embedding/transcoders/MovieTranscoder.java b/compiler/src/main/java/org/apache/royale/compiler/internal/embedding/transcoders/MovieTranscoder.java index fe5d4eb..928d192 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/embedding/transcoders/MovieTranscoder.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/embedding/transcoders/MovieTranscoder.java @@ -27,12 +27,13 @@ import java.util.LinkedHashSet; import java.util.Map; import java.util.Set; +import org.apache.royale.compiler.caches.ISWFCache; import org.apache.royale.compiler.common.ISourceLocation; import org.apache.royale.compiler.constants.IASKeywordConstants; import org.apache.royale.compiler.constants.INamespaceConstants; import org.apache.royale.compiler.internal.caches.CacheStoreKeyBase; import org.apache.royale.compiler.internal.caches.SWFCache; -import org.apache.royale.compiler.internal.embedding.EmbedAttribute; +import org.apache.royale.compiler.embedding.EmbedAttribute; import org.apache.royale.compiler.internal.embedding.EmbedData; import org.apache.royale.compiler.internal.parsing.as.ASToken; import org.apache.royale.compiler.internal.parsing.as.ASTokenTypes; @@ -378,7 +379,7 @@ public class MovieTranscoder extends ScalableTranscoder final ISWC swc = swcManager.get(new File(super.swcSource.getContainingSWCPath())); cacheKey = SWFCache.createKey(swc, source); } - SWFCache swfCache = workspace.getSWCManager().getSWFCache(); + SWFCache swfCache = (SWFCache)workspace.getSWCManager().getSWFCache(); SWFReader swfReader = (SWFReader)swfCache.get(cacheKey); return swfReader; } diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/embedding/transcoders/ScalableTranscoder.java b/compiler/src/main/java/org/apache/royale/compiler/internal/embedding/transcoders/ScalableTranscoder.java index 0222cce..83ba5c1 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/embedding/transcoders/ScalableTranscoder.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/embedding/transcoders/ScalableTranscoder.java @@ -23,7 +23,7 @@ import java.util.Collection; import java.util.List; import org.apache.royale.compiler.common.ISourceLocation; -import org.apache.royale.compiler.internal.embedding.EmbedAttribute; +import org.apache.royale.compiler.embedding.EmbedAttribute; import org.apache.royale.compiler.internal.embedding.EmbedData; import org.apache.royale.compiler.internal.workspaces.Workspace; import org.apache.royale.compiler.problems.EmbedScalingGridProblem; diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/embedding/transcoders/SkinTranscoder.java b/compiler/src/main/java/org/apache/royale/compiler/internal/embedding/transcoders/SkinTranscoder.java index 7fd1159..ca473a0 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/embedding/transcoders/SkinTranscoder.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/embedding/transcoders/SkinTranscoder.java @@ -35,10 +35,10 @@ import org.apache.royale.compiler.constants.IASLanguageConstants.BuiltinType; import org.apache.royale.compiler.definitions.IDefinition; import org.apache.royale.compiler.definitions.references.IResolvedQualifiersReference; import org.apache.royale.compiler.definitions.references.ReferenceFactory; +import org.apache.royale.compiler.embedding.EmbedAttribute; import org.apache.royale.compiler.internal.abc.ClassGeneratorHelper; import org.apache.royale.compiler.internal.definitions.ClassDefinition; import org.apache.royale.compiler.internal.definitions.TypeDefinitionBase; -import org.apache.royale.compiler.internal.embedding.EmbedAttribute; import org.apache.royale.compiler.internal.embedding.EmbedData; import org.apache.royale.compiler.internal.embedding.EmbedData.SkinClassInfo; import org.apache.royale.compiler.internal.tree.as.FileNode; diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/embedding/transcoders/TranscoderBase.java b/compiler/src/main/java/org/apache/royale/compiler/internal/embedding/transcoders/TranscoderBase.java index bd075d2..0b3d480 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/embedding/transcoders/TranscoderBase.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/embedding/transcoders/TranscoderBase.java @@ -31,7 +31,7 @@ import org.apache.royale.compiler.common.ISourceLocation; import org.apache.royale.compiler.constants.INamespaceConstants; import org.apache.royale.compiler.embedding.transcoders.ITranscoder; import org.apache.royale.compiler.filespecs.IBinaryFileSpecification; -import org.apache.royale.compiler.internal.embedding.EmbedAttribute; +import org.apache.royale.compiler.embedding.EmbedAttribute; import org.apache.royale.compiler.internal.embedding.EmbedData; import org.apache.royale.compiler.internal.embedding.EmbedMIMEType; import org.apache.royale.compiler.internal.semantics.PostProcessStep; diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/embedding/transcoders/XMLTranscoder.java b/compiler/src/main/java/org/apache/royale/compiler/internal/embedding/transcoders/XMLTranscoder.java index 328ec12..05853d9 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/embedding/transcoders/XMLTranscoder.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/embedding/transcoders/XMLTranscoder.java @@ -33,7 +33,7 @@ import org.apache.commons.io.input.BOMInputStream; import org.apache.royale.compiler.common.ISourceLocation; import org.apache.royale.compiler.constants.IASKeywordConstants; import org.apache.royale.compiler.constants.INamespaceConstants; -import org.apache.royale.compiler.internal.embedding.EmbedAttribute; +import org.apache.royale.compiler.embedding.EmbedAttribute; import org.apache.royale.compiler.internal.embedding.EmbedData; import org.apache.royale.compiler.internal.parsing.as.ASToken; import org.apache.royale.compiler.internal.parsing.as.ASTokenTypes; diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/projects/CompilerProject.java b/compiler/src/main/java/org/apache/royale/compiler/internal/projects/CompilerProject.java index c00e9d4..a7af708 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/projects/CompilerProject.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/projects/CompilerProject.java @@ -43,7 +43,6 @@ import org.apache.royale.compiler.definitions.IFunctionDefinition; import org.apache.royale.compiler.definitions.INamespaceDefinition; import org.apache.royale.compiler.definitions.ITypeDefinition; import org.apache.royale.compiler.internal.definitions.ClassDefinition; -import org.apache.royale.compiler.internal.definitions.FunctionDefinition; import org.apache.royale.compiler.internal.definitions.NamespaceDefinition; import org.apache.royale.compiler.internal.embedding.EmbedData; import org.apache.royale.compiler.internal.parsing.as.IProjectConfigVariables; @@ -978,7 +977,7 @@ public abstract class CompilerProject implements ICompilerProject * @param def2 The other possibility. * @return null if still ambiguous or else def1 or def2. */ - public IDefinition doubleCheckAmbiguousDefinition(ASScope scope, String name, IDefinition def1, IDefinition def2) + public IDefinition doubleCheckAmbiguousDefinition(IASScope scope, String name, IDefinition def1, IDefinition def2) { return null; } @@ -1004,7 +1003,7 @@ public abstract class CompilerProject implements ICompilerProject return (baseDefinition == overrideDefinition); } - public boolean isValidTypeConversion(IASNode node, IDefinition actualDefinition, IDefinition expectedDefinition, FunctionDefinition func) + public boolean isValidTypeConversion(IASNode node, IDefinition actualDefinition, IDefinition expectedDefinition, IFunctionDefinition func) { return false; } diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/projects/LibraryPathManager.java b/compiler/src/main/java/org/apache/royale/compiler/internal/projects/LibraryPathManager.java index 34a1532..c9e7550 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/projects/LibraryPathManager.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/projects/LibraryPathManager.java @@ -648,7 +648,7 @@ public final class LibraryPathManager for (ISWCLibrary library : swc.getLibraries()) { final CacheStoreKeyBase key = SWFCache.createKey(swc, library.getPath()); - final ITagContainer tags = swcManager.getSWFCache().get(key); + final ITagContainer tags = ((SWFCache)swcManager.getSWFCache()).get(key); problems.addAll(tags.getProblems()); } } diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/projects/RoyaleProject.java b/compiler/src/main/java/org/apache/royale/compiler/internal/projects/RoyaleProject.java index ef2b92d..d4ea670 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/projects/RoyaleProject.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/projects/RoyaleProject.java @@ -87,6 +87,7 @@ import org.apache.royale.compiler.mxml.IMXMLManifestManager; import org.apache.royale.compiler.mxml.IMXMLNamespaceMapping; import org.apache.royale.compiler.projects.ICompilerProjectWithNamedColor; import org.apache.royale.compiler.projects.IRoyaleProject; +import org.apache.royale.compiler.scopes.IASScope; import org.apache.royale.compiler.scopes.IDefinitionSet; import org.apache.royale.compiler.targets.ISWCTarget; import org.apache.royale.compiler.targets.ISWFTarget; @@ -2136,9 +2137,9 @@ public class RoyaleProject extends ASProject implements IRoyaleProject, ICompile } @Override - public IDefinition doubleCheckAmbiguousDefinition(ASScope scope, String name, IDefinition def1, IDefinition def2) + public IDefinition doubleCheckAmbiguousDefinition(IASScope scope, String name, IDefinition def1, IDefinition def2) { - IScopedDefinition scopeDef = scope.getContainingDefinition(); + IScopedDefinition scopeDef = ((ASScope)scope).getContainingDefinition(); String thisPackage = null; if (scopeDef != null) thisPackage = scopeDef.getPackageName(); @@ -2163,7 +2164,7 @@ public class RoyaleProject extends ASProject implements IRoyaleProject, ICompile if (package1.length() == 0 || package2.length() == 0) { // now check to see if the class was imported in the window package. - ASScope pkgScope = scope; + ASScope pkgScope = (ASScope)scope; while (!(pkgScope instanceof PackageScope)) pkgScope = pkgScope.getContainingScope(); String[] imports = pkgScope.getImports(); @@ -2283,7 +2284,7 @@ public class RoyaleProject extends ASProject implements IRoyaleProject, ICompile } @Override - public boolean isValidTypeConversion(IASNode node, IDefinition actualDefinition, IDefinition expectedDefinition, FunctionDefinition func) + public boolean isValidTypeConversion(IASNode node, IDefinition actualDefinition, IDefinition expectedDefinition, IFunctionDefinition func) { if (actualDefinition.getBaseName().equals(IASLanguageConstants._int) && expectedDefinition.getBaseName().equals(IASLanguageConstants.Function)) diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/projects/RoyaleProjectConfigurator.java b/compiler/src/main/java/org/apache/royale/compiler/internal/projects/RoyaleProjectConfigurator.java index 548e6bf..d8b9e40 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/projects/RoyaleProjectConfigurator.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/projects/RoyaleProjectConfigurator.java @@ -22,8 +22,8 @@ package org.apache.royale.compiler.internal.projects; import static org.apache.royale.abc.ABCConstants.CONSTANT_PackageNs; import static org.apache.royale.abc.ABCConstants.CONSTANT_Qname; -import java.util.HashMap; -import java.util.Map; +import java.io.File; +import java.util.*; import org.apache.royale.abc.semantics.Name; import org.apache.royale.abc.semantics.Namespace; @@ -32,10 +32,18 @@ import org.apache.royale.compiler.config.Configuration; import org.apache.royale.compiler.config.Configurator; import org.apache.royale.compiler.fxg.flex.FlexFXG2SWFTranscoder; import org.apache.royale.compiler.internal.as.codegen.BindableHelper; +import org.apache.royale.compiler.internal.config.RoyaleTargetSettings; import org.apache.royale.compiler.internal.definitions.ClassDefinition; import org.apache.royale.compiler.internal.embedding.transcoders.DataTranscoder; import org.apache.royale.compiler.internal.units.FXGCompilationUnit; import org.apache.royale.compiler.mxml.IMXMLTypeConstants; +import org.apache.royale.compiler.mxml.IMXMLNamespaceMapping; +import org.apache.royale.compiler.problems.ANELibraryNotAllowedProblem; +import org.apache.royale.compiler.projects.IRoyaleProject; +import org.apache.royale.compiler.projects.ICompilerProject; +import org.apache.royale.compiler.targets.ITargetSettings; +import org.apache.royale.swc.ISWC; +import org.apache.royale.utils.FilenameNormalization; /** * This class applies configuration settings to a RoyaleProject. @@ -262,7 +270,7 @@ public class RoyaleProjectConfigurator extends Configurator public boolean applyToProject(ICompilerProject project) { boolean success = super.applyToProject(project); - if (success && !setupSources(project)) + if (success && !setupSources((IRoyaleProject)project)) success = false; return success; } @@ -272,6 +280,7 @@ public class RoyaleProjectConfigurator extends Configurator { boolean success = true; + RoyaleProject royaleProject = (RoyaleProject)project; RoyaleProjectConfigurator.configure(royaleProject, configuration); setupCompatibilityVersion(royaleProject); setupConfigVariables(royaleProject); @@ -280,12 +289,12 @@ public class RoyaleProjectConfigurator extends Configurator setupThemeFiles(royaleProject); setupRoyale(royaleProject); setupCodegenOptions(royaleProject); - project.setRuntimeSharedLibraryPath(getRSLSettingsFromConfiguration(configuration)); + royaleProject.setRuntimeSharedLibraryPath(getRSLSettingsFromConfiguration(configuration)); - if (!setupProjectLibraries(project)) + if (!setupProjectLibraries(royaleProject)) success = false; - setupNamespaces(project); + setupNamespaces(royaleProject); return success; } @@ -484,4 +493,26 @@ public class RoyaleProjectConfigurator extends Configurator } return null; } + + /** + * Test if the SWC is explicitly on the external library path. + * + * @param library + * @param externalLibraryFiles + * @return true if the library is on the external library path, false otherwise. + */ + private boolean isOnExternalLibrayPath(ISWC library, List<File> externalLibraryFiles) + { + File aneFile = library.getSWCFile(); + + for (File file : externalLibraryFiles) + { + if (file.equals(aneFile)) + return true; + } + + return false; + } + + } diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/targets/RoyaleFrame1Info.java b/compiler/src/main/java/org/apache/royale/compiler/internal/targets/RoyaleFrame1Info.java index c921823..bdc698f 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/targets/RoyaleFrame1Info.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/targets/RoyaleFrame1Info.java @@ -125,7 +125,7 @@ abstract class RoyaleFrame1Info if (!(compilationUnit instanceof EmbedCompilationUnit)) return; - TranscoderBase transcoder = ((EmbedCompilationUnit)compilationUnit).getEmbedData().getTranscoder(); + TranscoderBase transcoder = (TranscoderBase)((EmbedCompilationUnit)compilationUnit).getEmbedData().getTranscoder(); if (!(transcoder instanceof MovieTranscoder)) return; diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/tree/as/EmbedNode.java b/compiler/src/main/java/org/apache/royale/compiler/internal/tree/as/EmbedNode.java index e0b38e0..039f788 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/tree/as/EmbedNode.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/tree/as/EmbedNode.java @@ -28,7 +28,7 @@ import org.apache.commons.io.FileUtils; import org.apache.royale.compiler.common.IEmbedResolver; import org.apache.royale.compiler.definitions.ITypeDefinition; import org.apache.royale.compiler.definitions.metadata.IMetaTagAttribute; -import org.apache.royale.compiler.internal.embedding.EmbedAttribute; +import org.apache.royale.compiler.embedding.EmbedAttribute; import org.apache.royale.compiler.internal.embedding.EmbedData; import org.apache.royale.compiler.internal.embedding.EmbedMIMEType; import org.apache.royale.compiler.internal.projects.CompilerProject; diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/tree/as/IdentifierNode.java b/compiler/src/main/java/org/apache/royale/compiler/internal/tree/as/IdentifierNode.java index 7189092..122b54b 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/tree/as/IdentifierNode.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/tree/as/IdentifierNode.java @@ -46,6 +46,7 @@ import org.apache.royale.compiler.definitions.ITypeDefinition; import org.apache.royale.compiler.definitions.IQualifiers; import org.apache.royale.compiler.definitions.IVariableDefinition.VariableClassification; import org.apache.royale.compiler.definitions.references.INamespaceReference; +import org.apache.royale.compiler.definitions.references.INamespaceResolvedReference; import org.apache.royale.compiler.definitions.references.IReference; import org.apache.royale.compiler.definitions.references.ReferenceFactory; import org.apache.royale.compiler.internal.definitions.AmbiguousDefinition; @@ -565,7 +566,7 @@ public class IdentifierNode extends ExpressionNodeBase implements IIdentifierNod INamespaceReference qualifier = workspace.getPackageNamespaceDefinitionCache().get(packageName, false); return new Name(isAttributeIdentifier() ? CONSTANT_QnameA : CONSTANT_Qname, - new Nsset(qualifier.resolveAETNamespace(project)), getName()); + new Nsset(((INamespaceResolvedReference)qualifier).resolveAETNamespace(project)), getName()); } Set<INamespaceDefinition> namespaceSet = null; diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/units/CompilationUnitBase.java b/compiler/src/main/java/org/apache/royale/compiler/internal/units/CompilationUnitBase.java index 0694a3c..9e680f6 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/units/CompilationUnitBase.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/units/CompilationUnitBase.java @@ -51,7 +51,7 @@ import org.apache.royale.compiler.filespecs.IFileSpecification; import org.apache.royale.compiler.internal.css.CSSFunctionCallPropertyValue; import org.apache.royale.compiler.internal.css.codegen.CSSCompilationSession; import org.apache.royale.compiler.internal.css.semantics.CSSSemanticAnalyzer; -import org.apache.royale.compiler.internal.embedding.EmbedAttribute; +import org.apache.royale.compiler.embedding.EmbedAttribute; import org.apache.royale.compiler.internal.embedding.EmbedData; import org.apache.royale.compiler.internal.graph.LinkReportWriter; import org.apache.royale.compiler.internal.projects.ASProject; diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/units/EmbedCompilationUnit.java b/compiler/src/main/java/org/apache/royale/compiler/internal/units/EmbedCompilationUnit.java index ae18215..abf190c 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/units/EmbedCompilationUnit.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/units/EmbedCompilationUnit.java @@ -21,8 +21,10 @@ package org.apache.royale.compiler.internal.units; import java.util.Collection; import java.util.Collections; +import java.util.HashSet; import java.util.LinkedList; import java.util.List; +import java.util.Set; import org.apache.royale.compiler.common.DependencyType; import org.apache.royale.compiler.common.Multiname; import org.apache.royale.compiler.definitions.IDefinition; @@ -30,7 +32,8 @@ import org.apache.royale.compiler.filespecs.IFileSpecification; import org.apache.royale.compiler.internal.abc.ABCScopeBuilder; import org.apache.royale.compiler.internal.as.codegen.CodeGeneratorManager; import org.apache.royale.compiler.internal.definitions.ClassDefinition; -import org.apache.royale.compiler.internal.embedding.EmbedAttribute; +import org.apache.royale.compiler.embedding.EmbedAttribute; +import org.apache.royale.compiler.embedding.IEmbedData; import org.apache.royale.compiler.internal.embedding.EmbedData; import org.apache.royale.compiler.internal.embedding.transcoders.SkinTranscoder; import org.apache.royale.compiler.internal.embedding.transcoders.TranscoderBase; @@ -100,7 +103,7 @@ public class EmbedCompilationUnit extends CompilationUnitBase try { getProject().clearScopeCacheForCompilationUnit(this); - TranscoderBase transcoder = embedData.getTranscoder(); + TranscoderBase transcoder = (TranscoderBase)embedData.getTranscoder(); if (transcoder instanceof SkinTranscoder) { List<ICompilerProblem> noProblems = Collections.emptyList(); @@ -133,7 +136,7 @@ public class EmbedCompilationUnit extends CompilationUnitBase @Override protected IFileScopeRequestResult handleFileScopeRequest() throws InterruptedException { - TranscoderBase transcoder = embedData.getTranscoder(); + TranscoderBase transcoder = (TranscoderBase)embedData.getTranscoder(); // SkinTranscoder generates ABC directly rather than an AST, so handle differently // Eventually all transcoders should be updated to go directly to ABC if (transcoder instanceof SkinTranscoder) @@ -200,7 +203,7 @@ public class EmbedCompilationUnit extends CompilationUnitBase @Override protected IABCBytesRequestResult handleABCBytesRequest() throws InterruptedException { - TranscoderBase transcoder = embedData.getTranscoder(); + TranscoderBase transcoder = (TranscoderBase)embedData.getTranscoder(); // SkinTranscoder generates ABC directly rather than an AST, so handle differently // Eventually all transcoders should be updated to go directly to ABC if (transcoder instanceof SkinTranscoder) @@ -211,7 +214,9 @@ public class EmbedCompilationUnit extends CompilationUnitBase List<ICompilerProblem> problems = new LinkedList<ICompilerProblem>(); byte[] bytes = transcoder.buildABC(getProject(), problems); ICompilerProblem[] problemsArray = problems.toArray(new ICompilerProblem[problems.size()]); - return new ABCBytesRequestResult(bytes, problemsArray, Collections.singleton(embedData)); + Set<IEmbedData> iembeds = new HashSet<IEmbedData>(); + iembeds.add(embedData); + return new ABCBytesRequestResult(bytes, problemsArray, iembeds); } finally { @@ -256,9 +261,9 @@ public class EmbedCompilationUnit extends CompilationUnitBase else tagName = qname.replace('.', '/'); - Collection<EmbedData> embeds = abc.getEmbeds(); + Collection<IEmbedData> embeds = abc.getEmbeds(); if (embeds.size() == 0) - embeds = Collections.singleton(embedData); + embeds = Collections.singleton((IEmbedData)embedData); return new SWFTagsRequestResult(abc.getABCBytes(), tagName, embeds); } finally diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/units/ResourceBundleCompilationUnit.java b/compiler/src/main/java/org/apache/royale/compiler/internal/units/ResourceBundleCompilationUnit.java index c13129f..abfdbad 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/units/ResourceBundleCompilationUnit.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/units/ResourceBundleCompilationUnit.java @@ -48,6 +48,7 @@ import org.apache.royale.compiler.definitions.references.INamespaceReference; import org.apache.royale.compiler.definitions.references.IReference; import org.apache.royale.compiler.definitions.references.IResolvedQualifiersReference; import org.apache.royale.compiler.definitions.references.ReferenceFactory; +import org.apache.royale.compiler.embedding.IEmbedData; import org.apache.royale.compiler.internal.abc.ClassGeneratorHelper; import org.apache.royale.compiler.internal.definitions.ClassDefinition; import org.apache.royale.compiler.internal.definitions.PackageDefinition; @@ -324,7 +325,10 @@ public class ResourceBundleCompilationUnit extends CompilationUnitBase Set<EmbedData> embeds = new HashSet<EmbedData>(); EmbedCompilationUnitFactory.collectEmbedDatas(getProject(), (IFileNodeAccumulator)rootNode, embeds, problems); - return new ABCBytesRequestResult(generatedBytes, problems.toArray(new ICompilerProblem[0]), embeds); + Set<IEmbedData> iembeds = new HashSet<IEmbedData>(); + for (EmbedData embed : embeds) + iembeds.add(embed); + return new ABCBytesRequestResult(generatedBytes, problems.toArray(new ICompilerProblem[0]), iembeds); } finally { diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/units/ResourceModuleCompilationUnit.java b/compiler/src/main/java/org/apache/royale/compiler/internal/units/ResourceModuleCompilationUnit.java index 387af71..710d577 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/units/ResourceModuleCompilationUnit.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/units/ResourceModuleCompilationUnit.java @@ -34,9 +34,9 @@ import org.apache.royale.compiler.definitions.INamespaceDefinition; import org.apache.royale.compiler.definitions.references.INamespaceReference; import org.apache.royale.compiler.definitions.references.IResolvedQualifiersReference; import org.apache.royale.compiler.definitions.references.ReferenceFactory; +import org.apache.royale.compiler.embedding.IEmbedData; import org.apache.royale.compiler.internal.abc.ClassGeneratorHelper; import org.apache.royale.compiler.internal.definitions.ClassDefinition; -import org.apache.royale.compiler.internal.embedding.EmbedData; import org.apache.royale.compiler.internal.projects.CompilerProject; import org.apache.royale.compiler.internal.projects.RoyaleProject; import org.apache.royale.compiler.internal.projects.DefinitionPriority.BasePriority; @@ -250,7 +250,7 @@ public class ResourceModuleCompilationUnit extends CompilationUnitBase problems.add(new InternalCompilerProblem(ex)); } - return new ABCBytesRequestResult(generatedBytes, problems.toArray(new ICompilerProblem[0]), Collections.<EmbedData>emptySet()); + return new ABCBytesRequestResult(generatedBytes, problems.toArray(new ICompilerProblem[0]), Collections.<IEmbedData>emptySet()); } finally { diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/units/SWCCompilationUnit.java b/compiler/src/main/java/org/apache/royale/compiler/internal/units/SWCCompilationUnit.java index b89cd78..7a3d1ce 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/units/SWCCompilationUnit.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/units/SWCCompilationUnit.java @@ -194,7 +194,7 @@ public class SWCCompilationUnit extends CompilationUnitBase Collection<IASScope> scopeList = null; try { - final FileScopeCache fsCache = getProject().getWorkspace().getSWCManager().getFileScopeCache(); + final FileScopeCache fsCache = (FileScopeCache)getProject().getWorkspace().getSWCManager().getFileScopeCache(); final CacheStoreKeyBase key = FileScopeCache.createKey(swc, library.getPath(), script); scopeList = fsCache.get(key); if (scopeList.isEmpty()) @@ -227,7 +227,7 @@ public class SWCCompilationUnit extends CompilationUnitBase final ArrayList<ICompilerProblem> problems = new ArrayList<ICompilerProblem>(); final CacheStoreKeyBase key = SWFCache.createKey(swc, library.getPath()); - final ITagContainer tags = getProject().getWorkspace().getSWCManager().getSWFCache().get(key); + final ITagContainer tags = ((SWFCache)getProject().getWorkspace().getSWCManager().getSWFCache()).get(key); startProfile(Operation.GET_ABC_BYTES); @@ -261,7 +261,7 @@ public class SWCCompilationUnit extends CompilationUnitBase // link main definition final CacheStoreKeyBase key = SWFCache.createKey(swc, library.getPath()); - final ITagContainer tags = getProject().getWorkspace().getSWCManager().getSWFCache().get(key); + final ITagContainer tags = ((SWFCache)getProject().getWorkspace().getSWCManager().getSWFCache()).get(key); final DoABCTag doABC = SWFCache.findDoABCTagByName(tags, script.getName()); if (doABC == null) throw new NullPointerException("can not find DoABC tag: " + script.getName()); @@ -275,7 +275,7 @@ public class SWCCompilationUnit extends CompilationUnitBase for (final String defQName : script.getDefinitions()) { final CacheStoreKeyBase assetCacheKey = AssetTagCache.createKey(swc, library.getPath(), script, defQName); - final AssetTagCache.AssetTagCacheValue assetCacheValue = getProject().getWorkspace().getSWCManager().getAssetTagCache().get(assetCacheKey); + final AssetTagCache.AssetTagCacheValue assetCacheValue = ((AssetTagCache)getProject().getWorkspace().getSWCManager().getAssetTagCache()).get(assetCacheKey); if (assetCacheValue.assetTag != null) { linkingTags.add(assetCacheValue.assetTag); @@ -375,13 +375,13 @@ public class SWCCompilationUnit extends CompilationUnitBase private void addAssetTagDependencies(SetMultimap<String, DependencyType> dependencies) { final CacheStoreKeyBase key = SWFCache.createKey(swc, library.getPath()); - final ITagContainer swfTags = getProject().getWorkspace().getSWCManager().getSWFCache().get(key); + final ITagContainer swfTags = ((SWFCache)getProject().getWorkspace().getSWCManager().getSWFCache()).get(key); final Collection<SymbolClassTag> symbolTags = SWFCache.findAllSymbolClassTags(swfTags); for (final String defQName : script.getDefinitions()) { final CacheStoreKeyBase assetCacheKey = AssetTagCache.createKey(swc, library.getPath(), script, defQName); - final AssetTagCache.AssetTagCacheValue assetCacheValue = getProject().getWorkspace().getSWCManager().getAssetTagCache().get(assetCacheKey); + final AssetTagCache.AssetTagCacheValue assetCacheValue = ((AssetTagCache)getProject().getWorkspace().getSWCManager().getAssetTagCache()).get(assetCacheKey); if (assetCacheValue.referredTags != null) { for (ITag referredTag : assetCacheValue.referredTags) diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/units/StyleModuleCompilationUnit.java b/compiler/src/main/java/org/apache/royale/compiler/internal/units/StyleModuleCompilationUnit.java index 7c26439..cffd562 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/units/StyleModuleCompilationUnit.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/units/StyleModuleCompilationUnit.java @@ -35,13 +35,13 @@ import org.apache.royale.compiler.common.DependencyType; import org.apache.royale.compiler.css.ICSSDocument; import org.apache.royale.compiler.definitions.references.IResolvedQualifiersReference; import org.apache.royale.compiler.definitions.references.ReferenceFactory; +import org.apache.royale.compiler.embedding.IEmbedData; import org.apache.royale.compiler.filespecs.IFileSpecification; import org.apache.royale.compiler.internal.css.CSSDocument; import org.apache.royale.compiler.internal.css.codegen.CSSCompilationSession; import org.apache.royale.compiler.internal.css.codegen.CSSModuleGenerator; import org.apache.royale.compiler.internal.definitions.ClassDefinition; import org.apache.royale.compiler.internal.definitions.NamespaceDefinition; -import org.apache.royale.compiler.internal.embedding.EmbedData; import org.apache.royale.compiler.internal.projects.CompilerProject; import org.apache.royale.compiler.internal.projects.RoyaleProject; import org.apache.royale.compiler.internal.projects.DefinitionPriority.BasePriority; @@ -222,7 +222,7 @@ public class StyleModuleCompilationUnit extends CompilationUnitBase final CSSCodeGenProblem problem = new CSSCodeGenProblem(e); problems.add(problem); } - return new ABCBytesRequestResult(bytes, problems.toArray(new ICompilerProblem[0]), Collections.<EmbedData>emptySet()); + return new ABCBytesRequestResult(bytes, problems.toArray(new ICompilerProblem[0]), Collections.<IEmbedData>emptySet()); } /** diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/units/requests/ABCBytesRequestResult.java b/compiler/src/main/java/org/apache/royale/compiler/internal/units/requests/ABCBytesRequestResult.java index 2a76a45..ca7eeb9 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/units/requests/ABCBytesRequestResult.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/units/requests/ABCBytesRequestResult.java @@ -29,7 +29,7 @@ import java.util.Set; import org.apache.commons.io.output.StringBuilderWriter; import org.apache.royale.abc.ABCParser; import org.apache.royale.abc.print.ABCDumpVisitor; -import org.apache.royale.compiler.internal.embedding.EmbedData; +import org.apache.royale.compiler.embedding.IEmbedData; import org.apache.royale.compiler.problems.ICompilerProblem; import org.apache.royale.compiler.units.requests.IABCBytesRequestResult; @@ -45,7 +45,7 @@ public class ABCBytesRequestResult implements IABCBytesRequestResult * @param problems Collection of problems found by the code generator. * @param embeds embedded assets */ - public ABCBytesRequestResult(byte[] bytes, ICompilerProblem problems[], Set<EmbedData> embeds) + public ABCBytesRequestResult(byte[] bytes, ICompilerProblem problems[], Set<IEmbedData> embeds) { assert ((bytes != null) || (problems != null)); this.bytes = bytes; @@ -113,14 +113,14 @@ public class ABCBytesRequestResult implements IABCBytesRequestResult } @Override - public Collection<EmbedData> getEmbeds() + public Collection<IEmbedData> getEmbeds() { return embeds; } private final byte[] bytes; private final ICompilerProblem[] problems; - private final Set<EmbedData> embeds; + private final Set<IEmbedData> embeds; @Override diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/units/requests/SWFTagsRequestResult.java b/compiler/src/main/java/org/apache/royale/compiler/internal/units/requests/SWFTagsRequestResult.java index 7ebf3f2..8c83081 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/units/requests/SWFTagsRequestResult.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/units/requests/SWFTagsRequestResult.java @@ -27,6 +27,7 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; +import org.apache.royale.compiler.embedding.IEmbedData; import org.apache.royale.compiler.internal.embedding.EmbedData; import org.apache.royale.compiler.internal.embedding.transcoders.TranscoderBase; import org.apache.royale.compiler.problems.ICompilerProblem; @@ -51,7 +52,7 @@ public class SWFTagsRequestResult implements ISWFTagsRequestResult */ public SWFTagsRequestResult(final byte[] abcData, final String tagName) { - this(abcData, tagName, Collections.<EmbedData>emptySet()); + this(abcData, tagName, Collections.<IEmbedData>emptySet()); } /** @@ -62,7 +63,7 @@ public class SWFTagsRequestResult implements ISWFTagsRequestResult * @param embeddedAssets embedded assets */ public SWFTagsRequestResult(final byte[] abcData, final String tagName, - final Collection<EmbedData> embeddedAssets) + final Collection<IEmbedData> embeddedAssets) { this.abcData = abcData; this.tagName = tagName; @@ -70,9 +71,9 @@ public class SWFTagsRequestResult implements ISWFTagsRequestResult this.additionalTags = new LinkedList<ITag>(); this.assetTags = new LinkedHashMap<String, ICharacterTag>(); - for (EmbedData embedData : embeddedAssets) + for (IEmbedData embedData : embeddedAssets) { - TranscoderBase transcoder = embedData.getTranscoder(); + TranscoderBase transcoder = (TranscoderBase)embedData.getTranscoder(); Map<String, ICharacterTag> tags = transcoder.getTags(additionalTags, this.problems); if (tags != null) diff --git a/compiler/src/main/java/org/apache/royale/compiler/problems/EmbedCouldNotDetermineSampleFrameCountProblem.java b/compiler/src/main/java/org/apache/royale/compiler/problems/EmbedCouldNotDetermineSampleFrameCountProblem.java index 3384600..0d7eb71 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/problems/EmbedCouldNotDetermineSampleFrameCountProblem.java +++ b/compiler/src/main/java/org/apache/royale/compiler/problems/EmbedCouldNotDetermineSampleFrameCountProblem.java @@ -19,7 +19,7 @@ package org.apache.royale.compiler.problems; -import org.apache.royale.compiler.internal.embedding.EmbedAttribute; +import org.apache.royale.compiler.embedding.EmbedAttribute; import org.apache.royale.compiler.internal.embedding.EmbedData; /** diff --git a/compiler/src/main/java/org/apache/royale/compiler/problems/EmbedScalingGridValueProblem.java b/compiler/src/main/java/org/apache/royale/compiler/problems/EmbedScalingGridValueProblem.java index 80f94d0..332c97e 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/problems/EmbedScalingGridValueProblem.java +++ b/compiler/src/main/java/org/apache/royale/compiler/problems/EmbedScalingGridValueProblem.java @@ -20,7 +20,7 @@ package org.apache.royale.compiler.problems; import org.apache.royale.compiler.common.ISourceLocation; -import org.apache.royale.compiler.internal.embedding.EmbedAttribute; +import org.apache.royale.compiler.embedding.EmbedAttribute; public final class EmbedScalingGridValueProblem extends CompilerProblem { diff --git a/compiler/src/main/java/org/apache/royale/compiler/problems/EmbedUnsupportedAttributeProblem.java b/compiler/src/main/java/org/apache/royale/compiler/problems/EmbedUnsupportedAttributeProblem.java index e0b37f5..c2c96d3 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/problems/EmbedUnsupportedAttributeProblem.java +++ b/compiler/src/main/java/org/apache/royale/compiler/problems/EmbedUnsupportedAttributeProblem.java @@ -20,7 +20,7 @@ package org.apache.royale.compiler.problems; import org.apache.royale.compiler.common.ISourceLocation; -import org.apache.royale.compiler.internal.embedding.EmbedAttribute; +import org.apache.royale.compiler.embedding.EmbedAttribute; import org.apache.royale.compiler.internal.embedding.EmbedMIMEType; public final class EmbedUnsupportedAttributeProblem extends CompilerProblem diff --git a/compiler/src/main/java/org/apache/royale/compiler/problems/EmbedUnsupportedSamplingRateProblem.java b/compiler/src/main/java/org/apache/royale/compiler/problems/EmbedUnsupportedSamplingRateProblem.java index 676d326..ebc4c6f 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/problems/EmbedUnsupportedSamplingRateProblem.java +++ b/compiler/src/main/java/org/apache/royale/compiler/problems/EmbedUnsupportedSamplingRateProblem.java @@ -19,7 +19,7 @@ package org.apache.royale.compiler.problems; -import org.apache.royale.compiler.internal.embedding.EmbedAttribute; +import org.apache.royale.compiler.embedding.EmbedAttribute; import org.apache.royale.compiler.internal.embedding.EmbedData; /** diff --git a/compiler/src/main/java/org/apache/royale/swc/SWCLibrary.java b/compiler/src/main/java/org/apache/royale/swc/SWCLibrary.java index 3a89262..2a708d2 100644 --- a/compiler/src/main/java/org/apache/royale/swc/SWCLibrary.java +++ b/compiler/src/main/java/org/apache/royale/swc/SWCLibrary.java @@ -32,6 +32,7 @@ import java.util.zip.ZipFile; import org.apache.royale.swc.io.SWCReader; import org.apache.royale.swf.ISWF; +import org.apache.royale.swf.io.ISWFReader; import org.apache.royale.swf.io.SWFReader; /** @@ -105,7 +106,7 @@ public class SWCLibrary implements ISWCLibrary @Override - public void readSWFInputStream(SWFReader swfReader, ISWC swc) + public void readSWFInputStream(ISWFReader swfReader, ISWC swc) { ZipFile swcFile = null; try diff --git a/compiler/src/main/java/org/apache/royale/swc/SWCManager.java b/compiler/src/main/java/org/apache/royale/swc/SWCManager.java index 06729b0..db2e5bd 100644 --- a/compiler/src/main/java/org/apache/royale/swc/SWCManager.java +++ b/compiler/src/main/java/org/apache/royale/swc/SWCManager.java @@ -22,6 +22,10 @@ package org.apache.royale.swc; import java.io.File; import java.io.IOException; +import org.apache.royale.compiler.caches.IAssetTagCache; +import org.apache.royale.compiler.caches.ICSSDocumentCache; +import org.apache.royale.compiler.caches.IFileScopeCache; +import org.apache.royale.compiler.caches.ISWFCache; import org.apache.royale.compiler.internal.caches.AssetTagCache; import org.apache.royale.compiler.internal.caches.CSSDocumentCache; import org.apache.royale.compiler.internal.caches.CacheStoreKeyBase; @@ -90,7 +94,7 @@ public class SWCManager extends ConcurrentCacheStoreBase<ISWC> implements ISWCMa * @return the swcCache */ @Override - public SWFCache getSWFCache() + public ISWFCache getSWFCache() { return swfCache; } @@ -99,7 +103,7 @@ public class SWCManager extends ConcurrentCacheStoreBase<ISWC> implements ISWCMa * @return the fileScopeCache */ @Override - public FileScopeCache getFileScopeCache() + public IFileScopeCache getFileScopeCache() { return fileScopeCache; } @@ -108,7 +112,7 @@ public class SWCManager extends ConcurrentCacheStoreBase<ISWC> implements ISWCMa * @return the assetTagCache */ @Override - public AssetTagCache getAssetTagCache() + public IAssetTagCache getAssetTagCache() { return assetTagCache; } @@ -170,7 +174,7 @@ public class SWCManager extends ConcurrentCacheStoreBase<ISWC> implements ISWCMa } @Override - public CSSDocumentCache getCSSDocumentCache() + public ICSSDocumentCache getCSSDocumentCache() { return cssDocumentCache; } -- To stop receiving notification emails like this one, please contact "[email protected]" <[email protected]>.
