]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFrameworkModules.java
Fix the invalid warning message when user add a module that does not support platform...
[mirror_edk2.git] / Tools / Java / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / platform / ui / FpdFrameworkModules.java
index d8b193413bb60276c5508bed42de3e4acdfc6a01..00243c2460a1f22ca7599186d3fb69b9eed91a54 100644 (file)
@@ -389,18 +389,22 @@ public class FpdFrameworkModules extends IInternalFrame {
         String path = modelAllModules.getValueAt(selectedRow, pathColForAllModTable) + "";\r
         ModuleIdentification mi = miList.get(selectedRow);\r
         Vector<String> vArchs = null;\r
-        try {\r
-            vArchs = WorkspaceProfile.getModuleSupArchs(mi);\r
-        }\r
-        catch (Exception exp) {\r
-            JOptionPane.showMessageDialog(frame, exp.getMessage());\r
-        }\r
+\r
+        vArchs = WorkspaceProfile.getModuleSupArchs(mi);\r
 \r
         if (vArchs == null) {\r
             JOptionPane.showMessageDialog(frame, "No Supported Architectures specified in MSA file.");\r
             return;\r
         }\r
 \r
+        Vector<Object> platformSupArch = new Vector<Object>();\r
+        ffc.getPlatformDefsSupportedArchs(platformSupArch);\r
+        platformSupArch.retainAll(vArchs);\r
+        if (platformSupArch.size() == 0) {\r
+            JOptionPane.showMessageDialog(frame, "This Module does not support this platform architectures.");\r
+            return;\r
+        }\r
+        \r
         String archsAdded = "";\r
         String mg = mi.getGuid();\r
         String mv = mi.getVersion();\r
@@ -434,7 +438,7 @@ public class FpdFrameworkModules extends IInternalFrame {
         //\r
         // check whether archs conform to SupArch of platform.\r
         //\r
-        Vector<Object> platformSupArch = new Vector<Object>();\r
+        platformSupArch.removeAllElements();\r
         ffc.getPlatformDefsSupportedArchs(platformSupArch);\r
         vArchs.retainAll(platformSupArch);\r
         //\r