Fixed an Autogen issue which will cause build break when encountering some kind of...
authorjwang36 <jwang36@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 27 Mar 2007 03:05:30 +0000 (03:05 +0000)
committerjwang36 <jwang36@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 27 Mar 2007 03:05:30 +0000 (03:05 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2507 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Java/Source/GenBuild/org/tianocore/build/FrameworkBuildTask.java
Tools/Java/Source/GenBuild/org/tianocore/build/autogen/AutogenLibOrder.java

index ae1ac7e..8482401 100644 (file)
@@ -120,32 +120,44 @@ public class FrameworkBuildTask extends Task{
             //\r
             // Add more logic process here\r
             //\r
-            throw new BuildException(e.getMessage());\r
+            BuildException buildException = new BuildException(e.getMessage());\r
+            buildException.setStackTrace(e.getStackTrace());\r
+            throw buildException;\r
         } catch (PcdAutogenException e) {\r
             //\r
             // Add more logic process here\r
             //\r
-            throw new BuildException(e.getMessage());\r
+            BuildException buildException = new BuildException(e.getMessage());\r
+            buildException.setStackTrace(e.getStackTrace());\r
+            throw buildException;\r
         } catch (AutoGenException e) {\r
             //\r
             // Add more logic process here\r
             //\r
-            throw new BuildException(e.getMessage());\r
+            BuildException buildException = new BuildException(e.getMessage());\r
+            buildException.setStackTrace(e.getStackTrace());\r
+            throw buildException;\r
         } catch (PlatformPcdPreprocessBuildException e) {\r
             //\r
             // Add more logic process here\r
             //\r
-            throw new BuildException(e.getMessage());\r
+            BuildException buildException = new BuildException(e.getMessage());\r
+            buildException.setStackTrace(e.getStackTrace());\r
+            throw buildException;\r
         } catch (GenBuildException e) {\r
             //\r
             // Add more logic process here\r
             //\r
-            throw new BuildException(e.getMessage());\r
+            BuildException buildException = new BuildException(e.getMessage());\r
+            buildException.setStackTrace(e.getStackTrace());\r
+            throw buildException;\r
         } catch (EdkException e) {\r
             //\r
             // Add more logic process here\r
             //\r
-            throw new BuildException(e.getMessage());\r
+            BuildException buildException = new BuildException(e.getMessage());\r
+            buildException.setStackTrace(e.getStackTrace());\r
+            throw buildException;\r
         }\r
     }\r
     \r
index 7e87e28..a131b89 100644 (file)
@@ -158,7 +158,11 @@ public class AutogenLibOrder {
         // First, add the library instance without consumers to the Q\r
         //\r
         for (int i = 0; i < libInstanceList.length; ++i) {\r
-            if (libInstanceConsumedBy.get(libInstanceList[i]).size() == 0) {\r
+            if (libInstanceList[i] == null) {\r
+                continue;\r
+            }\r
+            \r
+            if (libInstanceConsumedBy.get(libInstanceList[i]) == null ||  libInstanceConsumedBy.get(libInstanceList[i]).size() == 0) {\r
                 noConsumerList.add(libInstanceList[i]);\r
             }\r
         }\r
@@ -174,7 +178,7 @@ public class AutogenLibOrder {
                     continue;\r
                 }\r
                 HashSet<ModuleIdentification> consumedBy = libInstanceConsumedBy.get(m);\r
-                if (consumedBy.size() == 0) {\r
+                if (consumedBy == null || consumedBy.size() == 0) {\r
                   continue;\r
                 }\r
 \r
@@ -194,7 +198,7 @@ public class AutogenLibOrder {
                     }\r
 \r
                     HashSet<ModuleIdentification> consumedBy = libInstanceConsumedBy.get(libInstance);\r
-                    if (consumedBy.size() == 0) {\r
+                    if (consumedBy == null || consumedBy.size() == 0) {\r
                         continue;\r
                     }\r
 \r
@@ -234,7 +238,7 @@ public class AutogenLibOrder {
         boolean HasError = false;\r
         for (int i = 0; i < libInstanceList.length; ++i) {\r
             HashSet<ModuleIdentification> consumedBy = libInstanceConsumedBy.get(libInstanceList[i]);\r
-            if (consumedBy.size() > 0 && libInstanceList[i].hasConstructor()) {\r
+            if (consumedBy != null && consumedBy.size() > 0 && libInstanceList[i].hasConstructor()) {\r
                 EdkLog.log(EdkLog.EDK_ERROR, libInstanceList[i].getName()\r
                            + " with constructor has a circular dependency!");\r
                 ModuleIdentification[] consumedByList = consumedBy.toArray(new ModuleIdentification[consumedBy.size()]);\r