]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Add many datum and datum size checking in PCD building tools, These checking work...
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 15 Jun 2006 14:41:28 +0000 (14:41 +0000)
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 15 Jun 2006 14:41:28 +0000 (14:41 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@528 6f19259b-4bc3-4df7-8a09-765794883524

EdkNt32Pkg/Nt32.fpd
Tools/Source/GenBuild/org/tianocore/build/pcd/action/CollectPCDAction.java
Tools/Source/GenBuild/org/tianocore/build/pcd/entity/Token.java

index ee494c4ddeaf33923c8ccc54e1773a0b2a29b1ae..8c5f22be249e47d7a1fc9ef55589927cf4b7182a 100644 (file)
             <Token>0x00001009</Token>\r
             <TokenSpaceGuid>00000000-0000-0000-0000-000000000000</TokenSpaceGuid>\r
             <DatumType>VOID*</DatumType>\r
-            <MaxDatumSize>44</MaxDatumSize>\r
+            <MaxDatumSize>52</MaxDatumSize>\r
             <Value>L"..\\..\\Fv\\Fv_Recovery.fd"</Value>\r
           </PcdData>\r
           <PcdData ItemType="FIXED_AT_BUILD">\r
             <Token>0x00011004</Token>\r
             <TokenSpaceGuid>00000000-0000-0000-0000-000000000000</TokenSpaceGuid>\r
             <DatumType>BOOLEAN</DatumType>\r
-            <Value>0</Value>\r
+            <Value>FALSE</Value>\r
           </PcdData>\r
         </PcdBuildDefinition>      \r
       </ModuleSA>\r
             <TokenSpaceGuid>00000000-0000-0000-0000-000000000000</TokenSpaceGuid>\r
             <DatumType>BOOLEAN</DatumType>\r
             <MaxDatumSize>1</MaxDatumSize>\r
-            <Value>0x1</Value>\r
+            <Value>TRUE</Value>\r
           </PcdData>\r
           <PcdData ItemType="PATCHABLE_IN_MODULE">\r
             <C_Name>PcdWinNtBinaryPatch1</C_Name>\r
       <MaxDatumSize>1</MaxDatumSize>\r
       <SkuInfo>\r
         <SkuId>0</SkuId>\r
-        <Value>0</Value>\r
+        <Value>FALSE</Value>\r
       </SkuInfo>\r
     </PcdBuildData>\r
     <PcdBuildData ItemType="DYNAMIC">\r
index 473247f847bf07d2e96a7a344cbd3989111841ca..c9d905047640e9af607358cdc191bf62a69711f8 100644 (file)
@@ -21,6 +21,7 @@ import java.io.BufferedReader;
 import java.io.File;\r
 import java.io.FileReader;\r
 import java.io.IOException;\r
+import java.math.BigInteger;\r
 import java.util.ArrayList;\r
 import java.util.Collections;\r
 import java.util.Comparator;\r
@@ -33,8 +34,8 @@ import org.apache.xmlbeans.XmlException;
 import org.apache.xmlbeans.XmlObject;\r
 import org.tianocore.DynamicPcdBuildDefinitionsDocument;\r
 import org.tianocore.DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions;\r
-import org.tianocore.DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions.PcdBuildData.SkuInfo;\r
 import org.tianocore.DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions.PcdBuildData;\r
+import org.tianocore.DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions.PcdBuildData.SkuInfo;\r
 import org.tianocore.FrameworkModulesDocument;\r
 import org.tianocore.FrameworkPlatformDescriptionDocument;\r
 import org.tianocore.FrameworkPlatformDescriptionDocument.FrameworkPlatformDescription;\r
@@ -1562,10 +1563,11 @@ public class CollectPCDAction {
                      //\r
                      // Check whether the datum size is matched datum type.\r
                      // \r
-                     if ((exceptionString = verifyDatumSize(pcdBuildData.getCName(), \r
-                                                            moduleName,\r
-                                                            maxDatumSize, \r
-                                                            datumType)) != null) {\r
+                     if ((exceptionString = verifyDatum(pcdBuildData.getCName(), \r
+                                                        moduleName,\r
+                                                        datum,\r
+                                                        datumType,\r
+                                                        maxDatumSize)) != null) {\r
                          throw new EntityException(exceptionString);\r
                      }\r
                 }\r
@@ -1701,6 +1703,304 @@ public class CollectPCDAction {
         }\r
     }\r
 \r
+    /**\r
+       Verify the datum value according its datum size and datum type, this\r
+       function maybe moved to FPD verification tools in future.\r
+       \r
+       @param cName\r
+       @param moduleName\r
+       @param datum\r
+       @param datumType\r
+       @param maxDatumSize\r
+       \r
+       @return String\r
+     */\r
+    /***/\r
+    public String verifyDatum(String            cName,\r
+                              String            moduleName,\r
+                              String            datum, \r
+                              Token.DATUM_TYPE  datumType, \r
+                              int               maxDatumSize) {\r
+        String      exceptionString = null;\r
+        int         value;\r
+        BigInteger  value64;\r
+        String      subStr;\r
+\r
+        if (moduleName == null) {\r
+            moduleName = "section <DynamicPcdBuildDefinitions>";\r
+        } else {\r
+            moduleName = "module " + moduleName;\r
+        }\r
+\r
+        if (maxDatumSize == 0) {\r
+            exceptionString = String.format("[FPD file error] You maybe miss <MaxDatumSize> for PCD %s in %s",\r
+                                            cName,\r
+                                            moduleName);\r
+            return exceptionString;\r
+        }\r
+\r
+        switch (datumType) {\r
+        case UINT8:\r
+            if (maxDatumSize != 1) {\r
+                exceptionString = String.format("[FPD file error] The datum type of PCD data %s in %s "+\r
+                                                "is UINT8, but datum size is %d, they are not matched!",\r
+                                                 cName,\r
+                                                 moduleName,\r
+                                                 maxDatumSize);\r
+                return exceptionString;\r
+            }\r
+\r
+            if (datum != null) {\r
+                try {\r
+                    value = Integer.decode(datum);\r
+                } catch (NumberFormatException nfeExp) {\r
+                    exceptionString = String.format("[FPD file error] The datum for PCD %s in %s is not valid "+\r
+                                                    "digital format of UINT8",\r
+                                                    cName,\r
+                                                    moduleName);\r
+                    return exceptionString;\r
+                }\r
+                if (value > 0xFF) {\r
+                    exceptionString = String.format("[FPD file error] The datum for PCD %s in %s is %s exceed"+\r
+                                                    " the max size of UINT8 - 0xFF",\r
+                                                    cName, \r
+                                                    moduleName,\r
+                                                    datum);\r
+                    return exceptionString;\r
+                }\r
+            }\r
+            break;\r
+        case UINT16:\r
+            if (maxDatumSize != 2) {\r
+                exceptionString = String.format("[FPD file error] The datum type of PCD data %s in %s "+\r
+                                                "is UINT16, but datum size is %d, they are not matched!",\r
+                                                 cName,\r
+                                                 moduleName,\r
+                                                 maxDatumSize);\r
+                return exceptionString;\r
+            }\r
+            if (datum != null) {\r
+                try {\r
+                    value = Integer.decode(datum);\r
+                } catch (NumberFormatException nfeExp) {\r
+                    exceptionString = String.format("[FPD file error] The datum for PCD %s in %s is "+\r
+                                                    "not valid digital of UINT16",\r
+                                                    cName,\r
+                                                    moduleName);\r
+                    return exceptionString;\r
+                }\r
+                if (value > 0xFFFF) {\r
+                    exceptionString = String.format("[FPD file error] The datum for PCD %s in %s is %s "+\r
+                                                    "which exceed the range of UINT16 - 0xFFFF",\r
+                                                    cName, \r
+                                                    moduleName,\r
+                                                    datum);\r
+                    return exceptionString;\r
+                }\r
+            }\r
+            break;\r
+        case UINT32:\r
+            if (maxDatumSize != 4) {\r
+                exceptionString = String.format("[FPD file error] The datum type of PCD data %s in %s "+\r
+                                                "is UINT32, but datum size is %d, they are not matched!",\r
+                                                 cName,\r
+                                                 moduleName,\r
+                                                 maxDatumSize);\r
+                return exceptionString;\r
+            }\r
+\r
+            if (datum != null) {\r
+                try {\r
+                    if (datum.length() > 2) {\r
+                        if ((datum.charAt(0) == '0')        && \r
+                            ((datum.charAt(1) == 'x') || (datum.charAt(1) == 'X'))){\r
+                            subStr = datum.substring(2, datum.length());\r
+                            value64 = new BigInteger(subStr, 16);\r
+                        } else {\r
+                            value64 = new BigInteger(datum);\r
+                        }\r
+                    } else {\r
+                        value64 = new BigInteger(datum);\r
+                    }\r
+                } catch (NumberFormatException nfeExp) {\r
+                    exceptionString = String.format("[FPD file error] The datum for PCD %s in %s is not "+\r
+                                                    "valid digital of UINT32",\r
+                                                    cName,\r
+                                                    moduleName);\r
+                    return exceptionString;\r
+                }\r
+\r
+                if (value64.bitLength() > 32) {\r
+                    exceptionString = String.format("[FPD file error] The datum for PCD %s in %s is %s which "+\r
+                                                    "exceed the range of UINT32 - 0xFFFFFFFF",\r
+                                                    cName, \r
+                                                    moduleName,\r
+                                                    datum);\r
+                    return exceptionString;\r
+                }\r
+            }\r
+            break;\r
+        case UINT64:\r
+            if (maxDatumSize != 8) {\r
+                exceptionString = String.format("[FPD file error] The datum type of PCD data %s in %s "+\r
+                                                "is UINT64, but datum size is %d, they are not matched!",\r
+                                                 cName,\r
+                                                 moduleName,\r
+                                                 maxDatumSize);\r
+                return exceptionString;\r
+            }\r
+\r
+            if (datum != null) {\r
+                try {\r
+                    if (datum.length() > 2) {\r
+                        if ((datum.charAt(0) == '0')        && \r
+                            ((datum.charAt(1) == 'x') || (datum.charAt(1) == 'X'))){\r
+                            subStr = datum.substring(2, datum.length());\r
+                            value64 = new BigInteger(subStr, 16);\r
+                        } else {\r
+                            value64 = new BigInteger(datum);\r
+                        }\r
+                    } else {\r
+                        value64 = new BigInteger(datum);\r
+                    }\r
+                } catch (NumberFormatException nfeExp) {\r
+                    exceptionString = String.format("[FPD file error] The datum for PCD %s in %s is not valid"+\r
+                                                    " digital of UINT64",\r
+                                                    cName,\r
+                                                    moduleName);\r
+                    return exceptionString;\r
+                }\r
+\r
+                if (value64.bitLength() > 64) {\r
+                    exceptionString = String.format("[FPD file error] The datum for PCD %s in %s is %s "+\r
+                                                    "exceed the range of UINT64 - 0xFFFFFFFFFFFFFFFF",\r
+                                                    cName, \r
+                                                    moduleName,\r
+                                                    datum);\r
+                    return exceptionString;\r
+                }\r
+            }\r
+            break;\r
+        case BOOLEAN:\r
+            if (maxDatumSize != 1) {\r
+                exceptionString = String.format("[FPD file error] The datum type of PCD data %s in %s "+\r
+                                                "is BOOLEAN, but datum size is %d, they are not matched!",\r
+                                                 cName,\r
+                                                 moduleName,\r
+                                                 maxDatumSize);\r
+                return exceptionString;\r
+            }\r
+\r
+            if (datum != null) {\r
+                if (!(datum.equalsIgnoreCase("TRUE") ||\r
+                     datum.equalsIgnoreCase("FALSE"))) {\r
+                    exceptionString = String.format("[FPD file error] The datum type of PCD data %s in %s "+\r
+                                                    "is BOOELAN, but value is not 'true'/'TRUE' or 'FALSE'/'false'",\r
+                                                    cName,\r
+                                                    moduleName);\r
+                    return exceptionString;\r
+                }\r
+\r
+            }\r
+            break;\r
+        case POINTER:\r
+            if (datum == null) {\r
+                break;\r
+            }\r
+\r
+            char    ch     = datum.charAt(0);\r
+            int     start, end;\r
+            String  strValue;\r
+            //\r
+            // For void* type PCD, only three datum is support:\r
+            // 1) Unicode: string with start char is "L"\r
+            // 2) Ansci: String start char is ""\r
+            // 3) byte array: String start char "{"\r
+            // \r
+            if (ch == 'L') {\r
+                start       = datum.indexOf('\"');\r
+                end         = datum.lastIndexOf('\"');\r
+                if ((start > end)           || \r
+                    (end   > datum.length())||\r
+                    ((start == end) && (datum.length() > 0))) {\r
+                    exceptionString = String.format("The datum type of PCD %s in %s is VOID* and datum is "+\r
+                                                    "a UNICODE string because start with L\", but format maybe"+\r
+                                                    "is not right, correct UNICODE string is L\"...\"!",\r
+                                                    cName,\r
+                                                    moduleName);\r
+                    return exceptionString;\r
+                }\r
+\r
+                strValue    = datum.substring(start + 1, end);\r
+                if ((strValue.length() * 2) > maxDatumSize) {\r
+                    exceptionString = String.format("The datum type of PCD %s in %s is VOID*, and datum is "+\r
+                                                    "a UNICODE string, but the datum size is %d exceed to <MaxDatumSize> : %d",\r
+                                                    cName,\r
+                                                    moduleName,\r
+                                                    strValue.length() * 2, \r
+                                                    maxDatumSize);\r
+                    return exceptionString;\r
+                }\r
+            } else if (ch == '\"'){\r
+                start       = datum.indexOf('\"');\r
+                end         = datum.lastIndexOf('\"');\r
+                if ((start > end)           || \r
+                    (end   > datum.length())||\r
+                    ((start == end) && (datum.length() > 0))) {\r
+                    exceptionString = String.format("The datum type of PCD %s in %s is VOID* and datum is "+\r
+                                                    "a ANSCII string because start with \", but format maybe"+\r
+                                                    "is not right, correct ANSIC string is \"...\"!",\r
+                                                    cName,\r
+                                                    moduleName);\r
+                    return exceptionString;\r
+                }\r
+                strValue    = datum.substring(start + 1, end);\r
+                if ((strValue.length()) > maxDatumSize) {\r
+                    exceptionString = String.format("The datum type of PCD %s in %s is VOID*, and datum is "+\r
+                                                    "a ANSCI string, but the datum size is %d which exceed to <MaxDatumSize> : %d",\r
+                                                    cName,\r
+                                                    moduleName,\r
+                                                    strValue.length(),\r
+                                                    maxDatumSize);\r
+                    return exceptionString;\r
+                }\r
+            } else if (ch =='{') {\r
+                String[]  strValueArray;\r
+\r
+                start           = datum.indexOf('{');\r
+                end             = datum.lastIndexOf('}');\r
+                strValue        = datum.substring(start, end);\r
+                strValueArray   = strValue.split(",");\r
+                if (strValueArray.length > maxDatumSize) {\r
+                    exceptionString = String.format("The datum type of PCD %s in %s is VOID*, and datum is byte"+\r
+                                                    "array, but the number of bytes is %d which exceed to <MaxDatumSzie> : %d!",\r
+                                                    cName,\r
+                                                    moduleName,\r
+                                                    strValueArray.length,\r
+                                                    maxDatumSize);\r
+                    return exceptionString;\r
+                }\r
+            } else {\r
+                exceptionString = String.format("The datum type of PCD %s in %s is VOID*. For VOID* type, you have three format choise:\n "+\r
+                                                "1) UNICODE string: like L\"xxxx\";\r\n"+\r
+                                                "2) ANSIC string: like \"xxx\";\r\n"+\r
+                                                "3) Byte array: like {0x2, 0x45, 0x23}\r\n"+\r
+                                                "But the datum in seems does not following above format!",\r
+                                                cName, \r
+                                                moduleName);\r
+                return exceptionString;\r
+            }\r
+            break;\r
+        default:\r
+            exceptionString = String.format("[FPD file error] For PCD entry %s in %s, datum type is unknown, it should be one of "+\r
+                                            "UINT8, UINT16, UINT32, UINT64, VOID*, BOOLEAN",\r
+                                            cName,\r
+                                            moduleName);\r
+            return exceptionString;\r
+        }\r
+        return null;\r
+    }\r
+\r
     /**\r
        Get dynamic information for a dynamic PCD from <DynamicPcdBuildDefinition> seciton in FPD file.\r
        \r
@@ -1765,81 +2065,6 @@ public class CollectPCDAction {
         return null;\r
     }\r
 \r
-    /**\r
-       Verify the maxDatumSize for a PCD data is matched to Datum type.\r
-       \r
-       @param token             The token instance\r
-       @param moduleName        The module name who use this PCD data.\r
-       @param maxDatumSize      The value of max datum size in FPD file\r
-       @param datumType         The datum type\r
-       \r
-       @return String           if is unmatched, set the exception information\r
-                                as return value, otherwice is null.\r
-    **/\r
-    private String verifyDatumSize(String           cName, \r
-                                   String           moduleName,\r
-                                   int              maxDatumSize, \r
-                                   Token.DATUM_TYPE datumType) {\r
-        String exceptionString = null;\r
-\r
-        if (maxDatumSize == 0) {\r
-            exceptionString = String.format("[FPD file error] You maybe miss <MaxDatumSize> for PCD %s in module %s",\r
-                                            cName,\r
-                                            moduleName);\r
-            return exceptionString;\r
-        }\r
-\r
-        switch (datumType) {\r
-        case UINT8:\r
-            if (maxDatumSize != 1) {\r
-                exceptionString = String.format("[FPD file error] The datum type of PCD data %s in module %s "+\r
-                                                "is UINT8, but datum size is %d, they are not matched!",\r
-                                                cName,\r
-                                                moduleName,\r
-                                                maxDatumSize);\r
-            }\r
-            break;\r
-        case UINT16:\r
-            if (maxDatumSize != 2) {\r
-                exceptionString = String.format("[FPD file error] The datum type of PCD data %s in module %s "+\r
-                                                "is UINT16, but datum size is %d, they are not matched!",\r
-                                                cName,\r
-                                                moduleName,\r
-                                                maxDatumSize);\r
-            }\r
-            break;\r
-        case UINT32:\r
-            if (maxDatumSize != 4) {\r
-                exceptionString = String.format("[FPD file error] the datum type of PCD data %s in module %s "+\r
-                                                "is UINT32, but datum size is %d, they are not matched!",\r
-                                                cName,\r
-                                                moduleName,\r
-                                                maxDatumSize);\r
-            }\r
-            break;\r
-        case UINT64:\r
-            if (maxDatumSize != 8) {\r
-                exceptionString = String.format("[FPD file error] the datum type of PCD data %s in module %s "+\r
-                                                "is UINT64, but datum size is %d, they are not matched!",\r
-                                                cName,\r
-                                                moduleName,\r
-                                                maxDatumSize);\r
-            }\r
-            break;\r
-        case BOOLEAN:\r
-            if (maxDatumSize != 1) {\r
-                exceptionString = String.format("[FPD file error] the datum type of PCD data %s in module %s "+\r
-                                                "is BOOLEAN, but datum size is %d, they are not matched!",\r
-                                                cName,\r
-                                                moduleName,\r
-                                                maxDatumSize);\r
-            }\r
-            break;\r
-        }\r
-\r
-        return exceptionString;\r
-    }\r
-\r
     /**\r
        Update dynamic information for PCD entry.\r
        \r
@@ -1881,7 +2106,11 @@ public class CollectPCDAction {
 \r
         token.datumSize = dynamicInfo.getMaxDatumSize();\r
 \r
-        exceptionString = verifyDatumSize(token.cName, moduleName, token.datumSize, token.datumType);\r
+        exceptionString = verifyDatum(token.cName, \r
+                                      moduleName,\r
+                                      null, \r
+                                      token.datumType, \r
+                                      token.datumSize);\r
         if (exceptionString != null) {\r
             throw new EntityException(exceptionString);\r
         }\r
@@ -1917,6 +2146,14 @@ public class CollectPCDAction {
             // \r
             if (skuInfoList.get(index).getValue() != null) {\r
                 skuInstance.value.setValue(skuInfoList.get(index).getValue());\r
+                if ((exceptionString = verifyDatum(token.cName, \r
+                                                   null, \r
+                                                   skuInfoList.get(index).getValue(), \r
+                                                   token.datumType, \r
+                                                   token.datumSize)) != null) {\r
+                    throw new EntityException(exceptionString);\r
+                }\r
+\r
                 token.skuData.add(skuInstance);\r
 \r
                 //\r
@@ -1926,7 +2163,7 @@ public class CollectPCDAction {
                 if (datum != null) {\r
                     if ((skuInstance.id == 0)                                   &&\r
                         !datum.equalsIgnoreCase(skuInfoList.get(index).getValue())) {\r
-                        exceptionString = "[FPD file error] For dynamic PCD " + token.cName + ", the value in module is " + datum.toString() + " but the "+\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
                         throw new EntityException(exceptionString);\r
@@ -1965,6 +2202,15 @@ public class CollectPCDAction {
                 if (exceptionString != null) {\r
                     throw new EntityException(exceptionString);\r
                 }\r
+\r
+                if ((exceptionString = verifyDatum(token.cName, \r
+                                                   null, \r
+                                                   skuInfoList.get(index).getHiiDefaultValue(), \r
+                                                   token.datumType, \r
+                                                   token.datumSize)) != null) {\r
+                    throw new EntityException(exceptionString);\r
+                }\r
+\r
                 offset = Integer.decode(skuInfoList.get(index).getVariableOffset());\r
                 if (offset > 0xFFFF) {\r
                     throw new EntityException(String.format("[FPD file error] For dynamic PCD %s ,  the variable offset defined in sku %d data "+\r
@@ -2124,11 +2370,11 @@ public class CollectPCDAction {
     **/\r
     public static void main(String argv[]) throws EntityException {\r
         CollectPCDAction ca = new CollectPCDAction();\r
-        ca.setWorkspacePath("m:/tianocore/edk2");\r
-        ca.setFPDFilePath("m:/tianocore/edk2/EdkNt32Pkg/Nt32.fpd");\r
+        ca.setWorkspacePath("m:/tianocore_latest/edk2");\r
+        ca.setFPDFilePath("m:/tianocore_latest/edk2/EdkNt32Pkg/Nt32.fpd");\r
         ca.setActionMessageLevel(ActionMessage.MAX_MESSAGE_LEVEL);\r
         GlobalData.initInfo("Tools" + File.separator + "Conf" + File.separator + "FrameworkDatabase.db",\r
-                            "m:/tianocore/edk2");\r
+                            "m:/tianocore_latest/edk2");\r
         ca.execute();\r
     }\r
 }\r
