Replaced set*(null) with unset*() to clear empty attributes that were causing invalid...
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / packaging / ui / SpdFileContents.java
index ca3a4dc..2aaf6e2 100644 (file)
@@ -336,16 +336,26 @@ public class SpdFileContents {
             lc.setIncludeHeader(hdr);\r
             lc.setHelpText(hlp);\r
             if (clsUsage != null) {\r
-                lc.setRecommendedInstanceGuid(clsUsage);\r
-            }\r
-            if (instanceVer != null){\r
+              lc.setRecommendedInstanceGuid(clsUsage);\r
+              if (instanceVer != null){\r
                 lc.setRecommendedInstanceVersion(instanceVer);\r
+              } else {\r
+                lc.unsetRecommendedInstanceVersion();\r
+              }\r
+            } else {\r
+              lc.unsetRecommendedInstanceGuid();\r
+              lc.unsetRecommendedInstanceVersion();\r
             }\r
+\r
             if (stringToList(hdrAttribArch) != null){\r
-                lc.setSupArchList(stringToList(hdrAttribArch));\r
+              lc.setSupArchList(stringToList(hdrAttribArch));\r
+            } else {\r
+              lc.unsetSupArchList();\r
             }\r
             if (stringToList(hdrAttribModType) != null){\r
-                lc.setSupModuleList(stringToList(hdrAttribModType));\r
+              lc.setSupModuleList(stringToList(hdrAttribModType));\r
+            } else {\r
+              lc.unsetSupModuleList();\r
             }\r
         }\r
         \r
@@ -390,19 +400,19 @@ public class SpdFileContents {
                 e.setGuidTypeList(stringToList(guidTypeList));\r
             }\r
             else{\r
-                e.setGuidTypeList(null);\r
+                e.unsetGuidTypeList();\r
             }\r
             if (stringToList(archList) != null){\r
                 e.setSupArchList(stringToList(archList));\r
             }\r
             else{\r
-                e.setSupArchList(null);\r
+                e.unsetSupArchList();\r
             }\r
             if (stringToList(modTypeList) != null) {\r
                 e.setSupModuleList(stringToList(modTypeList));\r
             }\r
             else{\r
-                e.setSupModuleList(null);\r
+                e.unsetSupModuleList();\r
             }\r
             \r
         }\r
@@ -430,13 +440,13 @@ public class SpdFileContents {
                 e.setSupArchList(stringToList(archList));\r
             }\r
             else{\r
-                e.setSupArchList(null);\r
+                e.unsetSupArchList();\r
             }\r
             if (stringToList(modTypeList) != null) {\r
                 e.setSupModuleList(stringToList(modTypeList));\r
             }\r
             else{\r
-                e.setSupModuleList(null);\r
+                e.unsetSupModuleList();\r
             }\r
         }\r
         cursor.dispose();\r
@@ -463,13 +473,13 @@ public class SpdFileContents {
                 e.setSupArchList(stringToList(archList));\r
             }\r
             else{\r
-                e.setSupArchList(null);\r
+                e.unsetSupArchList();\r
             }\r
             if (stringToList(modTypeList) != null) {\r
                 e.setSupModuleList(stringToList(modTypeList));\r
             }\r
             else{\r
-                e.setSupModuleList(null);\r
+                e.unsetSupModuleList();\r
             }\r
         }\r
         cursor.dispose();\r
@@ -580,12 +590,14 @@ public class SpdFileContents {
                 libClass[i][1] = lc.getIncludeHeader();\r
                 libClass[i][2] = lc.getHelpText();\r
 // LAH added logic so you cannot set the version unless the GUID is defined.\r
+/* LAH do not set now\r
                 if (lc.getRecommendedInstanceGuid() != null) {\r
                   libClass[i][3] = lc.getRecommendedInstanceGuid();\r
                   if (lc.getRecommendedInstanceVersion() != null) {\r
                     libClass[i][4] = lc.getRecommendedInstanceVersion();\r
                   }\r
                 }\r
+*/\r
                 if (lc.getSupArchList() != null) {\r
                     libClass[i][5] = listToString(lc.getSupArchList());\r
                 }\r
@@ -967,17 +979,21 @@ public class SpdFileContents {
         lc.setIncludeHeader(clsIncludeFile);\r
         lc.setHelpText(help);\r
 // LAH added logic so you cannot set the version unless the GUID is defined.\r
+/* LAH\r
         if (clsUsage != null) {\r
           lc.setRecommendedInstanceGuid(clsUsage);\r
           if (instanceVer != null) {\r
             lc.setRecommendedInstanceVersion(instanceVer);\r
           }\r
         }\r
+*/\r
         if (hdrAttribArch != null) {\r
             lc.setSupArchList(stringToList(hdrAttribArch));\r
         }\r
         if (hdrAttribModType != null) {\r
-            lc.setSupModuleList(stringToList(hdrAttribModType));\r
+          lc.setSupModuleList(stringToList(hdrAttribModType));\r
+        } else {\r
+          lc.unsetSupModuleList();\r
         }\r
         \r
     }\r
@@ -1260,10 +1276,14 @@ public class SpdFileContents {
         pe.setTokenSpaceGuidCName(spaceGuid);\r
         pe.setHelpText(help);\r
         if (archList != null){\r
-            pe.setSupArchList(stringToList(archList));\r
+          pe.setSupArchList(stringToList(archList));\r
+        } else {\r
+          pe.unsetSupArchList();\r
         }\r
         if (modTypeList != null){\r
-            pe.setSupModuleList(stringToList(modTypeList));\r
+          pe.setSupModuleList(stringToList(modTypeList));\r
+        } else {\r
+          pe.unsetSupModuleList();\r
         }\r
     }\r
 \r