flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erikdebr...@apache.org
Subject [07/11] git commit: [flex-falcon] [refs/heads/develop] - Fetch and store all interface "imports" for use during the initial writing of the FlexJS classes
Date Tue, 05 Nov 2013 12:45:33 GMT
Fetch and store all interface "imports" for use during the initial writing of the FlexJS classes

Signed-off-by: Erik de Bruin <erik@ixsoftware.nl>


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

Branch: refs/heads/develop
Commit: 765a8c2f7399f68ba3846ccd7ba96613bb40ecd8
Parents: 7e6c110
Author: Erik de Bruin <erik@ixsoftware.nl>
Authored: Tue Nov 5 12:16:25 2013 +0100
Committer: Erik de Bruin <erik@ixsoftware.nl>
Committed: Tue Nov 5 12:16:25 2013 +0100

----------------------------------------------------------------------
 .../internal/projects/FlexJSProject.java        | 38 ++++++++++++++++++++
 1 file changed, 38 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/765a8c2f/compiler.jx/src/org/apache/flex/compiler/internal/projects/FlexJSProject.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/projects/FlexJSProject.java
b/compiler.jx/src/org/apache/flex/compiler/internal/projects/FlexJSProject.java
index 0a69124..d3ee538 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/projects/FlexJSProject.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/projects/FlexJSProject.java
@@ -49,6 +49,7 @@ public class FlexJSProject extends FlexProject
         MXMLClassDefinitionNode.GENERATED_ID_BASE = MXMLFlexJSEmitterTokens.ID_PREFIX.getToken();
     }
 
+    private HashMap<ICompilationUnit, HashMap<String, String>> interfaces = new
HashMap<ICompilationUnit, HashMap<String, String>>();
     private HashMap<ICompilationUnit, HashMap<String, DependencyType>> requires
= new HashMap<ICompilationUnit, HashMap<String, DependencyType>>();
 
     public ICompilationUnit mainCU;
@@ -86,9 +87,46 @@ public class FlexJSProject extends FlexProject
                     reqs.put(qname, dt);
             }
         }
+        else
+        {
+            if (from != to)
+            {
+                HashMap<String, String> interfacesArr;
+                
+                if (interfaces.containsKey(from))
+                {
+                    interfacesArr = interfaces.get(from);
+                }
+                else
+                {
+                    interfacesArr = new HashMap<String, String>();
+                    interfaces.put(from, interfacesArr);
+                }
+                
+                if (!interfacesArr.containsKey(qname))
+                {
+                    interfacesArr.put(qname, qname);
+                }
+            }
+        }
+        
         super.addDependency(from, to, dt, qname);
     }
 
+    public ArrayList<String> getInterfaces(ICompilationUnit from)
+    {
+        if (interfaces.containsKey(from))
+        {
+            HashMap<String, String> map = interfaces.get(from);
+            ArrayList<String> arr = new ArrayList<String>();
+            Set<String> cus = map.keySet();
+            for (String s : cus)
+                arr.add(s);
+            return arr;
+        }
+        return null;
+    }
+
     public ArrayList<String> getRequires(ICompilationUnit from)
     {
         if (requires.containsKey(from))


Mime
View raw message