You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ms...@apache.org on 2015/06/28 00:46:55 UTC

git commit: [flex-falcon] [refs/heads/develop] - Removed unused import warnings (49)

Repository: flex-falcon
Updated Branches:
  refs/heads/develop 73da15442 -> 114a06d8a


Removed unused import warnings (49)


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

Branch: refs/heads/develop
Commit: 114a06d8a979dcfa7eab340f02334fc50c3042b3
Parents: 73da154
Author: Michael Schmalle <ms...@apache.org>
Authored: Sat Jun 27 18:46:37 2015 -0400
Committer: Michael Schmalle <ms...@apache.org>
Committed: Sat Jun 27 18:46:37 2015 -0400

----------------------------------------------------------------------
 .../apache/flex/compiler/clients/COMPJSC.java   | 73 +++++++++++---------
 .../internal/codegen/js/jsc/JSCJSEmitter.java   | 57 ++-------------
 .../driver/mxml/jsc/MXMLJSCJSBackend.java       |  3 +-
 3 files changed, 47 insertions(+), 86 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/114a06d8/compiler.jx/src/org/apache/flex/compiler/clients/COMPJSC.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/clients/COMPJSC.java b/compiler.jx/src/org/apache/flex/compiler/clients/COMPJSC.java
index c8f2141..ea075c6 100644
--- a/compiler.jx/src/org/apache/flex/compiler/clients/COMPJSC.java
+++ b/compiler.jx/src/org/apache/flex/compiler/clients/COMPJSC.java
@@ -19,6 +19,17 @@
 
 package org.apache.flex.compiler.clients;
 
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
 import org.apache.commons.io.FilenameUtils;
 import org.apache.flex.compiler.codegen.as.IASWriter;
 import org.apache.flex.compiler.driver.IBackend;
@@ -31,7 +42,6 @@ import org.apache.flex.compiler.internal.driver.as.ASBackend;
 import org.apache.flex.compiler.internal.driver.js.amd.AMDBackend;
 import org.apache.flex.compiler.internal.driver.js.goog.GoogBackend;
 import org.apache.flex.compiler.internal.driver.mxml.flexjs.MXMLFlexJSSWCBackend;
-import org.apache.flex.compiler.internal.driver.mxml.jsc.MXMLJSCJSBackend;
 import org.apache.flex.compiler.internal.driver.mxml.jsc.MXMLJSCJSSWCBackend;
 import org.apache.flex.compiler.internal.driver.mxml.vf2js.MXMLVF2JSSWCBackend;
 import org.apache.flex.compiler.internal.projects.CompilerProject;
@@ -42,11 +52,8 @@ import org.apache.flex.compiler.problems.UnableToBuildSWFProblem;
 import org.apache.flex.compiler.targets.ITarget.TargetType;
 import org.apache.flex.compiler.targets.ITargetSettings;
 import org.apache.flex.compiler.units.ICompilationUnit;
-import sun.reflect.generics.reflectiveObjects.NotImplementedException;
-
-import java.io.*;
-import java.util.*;
 
+import sun.reflect.generics.reflectiveObjects.NotImplementedException;
 
 /**
  * @author Erik de Bruin
@@ -74,12 +81,14 @@ public class COMPJSC extends MXMLJSC
     }
 
     @Override
-    public String getName() {
+    public String getName()
+    {
         return FLEX_TOOL_COMPC;
     }
 
     @Override
-    public int execute(String[] args) {
+    public int execute(String[] args)
+    {
         return staticMainNoExit(args);
     }
 
@@ -88,7 +97,8 @@ public class COMPJSC extends MXMLJSC
      * 
      * @param args command line arguments
      */
-    public static void main(final String[] args) {
+    public static void main(final String[] args)
+    {
         int exitCode = staticMainNoExit(args);
         System.exit(exitCode);
     }
@@ -115,16 +125,16 @@ public class COMPJSC extends MXMLJSC
                 case AMD:
                     backend = new AMDBackend();
                     break;
-                    
+
                 case JSC:
                     backend = new MXMLJSCJSSWCBackend();
                     break;
-                
+
                 case FLEXJS:
                 case FLEXJS_DUAL:
                     backend = new MXMLFlexJSSWCBackend();
                     break;
-                
+
                 case GOOG:
                     backend = new GoogBackend();
                     break;
@@ -132,8 +142,8 @@ public class COMPJSC extends MXMLJSC
                 case VF2JS:
                     backend = new MXMLVF2JSSWCBackend();
                     break;
-                    
-                default :
+
+                default:
                     throw new NotImplementedException();
                 }
             }
@@ -162,6 +172,7 @@ public class COMPJSC extends MXMLJSC
      * @throws IOException
      * @throws InterruptedException
      */
+    @Override
     protected boolean compile()
     {
         boolean compilationSuccess = false;
@@ -184,24 +195,21 @@ public class COMPJSC extends MXMLJSC
                     if (errors.size() > 0)
                         return false;
                 }
