6879346: files have Windows newlines
authorjjg
Tue, 08 Sep 2009 11:29:58 -0700
changeset 3783 f1aefacd7231
parent 3782 ae62279eeb46
child 3784 182e4a28c0ce
6879346: files have Windows newlines Reviewed-by: darcy
langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclet.xml
langtools/test/com/sun/javadoc/testCRLineSeparator/TestCRLineSeparator.java
langtools/test/com/sun/javadoc/testCRLineSeparator/pkg/MyClass.java
langtools/test/com/sun/javadoc/testHref/package-list
langtools/test/com/sun/javadoc/testLinkOption/testNewLineInLink/package.html
langtools/test/com/sun/javadoc/testNoPackagesFile/TestNoPackagesFile.java
langtools/test/com/sun/javadoc/testOverridenMethods/TestMultiInheritence.java
langtools/test/com/sun/javadoc/testRelativeLinks/pkg/package.html
langtools/test/com/sun/javadoc/testTaglets/TestTaglets.java
langtools/test/com/sun/javadoc/testWarnings/pkg/package.html
langtools/test/tools/javah/SubClassConsts.win
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclet.xml	Tue Sep 08 11:12:13 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclet.xml	Tue Sep 08 11:29:58 2009 -0700
@@ -1,7 +1,7 @@
 <?xml version='1.0' encoding='utf-8'?>
 
 <!--
- Copyright 2003-2009 Sun Microsystems, Inc.  All Rights Reserved.
+ Copyright 2003-2009 Sun Microsystems, Inc.  All Rights Reserved.
  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 
  This code is free software; you can redistribute it and/or modify it
@@ -44,7 +44,7 @@
         <PackageTags/>
         <PackageFooter/>
     </PackageDoc>
-    
+
     <AnnotationTypeDoc>
         <AnnotationTypeHeader/>
         <DeprecationInfo/>
@@ -52,7 +52,7 @@
         <AnnotationTypeDescription/>
         <AnnotationTypeTagInfo/>
         <MemberSummary>
-        	<AnnotationTypeRequiredMemberSummary/>
+                <AnnotationTypeRequiredMemberSummary/>
             <AnnotationTypeOptionalMemberSummary/>
         </MemberSummary>
         <AnnotationTypeRequiredMemberDetails>
@@ -77,16 +77,16 @@
                 <MemberFooter/>
             </AnnotationTypeOptionalMember>
             <Footer/>
-        </AnnotationTypeOptionalMemberDetails>        
+        </AnnotationTypeOptionalMemberDetails>
         <AnnotationTypeFooter/>
     </AnnotationTypeDoc>
-    
+
     <ClassDoc>
         <ClassHeader/>
         <ClassTree/>
         <TypeParamInfo/>
         <SuperInterfacesInfo/>
-        <ImplementedInterfacesInfo/>        
+        <ImplementedInterfacesInfo/>
         <SubClassInfo/>
         <SubInterfacesInfo/>
         <InterfaceUsageInfo/>
@@ -100,7 +100,7 @@
             <NestedClassesInheritedSummary/>
             <EnumConstantsSummary/>
             <FieldsSummary/>
-            <FieldsInheritedSummary/>  
+            <FieldsInheritedSummary/>
             <ConstructorsSummary/>
             <MethodsSummary/>
             <MethodsInheritedSummary/>
@@ -155,7 +155,7 @@
         </MethodDetails>
         <ClassFooter/>
     </ClassDoc>
-    
+
     <ConstantSummary>
         <Header/>
         <Contents/>
@@ -166,12 +166,12 @@
                     <ClassHeader/>
                     <ConstantMembers/>
                     <ClassFooter/>
-                </ClassConstantSummary>     
+                </ClassConstantSummary>
             </PackageConstantSummary>
-        </ConstantSummaries>    
+        </ConstantSummaries>
         <Footer/>
     </ConstantSummary>
-    
+
     <SerializedForm>
         <Header/>
         <SerializedFormSummaries>
--- a/langtools/test/com/sun/javadoc/testCRLineSeparator/TestCRLineSeparator.java	Tue Sep 08 11:12:13 2009 -0700
+++ b/langtools/test/com/sun/javadoc/testCRLineSeparator/TestCRLineSeparator.java	Tue Sep 08 11:29:58 2009 -0700
@@ -32,6 +32,9 @@
  * @run main TestCRLineSeparator
  */
 
+import java.io.*;
+import java.util.*;
+
 public class TestCRLineSeparator extends JavadocTester {
 
     //Test information.
@@ -39,7 +42,7 @@
 
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
-        "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg"
+        "-d", BUG_ID, "-sourcepath", ".", "pkg"
     };
 
     //Input for string search tests.
@@ -53,7 +56,8 @@
      * The entry point of the test.
      * @param args the array of command line arguments.
      */
