]> git.proxmox.com Git - mirror_edk2.git/commitdiff
fix logfile.close(), trim \n
authoralfred <alfred@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 7 Sep 2006 07:19:39 +0000 (07:19 +0000)
committeralfred <alfred@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 7 Sep 2006 07:19:39 +0000 (07:19 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1490 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Source/MigrationTools/org/tianocore/migration/Common.java
Tools/Source/MigrationTools/org/tianocore/migration/Critic.java
Tools/Source/MigrationTools/org/tianocore/migration/FirstPanel.java
Tools/Source/MigrationTools/org/tianocore/migration/SourceFileReplacer.java

index 3371a54518e8cb2ef7680e8ff26bdce25fe62ccb..5c8629c6448742b0d5ed9a735bb7c2bf9d1bfb58 100644 (file)
@@ -184,10 +184,6 @@ public final class Common {
                        Common.string2file(operation(Common.file2string(src)), des);\r
                }\r
                \r
-               public void run() {\r
-                       \r
-               }\r
-               \r
                public abstract String operation(String wholeline);\r
                \r
                public abstract boolean recognize(String filename);\r
index a234b6e37adb8c6a53395db29f01aa670dd995ca..2d9bb7b14c2a0a0938f9215ca30ae54fa976182d 100644 (file)
@@ -63,7 +63,7 @@ public final class Critic {
                                        templine.append(line + "\n");\r
                                } else if (line.matches("\\*\\*\\/")) {\r
                                        incomment = false;\r
-                                       templine.append(line + "\n");\r
+                                       templine.append("\n" + line + "\n");\r
                                } else if (incomment) {\r
                                        if (line.contains("Routine Description:")) {\r
                                                description = true;\r
@@ -73,10 +73,12 @@ public final class Critic {
                                                description = false;\r
                                                arguments = true;\r
                                                returns = false;\r
+                                               templine.append("\n");\r
                                        } else if (line.contains("Returns:")) {\r
                                                description = false;\r
                                                arguments = false;\r
                                                returns = true;\r
+                                               templine.append("\n");\r
                                        } else if (description) {\r
                                                if (line.trim().length() != 0) {\r
                                                        templine.append("  " + line.trim() + "\n");\r
@@ -88,11 +90,12 @@ public final class Critic {
                                                        templine.append("  @param  " + mtrcommentequation.group(1) + "     " + mtrcommentequation.group(2) + "\n");\r
                                                } else if (inequation && line.trim().length() == 0) {\r
                                                        inequation = false;\r
-                                                       templine.append(line + "\n");\r
                                                } else if (inequation && line.trim().length() != 0) {\r
                                                        templine.append("#%#%" + line + "\n");\r
                                                } else {\r
-                                                       templine.append("  " + line.trim() + "\n");\r
+                                                       if (line.trim().length() != 0) {\r
+                                                               templine.append("  " + line.trim() + "\n");\r
+                                                       }\r
                                                }\r
                                        } else if (returns) {\r
                                                mtrcommentequation = ptncommentequation.matcher(line);\r
@@ -101,13 +104,10 @@ public final class Critic {
                                                        templine.append("  @retval " + mtrcommentequation.group(1) + "     " + mtrcommentequation.group(2) + "\n");\r
                                                } else if (inequation && line.trim().length() == 0) {\r
                                                        inequation = false;\r
-                                                       templine.append(line + "\n");\r
                                                } else if (inequation && line.trim().length() != 0) {\r
                                                        templine.append("#%#%" + line + "\n");\r
                                                } else {\r
-                                                       if (line.trim().length() == 0) {\r
-                                                               templine.append("  " + line.trim() + "\n");\r
-                                                       } else {\r
+                                                       if (line.trim().length() != 0) {\r
                                                                templine.append("  @return " + line.trim() + "\n");\r
                                                        }\r
                                                }\r
index e99a76edf421e44985af6b11cea5458c17158a38..ac0304190a98b8d734c1d5e76c5afde47c8cb82f 100644 (file)
@@ -183,6 +183,7 @@ public final class FirstPanel extends JPanel implements ActionListener, ItemList
                        logfile = new PrintWriter(new BufferedWriter(new FileWriter(startpath.replaceAll(Common.strseparate, "$1") + File.separator + "migration.log")));\r
                        MigrationTool.startMigrateAll(startpath);\r
                        logfile.flush();\r
+                       logfile.close();\r
                } catch (Exception en) {\r
                        println(en.getMessage());\r
                }\r
index 07f93cecadc85bbde1560a87ab6384e8846a7296..a2bc6c37fa11d761434a9bc3982b098037a0afde 100644 (file)
@@ -240,7 +240,8 @@ public final class SourceFileReplacer implements Common.ForDoAll {
                }\r
        }\r
        //---------------------------------------inner classes---------------------------------------//\r
-       \r
+\r
+       //-------------------------------------process functions-------------------------------------//\r
        private static final String addincludefile(String wholeline, String hfile) {\r
                return wholeline.replaceFirst("(\\*/\\s)", "$1\n#include " + hfile + "\n");\r
        }\r
@@ -315,6 +316,7 @@ public final class SourceFileReplacer implements Common.ForDoAll {
                mi.localmodulesources.add("R8Lib.h");\r
                mi.localmodulesources.add("R8Lib.c");\r
        }\r
+       //-------------------------------------process functions-------------------------------------//\r
        \r
        //-----------------------------------ForDoAll-----------------------------------//\r
        public void run(String filepath) throws Exception {\r