-                
+
                 File outputFolder = new File(getOutputFilePath());
-                
-                Collection<ICompilationUnit> reachableCompilationUnits = project
-                        .getCompilationUnits();
+
+                Collection<ICompilationUnit> reachableCompilationUnits = project.getCompilationUnits();
                 for (final ICompilationUnit cu : reachableCompilationUnits)
                 {
-                    ICompilationUnit.UnitType cuType = cu
-                            .getCompilationUnitType();
+                    ICompilationUnit.UnitType cuType = cu.getCompilationUnitType();
 
                     if (cuType == ICompilationUnit.UnitType.AS_UNIT
                             || cuType == ICompilationUnit.UnitType.MXML_UNIT)
                     {
-                        final File outputClassFile = getOutputClassFile(cu
-                                .getQualifiedNames().get(0), outputFolder);
+                        final File outputClassFile = getOutputClassFile(
+                                cu.getQualifiedNames().get(0), outputFolder);
 
-                        System.out
-                                .println("Compiling file: " + outputClassFile);
+                        System.out.println("Compiling file: " + outputClassFile);
 
                         ICompilationUnit unit = cu;
 
@@ -247,6 +255,7 @@ public class COMPJSC extends MXMLJSC
      * @throws IOException IO error
      * @throws ConfigurationException
      */
+    @Override
     protected void buildArtifact() throws InterruptedException, IOException,
             ConfigurationException
     {
@@ -286,8 +295,7 @@ public class COMPJSC extends MXMLJSC
             Collection<ICompilerProblem> problems) throws InterruptedException,
             ConfigurationException, FileNotFoundException
     {
-        Collection<ICompilerProblem> fatalProblems = applicationProject
-                .getFatalProblems();
+        Collection<ICompilerProblem> fatalProblems = applicationProject.getFatalProblems();
         if (!fatalProblems.isEmpty())
         {
             problems.addAll(fatalProblems);
@@ -308,8 +316,8 @@ public class COMPJSC extends MXMLJSC
         if (config.getOutput() == null)
         {
             final String extension = "." + JSSharedData.OUTPUT_EXTENSION;
-            return FilenameUtils.removeExtension(config.getTargetFile())
-                    .concat(extension);
+            return FilenameUtils.removeExtension(config.getTargetFile()).concat(
+                    extension);
         }
         else
         {
@@ -324,12 +332,11 @@ public class COMPJSC extends MXMLJSC
     }
 
     /**
-     * @author Erik de Bruin
-     * 
      * Get the output class file. This includes the (sub)directory in which the
      * original class file lives. If the directory structure doesn't exist, it
      * is created.
      * 
+     * @author Erik de Bruin
      * @param qname
      * @param outputFolder
      * @return output class file path
@@ -372,7 +379,7 @@ public class COMPJSC extends MXMLJSC
             project.setTargetSettings(settings);
         else
             return false;
-        
+
         target = JSSharedData.backend.createTarget(project,
                 getTargetSettings(), null);
 
@@ -386,7 +393,7 @@ public class COMPJSC extends MXMLJSC
 
         if (targetSettings == null)
             problems.addAll(projectConfigurator.getConfigurationProblems());
-        
+
         return targetSettings;
     }
 
@@ -399,7 +406,7 @@ public class COMPJSC extends MXMLJSC
     @Override
     protected void validateTargetFile() throws ConfigurationException
     {
-    
+
     }
 
     protected String getProgramName()
@@ -411,7 +418,7 @@ public class COMPJSC extends MXMLJSC
     {
         return true;
     }
-    
+
     @Override
     protected TargetType getTargetType()
     {

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/114a06d8/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jsc/JSCJSEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jsc/JSCJSEmitter.java b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jsc/JSCJSEmitter.java
index c888f93..7a75043 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jsc/JSCJSEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jsc/JSCJSEmitter.java
@@ -21,53 +21,7 @@ package org.apache.flex.compiler.internal.codegen.js.jsc;
 
 import java.io.FilterWriter;
 
-import org.apache.flex.compiler.codegen.js.flexjs.IJSFlexJSEmitter;
-import org.apache.flex.compiler.codegen.js.goog.IJSGoogDocEmitter;
-import org.apache.flex.compiler.definitions.IPackageDefinition;
-import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
-import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSDocEmitter;
 import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitter;
-import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitterTokens;
-import org.apache.flex.compiler.internal.codegen.js.goog.JSGoogEmitter;
-import org.apache.flex.compiler.internal.codegen.js.goog.JSGoogEmitterTokens;
-import org.apache.flex.compiler.internal.codegen.js.jx.AccessorEmitter;
-import org.apache.flex.compiler.internal.codegen.js.jx.AsIsEmitter;
-import org.apache.flex.compiler.internal.codegen.js.jx.BinaryOperatorEmitter;
-import org.apache.flex.compiler.internal.codegen.js.jx.BindableEmitter;
-import org.apache.flex.compiler.internal.codegen.js.jx.ClassEmitter;
-import org.apache.flex.compiler.internal.codegen.js.jx.DefinePropertyFunctionEmitter;
-import org.apache.flex.compiler.internal.codegen.js.jx.FieldEmitter;
-import org.apache.flex.compiler.internal.codegen.js.jx.ForEachEmitter;
-import org.apache.flex.compiler.internal.codegen.js.jx.FunctionCallEmitter;
-import org.apache.flex.compiler.internal.codegen.js.jx.IdentifierEmitter;
-import org.apache.flex.compiler.internal.codegen.js.jx.InterfaceEmitter;
-import org.apache.flex.compiler.internal.codegen.js.jx.LiteralEmitter;
-import org.apache.flex.compiler.internal.codegen.js.jx.MemberAccessEmitter;
-import org.apache.flex.compiler.internal.codegen.js.jx.MethodEmitter;
-import org.apache.flex.compiler.internal.codegen.js.jx.ObjectDefinePropertyEmitter;
-import org.apache.flex.compiler.internal.codegen.js.jx.PackageFooterEmitter;
-import org.apache.flex.compiler.internal.codegen.js.jx.PackageHeaderEmitter;
-import org.apache.flex.compiler.internal.codegen.js.jx.SelfReferenceEmitter;
-import org.apache.flex.compiler.internal.codegen.js.jx.SuperCallEmitter;
-import org.apache.flex.compiler.internal.codegen.js.jx.VarDeclarationEmitter;
-import org.apache.flex.compiler.tree.ASTNodeID;
-import org.apache.flex.compiler.tree.as.IASNode;
-import org.apache.flex.compiler.tree.as.IAccessorNode;
-import org.apache.flex.compiler.tree.as.IBinaryOperatorNode;
-import org.apache.flex.compiler.tree.as.IClassNode;
-import org.apache.flex.compiler.tree.as.IDefinitionNode;
-import org.apache.flex.compiler.tree.as.IExpressionNode;
-import org.apache.flex.compiler.tree.as.IForLoopNode;
-import org.apache.flex.compiler.tree.as.IFunctionCallNode;
-import org.apache.flex.compiler.tree.as.IFunctionNode;
-import org.apache.flex.compiler.tree.as.IGetterNode;
-import org.apache.flex.compiler.tree.as.IIdentifierNode;
-import org.apache.flex.compiler.tree.as.IInterfaceNode;
-import org.apache.flex.compiler.tree.as.ILiteralNode;
-import org.apache.flex.compiler.tree.as.IMemberAccessExpressionNode;
-import org.apache.flex.compiler.tree.as.ISetterNode;
-import org.apache.flex.compiler.tree.as.ITypedExpressionNode;
-import org.apache.flex.compiler.tree.as.IVariableNode;
 
 /**
  * Concrete implementation of the 'FlexJS' JavaScript production.
@@ -78,12 +32,13 @@ import org.apache.flex.compiler.tree.as.IVariableNode;
 public class JSCJSEmitter extends JSFlexJSEmitter
 {
 
-    public JSCJSEmitter(FilterWriter out) {
-		super(out);
-		// TODO Auto-generated constructor stub
-	}
+    public JSCJSEmitter(FilterWriter out)
+    {
+        super(out);
+        // TODO Auto-generated constructor stub
+    }
 
-	@Override
+    @Override
     public String formatQualifiedName(String name)
     {
         return name;

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/114a06d8/compiler.jx/src/org/apache/flex/compiler/internal/driver/mxml/jsc/MXMLJSCJSBackend.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/driver/mxml/jsc/MXMLJSCJSBackend.java b/compiler.jx/src/org/apache/flex/compiler/internal/driver/mxml/jsc/MXMLJSCJSBackend.java
index 70fc3a3..18a0388 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/driver/mxml/jsc/MXMLJSCJSBackend.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/driver/mxml/jsc/MXMLJSCJSBackend.java
@@ -36,7 +36,6 @@ import org.apache.flex.compiler.internal.codegen.mxml.MXMLWriter;
 import org.apache.flex.compiler.internal.codegen.mxml.flexjs.MXMLFlexJSBlockWalker;
 import org.apache.flex.compiler.internal.codegen.mxml.jsc.MXMLJSCJSEmitter;
 import org.apache.flex.compiler.internal.driver.js.goog.JSGoogConfiguration;
-import org.apache.flex.compiler.internal.driver.mxml.MXMLBackend;
 import org.apache.flex.compiler.internal.driver.mxml.flexjs.MXMLFlexJSBackend;
 import org.apache.flex.compiler.internal.targets.FlexJSTarget;
 import org.apache.flex.compiler.internal.targets.JSTarget;
@@ -104,7 +103,7 @@ public class MXMLJSCJSBackend extends MXMLFlexJSBackend
         emitter.setDocEmitter(createDocEmitter(emitter));
         return emitter;
     }
-    
+
     @Override
     public IJSWriter createMXMLWriter(IASProject project,
             List<ICompilerProblem> problems, ICompilationUnit compilationUnit,