-    public static void main(String[] args) {
+    public static void main(String[] args) throws Exception {
+        initFiles(new File(SRC_DIR), new File("."), "pkg");
         TestCRLineSeparator tester = new TestCRLineSeparator();
         run(tester, ARGS, TEST, NEGATED_TEST);
         tester.printSummary();
@@ -72,4 +76,36 @@
     public String getBugName() {
         return getClass().getName();
     }
+
+    // recursively copy files from fromDir to toDir, replacing newlines
+    // with \r
+    static void initFiles(File fromDir, File toDir, String f) throws IOException {
+        File from_f = new File(fromDir, f);
+        File to_f = new File(toDir, f);
+        if (from_f.isDirectory()) {
+            to_f.mkdirs();
+            for (String child: from_f.list()) {
+                initFiles(from_f, to_f, child);
+            }
+        } else {
+            List<String> lines = new ArrayList<String>();
+            BufferedReader in = new BufferedReader(new FileReader(from_f));
+            try {
+                String line;
+                while ((line = in.readLine()) != null)
+                    lines.add(line);
+            } finally {
+                in.close();
+            }
+            BufferedWriter out = new BufferedWriter(new FileWriter(to_f));
+            try {
+                for (String line: lines) {
+                    out.write(line);
+                    out.write("\r");
+                }
+            } finally {
+                out.close();
+            }
+        }
+    }
 }
--- a/langtools/test/com/sun/javadoc/testCRLineSeparator/pkg/MyClass.java	Tue Sep 08 11:12:13 2009 -0700
+++ b/langtools/test/com/sun/javadoc/testCRLineSeparator/pkg/MyClass.java	Tue Sep 08 11:29:58 2009 -0700
@@ -21,4 +21,11 @@
  * have any questions.
  */
 
-package pkg;

/**
 * Line 1
 * Line 2
 */
public class MyClass {}
+package pkg;
+
+/**
+ * Line 1
+ * Line 2
+ */
+public class MyClass {}
+
--- a/langtools/test/com/sun/javadoc/testHref/package-list	Tue Sep 08 11:12:13 2009 -0700
+++ b/langtools/test/com/sun/javadoc/testHref/package-list	Tue Sep 08 11:29:58 2009 -0700
@@ -1,1 +1,1 @@
-java.lang
+java.lang
--- a/langtools/test/com/sun/javadoc/testLinkOption/testNewLineInLink/package.html	Tue Sep 08 11:12:13 2009 -0700
+++ b/langtools/test/com/sun/javadoc/testLinkOption/testNewLineInLink/package.html	Tue Sep 08 11:29:58 2009 -0700
@@ -1,6 +1,6 @@
-<html>
-<body>
-{@link java.awt.Color#getAlpha()
-getAlpha}
-</body>
-</html>
+<html>
+<body>
+{@link java.awt.Color#getAlpha()
+getAlpha}
+</body>
+</html>
--- a/langtools/test/com/sun/javadoc/testNoPackagesFile/TestNoPackagesFile.java	Tue Sep 08 11:12:13 2009 -0700
+++ b/langtools/test/com/sun/javadoc/testNoPackagesFile/TestNoPackagesFile.java	Tue Sep 08 11:29:58 2009 -0700
@@ -52,7 +52,7 @@
         TestNoPackagesFile tester = new TestNoPackagesFile();
         run(tester, ARGS, NO_TEST, NO_TEST);
         if ((new java.io.File(BUG_ID + FS + "packages.html")).exists()) {
-            throw new Error("Test Fails: packages file should not be " +
                "generated anymore.");
+            throw new Error("Test Fails: packages file should not be " +                "generated anymore.");
         } else {
             System.out.println("Test passes:  packages.html not found.");
         }
--- a/langtools/test/com/sun/javadoc/testOverridenMethods/TestMultiInheritence.java	Tue Sep 08 11:12:13 2009 -0700
+++ b/langtools/test/com/sun/javadoc/testOverridenMethods/TestMultiInheritence.java	Tue Sep 08 11:29:58 2009 -0700
@@ -46,7 +46,7 @@
     //Method foo() is inherited from BOTH I2 and I3
     private static final String[][] TEST = {
        {BUG_ID + FS + "pkg3" + FS + "I1.html",
-        "Methods inherited from interface pkg3." +
        "<A HREF=\"../pkg3/I2.html\" title=\"interface in pkg3\">I2</A>"},
+        "Methods inherited from interface pkg3." +        "<A HREF=\"../pkg3/I2.html\" title=\"interface in pkg3\">I2</A>"},
         {BUG_ID + FS + "pkg3" + FS +"I1.html",
         "Methods inherited from interface pkg3." +
         "<A HREF=\"../pkg3/I3.html\" title=\"interface in pkg3\">I3</A>"},
--- a/langtools/test/com/sun/javadoc/testRelativeLinks/pkg/package.html	Tue Sep 08 11:12:13 2009 -0700
+++ b/langtools/test/com/sun/javadoc/testRelativeLinks/pkg/package.html	Tue Sep 08 11:29:58 2009 -0700
@@ -1,6 +1,7 @@
-<html>
-	<body>
-		Here is a relative link in a package: 
-       <a href="relative-package-link.html">relative package link</a>.
-	</body>
-</html>
\ No newline at end of file
+<html>
+	<body>
+		Here is a relative link in a package: 
+       <a href="relative-package-link.html">relative package link</a>.
+	</body>
+</html>
+
--- a/langtools/test/com/sun/javadoc/testTaglets/TestTaglets.java	Tue Sep 08 11:12:13 2009 -0700
+++ b/langtools/test/com/sun/javadoc/testTaglets/TestTaglets.java	Tue Sep 08 11:29:58 2009 -0700
@@ -55,7 +55,7 @@
 
     //Input for string search tests.
     private static final String[][] TEST_4654308 = new String[][] {
-        {"4654308" + FS + "C.html", "<B>Foo:</B><DD>my only method is " +
            "<A HREF=\"C.html#method()\"><CODE>here</CODE></A>"}
+        {"4654308" + FS + "C.html", "<B>Foo:</B><DD>my only method is " +            "<A HREF=\"C.html#method()\"><CODE>here</CODE></A>"}
     };
     private static final String[][] NEGATED_TEST_4654308 = NO_TEST;
 
--- a/langtools/test/com/sun/javadoc/testWarnings/pkg/package.html	Tue Sep 08 11:12:13 2009 -0700
+++ b/langtools/test/com/sun/javadoc/testWarnings/pkg/package.html	Tue Sep 08 11:29:58 2009 -0700
@@ -1,3 +1,4 @@
-<HTML>
-   Testing.
-<HTML>
\ No newline at end of file
+<HTML>
+   Testing.
+<HTML>
+
--- a/langtools/test/tools/javah/SubClassConsts.win	Tue Sep 08 11:12:13 2009 -0700
+++ b/langtools/test/tools/javah/SubClassConsts.win	Tue Sep 08 11:29:58 2009 -0700
@@ -1,31 +1,31 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include <jni.h>
-/* Header for class SubClassConsts */
-
-#ifndef _Included_SubClassConsts
-#define _Included_SubClassConsts
-#ifdef __cplusplus
-extern "C" {
-#endif
-#undef SubClassConsts_serialVersionUID
-#define SubClassConsts_serialVersionUID 6733861379283244755i64
-#undef SubClassConsts_SUPER_INT_CONSTANT
-#define SubClassConsts_SUPER_INT_CONSTANT 3L
-#undef SubClassConsts_SUPER_FLOAT_CONSTANT
-#define SubClassConsts_SUPER_FLOAT_CONSTANT 99.3f
-#undef SubClassConsts_SUPER_DOUBLE_CONSTANT
-#define SubClassConsts_SUPER_DOUBLE_CONSTANT 33.2
-#undef SubClassConsts_SUPER_BOOLEAN_CONSTANT
-#define SubClassConsts_SUPER_BOOLEAN_CONSTANT 0L
-#undef SubClassConsts_SUB_INT_CONSTANT
-#define SubClassConsts_SUB_INT_CONSTANT 2L
-#undef SubClassConsts_SUB_DOUBLE_CONSTANT
-#define SubClassConsts_SUB_DOUBLE_CONSTANT 2.25
-#undef SubClassConsts_SUB_FLOAT_CONSTANT
-#define SubClassConsts_SUB_FLOAT_CONSTANT 7.9f
-#undef SubClassConsts_SUB_BOOLEAN_CONSTANT
-#define SubClassConsts_SUB_BOOLEAN_CONSTANT 1L
-#ifdef __cplusplus
-}
-#endif
-#endif
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class SubClassConsts */
+
+#ifndef _Included_SubClassConsts
+#define _Included_SubClassConsts
+#ifdef __cplusplus
+extern "C" {
+#endif
+#undef SubClassConsts_serialVersionUID
+#define SubClassConsts_serialVersionUID 6733861379283244755i64
+#undef SubClassConsts_SUPER_INT_CONSTANT
+#define SubClassConsts_SUPER_INT_CONSTANT 3L
+#undef SubClassConsts_SUPER_FLOAT_CONSTANT
+#define SubClassConsts_SUPER_FLOAT_CONSTANT 99.3f
+#undef SubClassConsts_SUPER_DOUBLE_CONSTANT
+#define SubClassConsts_SUPER_DOUBLE_CONSTANT 33.2
+#undef SubClassConsts_SUPER_BOOLEAN_CONSTANT
+#define SubClassConsts_SUPER_BOOLEAN_CONSTANT 0L
+#undef SubClassConsts_SUB_INT_CONSTANT
+#define SubClassConsts_SUB_INT_CONSTANT 2L
+#undef SubClassConsts_SUB_DOUBLE_CONSTANT
+#define SubClassConsts_SUB_DOUBLE_CONSTANT 2.25
+#undef SubClassConsts_SUB_FLOAT_CONSTANT
+#define SubClassConsts_SUB_FLOAT_CONSTANT 7.9f
+#undef SubClassConsts_SUB_BOOLEAN_CONSTANT
+#define SubClassConsts_SUB_BOOLEAN_CONSTANT 1L
+#ifdef __cplusplus
+}
+#endif
+#endif