index 62e2be5cc969a80911e94d83b78a8cb9a7a11138..f5765e1d408fa1e9b7ef2ffc8452235bed26f34d 100644 (file)
@@ -15,11 +15,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 **/  \r
 package org.tianocore.build.pcd.entity;\r
 \r
+import java.math.BigInteger;\r
 import java.util.ArrayList;\r
+import java.util.HashMap;\r
 import java.util.List;\r
-import java.util.UUID;\r
 import java.util.Map;\r
-import java.util.HashMap;\r
+import java.util.UUID;\r
 \r
 import org.tianocore.build.pcd.action.ActionMessage;\r
 import org.tianocore.build.pcd.exception.EntityException;\r
@@ -552,49 +553,76 @@ public class Token {
             dynamicValue = getDefaultSku();\r
             switch (dynamicValue.type) {\r
             case HII_TYPE:\r
-                try {\r
-                    value = Integer.decode(dynamicValue.hiiDefaultValue);\r
-                } catch (NumberFormatException nfEx) {\r
-                    isInteger = false;\r
-                }\r
-                \r
-                if (isInteger && (value == 0)) {\r
-                    return false;\r
-                } else {\r
-                    return true;\r
-                }\r
-\r
+                return !isValidNullValue(dynamicValue.hiiDefaultValue);\r
             case VPD_TYPE:\r
                 return false;\r
-\r
             case DEFAULT_TYPE:\r
-                try{\r
-                    value = Integer.decode(dynamicValue.value);\r
-                } catch (NumberFormatException nfEx) {\r
-                    isInteger = false;\r
-                }\r
+                return !isValidNullValue(dynamicValue.value);\r
+            }\r
+        }\r
+\r
+        return false;\r
+    }\r
 \r
