- isFound = false;\r
- for (index = 0; index < pcdDynamicBuildDataArray.size(); index ++) {\r
- if (pcdDynamicBuildDataArray.get(index).getTokenSpaceGuidList().size() != 0) {\r
- primaryKey = Token.getPrimaryKeyString(pcdDynamicBuildDataArray.get(index).getCName(), \r
- translateSchemaStringToUUID(pcdDynamicBuildDataArray.get(index).getTokenSpaceGuidList().get(0)));\r
- } else {\r
- primaryKey = Token.getPrimaryKeyString(pcdDynamicBuildDataArray.get(index).getCName(), \r
- translateSchemaStringToUUID(null));\r
+ 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
+ switch (datumType) {\r
+ case UINT8:\r
+ if (maxDatumSize != 1) {\r
+ exceptionString = String.format("In FPD file, 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("In FPD file, 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("In FPD file, 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