Rewrote the error message output when module cannnot be found in any packages.
authorjwang36 <jwang36@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 22 Dec 2006 09:59:49 +0000 (09:59 +0000)
committerjwang36 <jwang36@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 22 Dec 2006 09:59:49 +0000 (09:59 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2133 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Java/Source/GenBuild/org/tianocore/build/global/GlobalData.java
Tools/Java/Source/GenBuild/org/tianocore/build/id/ModuleIdentification.java

index d339043..77beb85 100644 (file)
@@ -302,19 +302,19 @@ public class GlobalData {
         PackageIdentification packageId = null;\r
         Iterator iter = packageList.iterator();\r
         while (iter.hasNext()) {\r
         PackageIdentification packageId = null;\r
         Iterator iter = packageList.iterator();\r
         while (iter.hasNext()) {\r
-            packageId = (PackageIdentification)iter.next();\r
-            moduleId.setPackage(packageId);\r
-            Spd spd = spdTable.get(packageId);\r
+            PackageIdentification pid = (PackageIdentification)iter.next();\r
+            Spd spd = spdTable.get(pid);\r
             File tempMsaFile = null;\r
             if ((tempMsaFile = spd.getModuleFile(moduleId)) != null ) {\r
                 if (tempMsaFile.getParent().equalsIgnoreCase(moduleId.getMsaFile().getParent())) {\r
             File tempMsaFile = null;\r
             if ((tempMsaFile = spd.getModuleFile(moduleId)) != null ) {\r
                 if (tempMsaFile.getParent().equalsIgnoreCase(moduleId.getMsaFile().getParent())) {\r
+                    packageId = pid;\r
                     break ;\r
                 }\r
                 tempMsaFile = null;\r
             }\r
         }\r
         if (packageId == null){\r
                     break ;\r
                 }\r
                 tempMsaFile = null;\r
             }\r
         }\r
         if (packageId == null){\r
-            throw new EdkException("Can't find Module [" + moduleId.getName() + "] in any SPD package!");\r
+            throw new EdkException("Can't find Module [" + moduleId.getName() + "] in any package!");\r
         } else {\r
             return packageId;\r
         }\r
         } else {\r
             return packageId;\r
         }\r
@@ -648,7 +648,7 @@ public class GlobalData {
                 return moduleId;\r
             }\r
         }\r
                 return moduleId;\r
             }\r
         }\r
-        throw new EdkException("Can't find module GUID value " + moduleId.toGuidString() + " in " + packageId + " under the current workspace!");\r
+        throw new EdkException("Can't find " + moduleId + " under the current workspace!");\r
     }\r
 \r
     public synchronized static Set<PackageIdentification> getPackageList(){\r
     }\r
 \r
     public synchronized static Set<PackageIdentification> getPackageList(){\r
index 87024d1..c2d9acc 100644 (file)
@@ -129,12 +129,33 @@ public class ModuleIdentification extends Identification {
     }\r
     \r
     public String toString() {\r
     }\r
     \r
     public String toString() {\r
-        if (version == null || version.trim().equalsIgnoreCase("")) {\r
-            return "Module [" + name + "] in " + packageId;\r
+        String nameString;\r
+        String versionString;\r
+        String packageString;\r
+\r
+        if (name != null && name != "") {\r
+            nameString = name;\r
+        } else {\r
+            if (guid != null && guid != "") {\r
+                nameString = guid;\r
+            } else {\r
+                nameString = "UNKNOWN";\r
+            }\r
         }\r
         }\r
-        else {\r
-            return "Module [" + name + " " + version + "] in " + packageId; \r
+\r
+        if (version != null) {\r
+            versionString = version;\r
+        } else {\r
+            versionString = ""; \r
         }\r
         }\r
+\r
+        if (packageId != null) {\r
+            packageString = packageId.toString();\r
+        } else {\r
+            packageString = "Package [UNKNOWN]";\r
+        }\r
+\r
+        return "Module [" + nameString + versionString + "] in " + packageString; \r
     }\r
 \r
     /**\r
     }\r
 \r
     /**\r