-                if (isInteger && (value == 0)) {\r
-                    return false;\r
+    public boolean isValidNullValue(String judgedValue) {\r
+        int         intValue;\r
+        BigInteger  bigIntValue;\r
+\r
+        switch (datumType) {\r
+        case UINT8:\r
+        case UINT16:\r
+        case UINT32:\r
+            intValue = Integer.decode(judgedValue);\r
+            if (intValue == 0) {\r
+                return true;\r
+            }\r
+            break;\r
+        case UINT64:\r
+            if (judgedValue.length() > 2){\r
+                if ((judgedValue.charAt(0) == '0') && \r
+                    ((judgedValue.charAt(1) == 'x') ||\r
+                     (judgedValue.charAt(1) == 'X'))) {\r
+                    bigIntValue = new BigInteger(judgedValue.substring(2, judgedValue.length()),  16);\r
+                    if (bigIntValue.bitCount() == 0) {\r
+                        return true;\r
+                    }\r
                 } else {\r
+                    bigIntValue = new BigInteger(judgedValue);\r
+                    if (bigIntValue.bitCount() == 0) {\r
+                        return true;\r
+                    }\r
+                }\r
+            } else  {\r
+                bigIntValue = new BigInteger(judgedValue);\r
+                if (bigIntValue.bitCount() == 0) {\r
                     return true;\r
                 }\r
-\r
+            }\r
+            break;\r
+        case BOOLEAN:\r
+            if (judgedValue.equalsIgnoreCase("false")) {\r
+                return true;\r
+            }\r
+            break;\r
+        case POINTER:\r
+            if (judgedValue.equalsIgnoreCase("")        ||\r
+                judgedValue.equalsIgnoreCase("\"\"")   ||\r
+                judgedValue.equalsIgnoreCase("L\"\"")   ||\r
+                (judgedValue.length() == 0)             ||\r
+                judgedValue.equalsIgnoreCase("{}")) {\r
+                return true;\r
             }\r
         }\r
-\r
         return false;\r
     }\r
 \r
-    //\r
-    // TODO: Need scott's confirmation\r
-    // \r
     public boolean isStringType () {\r
         String str = getDefaultSku().value;\r
 \r
-        if (datumType == Token.DATUM_TYPE.POINTER &&\r
-            str.startsWith("L\"") && \r
-            str.endsWith("\"")) {\r
+        //\r
+        // BUGBUG: need scott confirmation.\r
+        // \r
+        if (datumType == Token.DATUM_TYPE.POINTER) {\r
             return true;\r
         }\r
 \r