Change return value of getGuidInfo from globaldata. Now only guid string is returned.
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Sun, 6 Aug 2006 08:18:32 +0000 (08:18 +0000)
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Sun, 6 Aug 2006 08:18:32 +0000 (08:18 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1195 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Source/GenBuild/org/tianocore/build/global/GlobalData.java
Tools/Source/GenBuild/org/tianocore/build/pcd/action/PlatformPcdPreprocessActionForBuilding.java
Tools/Source/PcdTools/org/tianocore/pcd/action/PlatformPcdPreprocessAction.java

index d078002..d83114a 100644 (file)
@@ -779,8 +779,8 @@ public class GlobalData {
     //\r
     // For PCD get tokenSpaceGUid\r
     //\r
-    public synchronized static String[] getGuidInfoFromCname(String cName){\r
-        String cNameGuid[] = null;\r
+    public synchronized static String getGuidInfoFromCname(String cName){\r
+        String cNameGuid = null;\r
         String guid = null;\r
         Set set = spdTable.keySet();\r
         Iterator iter = set.iterator();\r
@@ -793,9 +793,7 @@ public class GlobalData {
             Spd spd = (Spd) spdTable.get(iter.next());\r
             guid = spd.getGuidFromCname(cName);\r
             if (guid != null){\r
-                cNameGuid = new String[2];\r
-                cNameGuid[0] = cName;\r
-                cNameGuid[1] = guid;\r
+                cNameGuid = guid;\r
                 break;\r
             }\r
         }\r
index 7dd9088..69be07f 100644 (file)
@@ -161,12 +161,12 @@ public class PlatformPcdPreprocessActionForBuilding extends PlatformPcdPreproces
 \r
       @param guidCName      Guid CName string.\r
 \r
-      @return String[]      Guid information from SPD file.\r
+      @return String        Guid information from SPD file.\r
       @throws PlatformPcdPreprocessException\r
                             Fail to get Guid information from SPD file.\r
     **/\r
-    public String[] getGuidInfoFromSpd(String guidCName) throws PlatformPcdPreprocessException {\r
-        String[] tokenSpaceStrRet = null;\r
+    public String getGuidInfoFromSpd(String guidCName) throws PlatformPcdPreprocessException {\r
+        String tokenSpaceStrRet = null;\r
         try {\r
             tokenSpaceStrRet = GlobalData.getGuidInfoFromCname(guidCName);\r
         } catch ( Exception e ) {\r
@@ -590,7 +590,7 @@ public class PlatformPcdPreprocessActionForBuilding extends PlatformPcdPreproces
         String dynamicPrimaryKey = null;\r
         DynamicPcdBuildDefinitions                    dynamicPcdBuildDefinitions = null;\r
         List<DynamicPcdBuildDefinitions.PcdBuildData> dynamicPcdBuildDataArray   = null;\r
-        String[]                                      tokenSpaceStrRet           = null;\r
+        String                                        tokenSpaceStrRet           = null;\r
 \r
         //\r
         // If FPD document is not be opened, open and initialize it.\r
@@ -618,7 +618,7 @@ public class PlatformPcdPreprocessActionForBuilding extends PlatformPcdPreproces
 \r
         dynamicPcdBuildDataArray = dynamicPcdBuildDefinitions.getPcdBuildDataList();\r
         for (index = 0; index < dynamicPcdBuildDataArray.size(); index ++) {\r
-            tokenSpaceStrRet = this.getGuidInfoFromSpd(dynamicPcdBuildDataArray.get(index).getTokenSpaceGuidCName());\r
+            tokenSpaceStrRet = getGuidInfoFromSpd(dynamicPcdBuildDataArray.get(index).getTokenSpaceGuidCName());\r
 \r
             if (tokenSpaceStrRet == null) {\r
                 exceptionString = "Fail to get token space guid for token " + dynamicPcdBuildDataArray.get(index).getCName();\r
@@ -627,7 +627,7 @@ public class PlatformPcdPreprocessActionForBuilding extends PlatformPcdPreproces
             }\r
 \r
             dynamicPrimaryKey = Token.getPrimaryKeyString(dynamicPcdBuildDataArray.get(index).getCName(),\r
-                                                          tokenSpaceStrRet[1]);\r
+                                                          tokenSpaceStrRet);\r
             if (dynamicPrimaryKey.equalsIgnoreCase(token.getPrimaryKeyString())) {\r
                 return dynamicPcdBuildDataArray.get(index);\r
             }\r
index ac346d6..f2d5247 100644 (file)
@@ -96,11 +96,11 @@ public abstract class PlatformPcdPreprocessAction {
 \r
        @param guidCName the CName of GUID\r
 \r
-       @return String[]      Guid information from SPD file.\r
+       @return String        Guid information from SPD file.\r
        @throws PlatformPcdPreprocessException\r
                             Fail to get Guid information from SPD file.\r
     **/\r
-    public abstract String[]                getGuidInfoFromSpd(String guidCName)\r
+    public abstract String                  getGuidInfoFromSpd(String guidCName)\r
                                             throws PlatformPcdPreprocessException;\r
 \r
     /**\r
@@ -188,7 +188,7 @@ public abstract class PlatformPcdPreprocessAction {
         String                              moduleName        = null;\r
         String                              datum             = null;\r
         int                                 maxDatumSize      = 0;\r
-        String[]                            tokenSpaceStrRet  = null;\r
+        String                              tokenSpaceStrRet  = null;\r
 \r
         //\r
         // ----------------------------------------------\r
@@ -239,7 +239,7 @@ public abstract class PlatformPcdPreprocessAction {
                     continue;\r
                 }\r
 \r
-                primaryKey   = Token.getPrimaryKeyString(pcdBuildData.getCName(), tokenSpaceStrRet[1]);\r
+                primaryKey   = Token.getPrimaryKeyString(pcdBuildData.getCName(), tokenSpaceStrRet);\r
                 pcdType      = Token.getPcdTypeFromString(pcdBuildData.getItemType().toString());\r
                 datumType    = Token.getdatumTypeFromString(pcdBuildData.getDatumType().toString());\r
                 tokenNumber  = Long.decode(pcdBuildData.getToken().toString());\r
@@ -408,7 +408,7 @@ public abstract class PlatformPcdPreprocessAction {
                     // If the token is not in database, create a new token instance and add\r
                     // a usage instance into this token in database.\r
                     //\r
-                    tokenSpaceStrRet = this.getGuidInfoFromSpd(pcdBuildData.getTokenSpaceGuidCName());\r
+                    tokenSpaceStrRet = getGuidInfoFromSpd(pcdBuildData.getTokenSpaceGuidCName());\r
 \r
                     if (tokenSpaceStrRet == null) {\r
                         putError("Fail to get Token space guid for token" + token.cName +\r
@@ -420,7 +420,7 @@ public abstract class PlatformPcdPreprocessAction {
                         continue;\r
                     }\r
 \r
-                    token = new Token(pcdBuildData.getCName(), tokenSpaceStrRet[1]);\r
+                    token = new Token(pcdBuildData.getCName(), tokenSpaceStrRet);\r
 \r
                     token.datumType     = datumType;\r
                     token.tokenNumber   = tokenNumber;\r
@@ -512,7 +512,7 @@ public abstract class PlatformPcdPreprocessAction {
         boolean             hasSkuId0       = false;\r
         long                tokenNumber     = 0;\r
         String              hiiDefaultValue = null;\r
-        String[]            variableGuidString = null;\r
+        String              variableGuidString = null;\r
 \r
         List<DynamicPcdBuildDefinitions.PcdBuildData.SkuInfo>   skuInfoList = null;\r
         DynamicPcdBuildDefinitions.PcdBuildData                 dynamicInfo = null;\r
@@ -687,7 +687,7 @@ public abstract class PlatformPcdPreprocessAction {
                 }\r
 \r
                 skuInstance.value.setHiiData(varNameList,\r
-                                             translateSchemaStringToUUID(variableGuidString[1]),\r
+                                             translateSchemaStringToUUID(variableGuidString),\r
                                              skuInfoList.get(index).getVariableOffset(),\r
                                              skuInfoList.get(index).getHiiDefaultValue().toString());\r
                 token.skuData.add(skuInstance);\r
@@ -738,8 +738,8 @@ public abstract class PlatformPcdPreprocessAction {
         String  temp;\r
         String  exceptionString;\r
         String  hiiDefaultValue;\r
-        String  tokenSpaceStrRet[];\r
-        String  variableGuidString[];\r
+        String  tokenSpaceStrRet;\r
+        String  variableGuidString;\r
 \r
         dynamicPcdBuildDataArray = getAllDynamicPcdInfoFromFpd();\r
         if (dynamicPcdBuildDataArray == null) {\r
@@ -748,7 +748,7 @@ public abstract class PlatformPcdPreprocessAction {
 \r
         for (index2 = 0; index2 < dynamicPcdBuildDataArray.size(); index2++) {\r
             pcdBuildData = dynamicPcdBuildDataArray.get(index2);\r
-            tokenSpaceStrRet = this.getGuidInfoFromSpd(pcdBuildData.getTokenSpaceGuidCName());\r
+            tokenSpaceStrRet = getGuidInfoFromSpd(pcdBuildData.getTokenSpaceGuidCName());\r
 \r
             if (tokenSpaceStrRet == null) {\r
                 putError("Fail to get Token space guid for token" + pcdBuildData.getCName());\r
@@ -756,7 +756,7 @@ public abstract class PlatformPcdPreprocessAction {
             }\r
 \r
             primaryKey = Token.getPrimaryKeyString(pcdBuildData.getCName(),\r
-                                                   tokenSpaceStrRet[1]);\r
+                                                   tokenSpaceStrRet);\r
 \r
             if (pcdDbManager.isTokenInDatabase(primaryKey)) {\r
                 continue;\r
@@ -772,7 +772,7 @@ public abstract class PlatformPcdPreprocessAction {
             //\r
             // Create new token for unreference dynamic PCD token\r
             //\r
-            token           = new Token(pcdBuildData.getCName(), tokenSpaceStrRet[1]);\r
+            token           = new Token(pcdBuildData.getCName(), tokenSpaceStrRet);\r
             token.datumSize = pcdBuildData.getMaxDatumSize();\r
 \r
 \r
@@ -886,7 +886,7 @@ public abstract class PlatformPcdPreprocessAction {
                     //\r
                     // Get variable guid string according to the name of guid which will be mapped into a GUID in SPD file.\r
                     //\r
-                    variableGuidString = this.getGuidInfoFromSpd(skuInfoList.get(index).getVariableGuid().toString());\r
+                    variableGuidString = getGuidInfoFromSpd(skuInfoList.get(index).getVariableGuid().toString());\r
                     if (variableGuidString == null) {\r
                         exceptionString = String.format("In FPD file, for dynamic PCD %s,  the variable guid %s can be found in all SPD file!",\r
                                                         token.cName,\r
@@ -904,7 +904,7 @@ public abstract class PlatformPcdPreprocessAction {
                     }\r
 \r
                     skuInstance.value.setHiiData(varNameList,\r
-                                                 translateSchemaStringToUUID(variableGuidString[1]),\r
+                                                 translateSchemaStringToUUID(variableGuidString),\r
                                                  skuInfoList.get(index).getVariableOffset(),\r
                                                  skuInfoList.get(index).getHiiDefaultValue().toString());\r
                     token.skuData.add(skuInstance);\r