]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/GenBuild/org/tianocore/build/pcd/action/CollectPCDAction.java
1) Move almost new schema related to PCD on branch to transition scheme in main trunk.
[mirror_edk2.git] / Tools / Source / GenBuild / org / tianocore / build / pcd / action / CollectPCDAction.java
index 92f320bc3557a07979f3ac3b7bd4fd5060db3495..f9de63fc0d208173a1e1ba686027e418ed80f449 100644 (file)
@@ -1530,7 +1530,11 @@ public class CollectPCDAction {
                 pcdType      = Token.getpcdTypeFromString(pcdBuildData.getItemType().toString());\r
                 datumType    = Token.getdatumTypeFromString(pcdBuildData.getDatumType().toString());\r
                 tokenNumber  = Integer.decode(pcdBuildData.getToken().toString());\r
-                datum        = pcdBuildData.getValue();\r
+                if (pcdBuildData.getValue() != null) {\r
+                    datum = pcdBuildData.getValue().toString();\r
+                } else {\r
+                    datum = null;\r
+                }\r
                 maxDatumSize = pcdBuildData.getMaxDatumSize();\r
 \r
                 if ((pcdType    == Token.PCD_TYPE.FEATURE_FLAG) &&\r
@@ -2128,6 +2132,7 @@ public class CollectPCDAction {
         boolean             hasSkuId0       = false;\r
         Token.PCD_TYPE      pcdType         = Token.PCD_TYPE.UNKNOWN;\r
         int                 tokenNumber     = 0;\r
+        String              hiiDefaultValue = null;\r
 \r
         List<DynamicPcdBuildDefinitions.PcdBuildData.SkuInfo>   skuInfoList = null;\r
         DynamicPcdBuildDefinitions.PcdBuildData                 dynamicInfo = null;\r
@@ -2198,10 +2203,10 @@ public class CollectPCDAction {
             // Judge whether is DefaultGroup at first, because most case is DefautlGroup.\r
             // \r
             if (skuInfoList.get(index).getValue() != null) {\r
-                skuInstance.value.setValue(skuInfoList.get(index).getValue());\r
+                skuInstance.value.setValue(skuInfoList.get(index).getValue().toString());\r
                 if ((exceptionString = verifyDatum(token.cName, \r
                                                    null, \r
-                                                   skuInfoList.get(index).getValue(), \r
+                                                   skuInfoList.get(index).getValue().toString()\r
                                                    token.datumType, \r
                                                    token.datumSize)) != null) {\r
                     throw new EntityException(exceptionString);\r
@@ -2215,7 +2220,7 @@ public class CollectPCDAction {
                 // \r
                 if (datum != null) {\r
                     if ((skuInstance.id == 0)                                   &&\r
-                        !datum.equalsIgnoreCase(skuInfoList.get(index).getValue())) {\r
+                        !datum.toString().equalsIgnoreCase(skuInfoList.get(index).getValue().toString())) {\r
                         exceptionString = "[FPD file error] For dynamic PCD " + token.cName + ", the value in module " + moduleName + " is " + datum.toString() + " but the "+\r
                                           "value of sku 0 data in <DynamicPcdBuildDefinition> is " + skuInstance.value.value + ". They are must be same!"+\r
                                           " or you could not define value for a dynamic PCD in every <ModuleSA>!"; \r
@@ -2255,10 +2260,16 @@ public class CollectPCDAction {
                 if (exceptionString != null) {\r
                     throw new EntityException(exceptionString);\r
                 }\r
+                \r
+                if (skuInfoList.get(index).getHiiDefaultValue() != null) {\r
+                    hiiDefaultValue = skuInfoList.get(index).getHiiDefaultValue().toString();\r
+                } else {\r
+                    hiiDefaultValue = null;\r
+                }\r
 \r
                 if ((exceptionString = verifyDatum(token.cName, \r
                                                    null, \r
-                                                   skuInfoList.get(index).getHiiDefaultValue()\r
+                                                   hiiDefaultValue\r
                                                    token.datumType, \r
                                                    token.datumSize)) != null) {\r
                     throw new EntityException(exceptionString);\r
@@ -2275,7 +2286,7 @@ public class CollectPCDAction {
                 skuInstance.value.setHiiData(skuInfoList.get(index).getVariableName(),\r
                                              translateSchemaStringToUUID(skuInfoList.get(index).getVariableGuid().toString()),\r
                                              skuInfoList.get(index).getVariableOffset(),\r
-                                             skuInfoList.get(index).getHiiDefaultValue());\r
+                                             skuInfoList.get(index).getHiiDefaultValue().toString());\r
                 token.skuData.add(skuInstance);\r
                 continue;\r
             }\r