]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java
Update GlobalData, SPD, SurfaceAreaQuery to using EdkException.
[mirror_edk2.git] / Tools / Source / GenBuild / org / tianocore / build / global / SurfaceAreaQuery.java
index 3eb024463ab84b54806722647ea0b8388f741ee1..daf23092584cfc978e8286a94ba0c3caad957f4c 100644 (file)
@@ -62,6 +62,7 @@ import org.tianocore.ProtocolsDocument.Protocols.Protocol;
 import org.tianocore.ProtocolsDocument.Protocols.ProtocolNotify;\r
 import org.tianocore.PcdDriverTypes;\r
 \r
+import org.tianocore.common.exception.EdkException;\r
 import org.tianocore.common.logger.EdkLog;\r
 import org.tianocore.build.id.FpdModuleIdentification;\r
 import org.tianocore.build.id.ModuleIdentification;\r
@@ -556,7 +557,7 @@ public class SurfaceAreaQuery {
      * @returns package name list if elements are found at the known xpath\r
      * @returns null if nothing is there\r
      */\r
-    public PackageIdentification[] getDependencePkg(String arch) {\r
+    public PackageIdentification[] getDependencePkg(String arch) throws EdkException {\r
         String[] xPath;\r
         String packageGuid = null;\r
         String packageVersion = null;\r
@@ -579,19 +580,13 @@ public class SurfaceAreaQuery {
             if (arch == null || archList == null || contains(archList, arch)) {\r
                 packageGuid = item.getPackageGuid();\r
                 packageVersion = item.getPackageVersion();\r
-                packageIdList.add(new PackageIdentification(null, packageGuid,\r
-                    packageVersion));\r
+                PackageIdentification pkgId = new PackageIdentification(null, packageGuid, packageVersion);\r
+                GlobalData.refreshPackageIdentification(pkgId);\r
+                packageIdList.add(pkgId);\r
             }\r
         }\r
 \r
-        //\r
-        //  transfer packageIdentification list to array.\r
-        //\r
-        PackageIdentification[] packageIdArray = new PackageIdentification[packageIdList.size()];\r
-        for (int i = 0; i < packageIdList.size(); i++) {\r
-            packageIdArray[i] = new PackageIdentification(null, packageIdList.get(i).getGuid(),packageIdList.get(i).getVersion());\r
-        }\r
-        return packageIdArray;\r
+        return packageIdList.toArray(new PackageIdentification[packageIdList.size()]);\r
     }\r
 \r
     /**\r
@@ -1107,7 +1102,7 @@ public class SurfaceAreaQuery {
      *          xpath\r
      * @returns null if nothing is there\r
      */\r
-    public ModuleIdentification[] getLibraryInstance(String arch) {\r
+    public ModuleIdentification[] getLibraryInstance(String arch) throws EdkException {\r
         String[] xPath;\r
         String saGuid = null;\r
         String saVersion = null;\r
@@ -1144,7 +1139,9 @@ public class SurfaceAreaQuery {
                     saVersion);\r
             PackageIdentification pkgId = new PackageIdentification(null,\r
                     pkgGuid, pkgVersion);\r
+            GlobalData.refreshPackageIdentification(pkgId);\r
             saId.setPackage(pkgId);\r
+            GlobalData.refreshModuleIdentification(saId);\r
 \r
             saIdList[i] = saId;\r
 \r
@@ -1308,7 +1305,7 @@ public class SurfaceAreaQuery {
      * @returns ModuleSA objects list if elements are found at the known xpath\r
      * @returns Empty ModuleSA list if nothing is there\r
      */\r
-    public Map<FpdModuleIdentification, Map<String, XmlObject>> getFpdModules() {\r
+    public Map<FpdModuleIdentification, Map<String, XmlObject>> getFpdModules() throws EdkException {\r
         String[] xPath = new String[] { "/FrameworkModules/ModuleSA" };\r
         Object[] result = get("PlatformSurfaceArea", xPath);\r
         String arch = null;\r
@@ -1362,8 +1359,10 @@ public class SurfaceAreaQuery {
             // identification.\r
             //\r
             PackageIdentification pkgId = new PackageIdentification(null, pkgGuid, pkgVersion);\r
+            GlobalData.refreshPackageIdentification(pkgId);\r
             ModuleIdentification saId = new ModuleIdentification(null, saGuid, saVersion);\r
-\r
+            GlobalData.refreshModuleIdentification(saId);\r
+            \r
             saId.setPackage(pkgId);\r
 \r
             //\r