diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2017-09-21 22:30:36 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2017-09-21 22:30:36 +0000 |
commit | f57f26f2081fe80a5ebe5dfd57f1067488d44d6a (patch) | |
tree | 17b12998295c1f74feacdd55f36bc3856032dfaa | |
parent | 658d28e2d062aa5154d9e10433a7b2cd33e04711 (diff) | |
parent | 34c7705205f1f551fd6c3a4baee065f467a2011d (diff) | |
download | jdiff-oreo-mr1-wear-release.tar.gz |
release-request-d1c17d84-f03d-44ed-9e1a-f1dedcc3182d-for-git_oc-mr1-wear-release-4353319 snap-temp-L19800000105061864android-wear-8.1.0_r1oreo-mr1-wear-release
Change-Id: Ie0321dccb0ba2402f4fb1627b6386eaaafc97328
-rw-r--r-- | android-changes.txt | 4 | ||||
-rw-r--r-- | settings.gradle | 17 | ||||
-rwxr-xr-x | src/api.xsd | 3 | ||||
-rwxr-xr-x | src/jdiff/API.java | 16 | ||||
-rwxr-xr-x | src/jdiff/APIComparator.java | 18 | ||||
-rwxr-xr-x | src/jdiff/Comments.java | 8 | ||||
-rwxr-xr-x | src/jdiff/CommentsHandler.java | 4 | ||||
-rwxr-xr-x | src/jdiff/ConstructorAPI.java | 5 | ||||
-rwxr-xr-x | src/jdiff/Diff.java | 20 | ||||
-rwxr-xr-x | src/jdiff/HTMLFiles.java | 192 | ||||
-rwxr-xr-x | src/jdiff/HTMLIndexes.java | 79 | ||||
-rwxr-xr-x | src/jdiff/HTMLReportGenerator.java | 647 | ||||
-rwxr-xr-x | src/jdiff/HTMLStatistics.java | 215 | ||||
-rwxr-xr-x | src/jdiff/JDiff.java | 6 | ||||
-rwxr-xr-x | src/jdiff/MergeChanges.java | 12 | ||||
-rwxr-xr-x | src/jdiff/RootDocToXML.java | 32 | ||||
-rwxr-xr-x | src/jdiff/XMLToAPI.java | 6 |
17 files changed, 551 insertions, 733 deletions
diff --git a/android-changes.txt b/android-changes.txt new file mode 100644 index 0000000..8fec0c6 --- /dev/null +++ b/android-changes.txt @@ -0,0 +1,4 @@ +This version of jdiff has been modified to generate output using a template +designed for use exclusively on developer.android.com. It is not suitable for +use outside the Android platform. + diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..a277c6d --- /dev/null +++ b/settings.gradle @@ -0,0 +1,17 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +rootProject.name = 'jdiff'
\ No newline at end of file diff --git a/src/api.xsd b/src/api.xsd index bb2368f..de8a301 100755 --- a/src/api.xsd +++ b/src/api.xsd @@ -52,6 +52,7 @@ <xsd:complexType name="constructorType"> <xsd:sequence> + <xsd:element name="parameter" type="paramsType" minOccurs='0' maxOccurs='unbounded'/> <xsd:element name="exception" type="exceptionType" minOccurs='0' maxOccurs='unbounded'/> <xsd:element name="doc" type="xsd:string" minOccurs='0' maxOccurs='1'/> </xsd:sequence> @@ -76,7 +77,7 @@ <xsd:complexType name="methodType"> <xsd:sequence> - <xsd:element name="param" type="paramsType" minOccurs='0' maxOccurs='unbounded'/> + <xsd:element name="parameter" type="paramsType" minOccurs='0' maxOccurs='unbounded'/> <xsd:element name="exception" type="exceptionType" minOccurs='0' maxOccurs='unbounded'/> <xsd:element name="doc" type="xsd:string" minOccurs='0' maxOccurs='1'/> </xsd:sequence> diff --git a/src/jdiff/API.java b/src/jdiff/API.java index 800e752..b5cb8e2 100755 --- a/src/jdiff/API.java +++ b/src/jdiff/API.java @@ -4,23 +4,23 @@ import java.io.*; import java.util.*; /** - * The internal representation of an API. - * - * RootDoc could have been used for representing this, but + * The internal representation of an API. + * + * RootDoc could have been used for representing this, but * you cannot serialize a RootDoc object - see - * http://developer.java.sun.com/developer/bugParade/bugs/4125581.html - * You might be able use Javadoc.Main() to create another RootDoc, but the + * https://developer.java.sun.com/developer/bugParade/bugs/4125581.html + * You might be able use Javadoc.Main() to create another RootDoc, but the * methods are package private. You can run javadoc in J2SE1.4, see: - * http://java.sun.com/j2se/1.4/docs/tooldocs/javadoc/standard-doclet.html#runningprogrammatically + * https://java.sun.com/j2se/1.4/docs/tooldocs/javadoc/standard-doclet.html#runningprogrammatically * but you still can't get the RootDoc object. * * The advantage of writing out an XML representation of each API is that * later runs of JDiff don't have to have Javadoc scan all the files again, - * a possibly lengthy process. XML also permits other source code in + * a possibly lengthy process. XML also permits other source code in * languages other than Java to be scanned to produce XML, and then versions * of JDiff can be used to create documents describing the difference in those * APIs. - * + * * See the file LICENSE.txt for copyright details. * @author Matthew Doar, mdoar@pobox.com */ diff --git a/src/jdiff/APIComparator.java b/src/jdiff/APIComparator.java index c877785..b79c829 100755 --- a/src/jdiff/APIComparator.java +++ b/src/jdiff/APIComparator.java @@ -862,17 +862,17 @@ public class APIComparator { return linkToClass(m.inheritedFrom_, m.name_, null, useNew); } - /** + /** * Given the name of the class, generate a link to a relevant page. - * This was originally for inheritance changes, so the JDiff page could - * be a class changes page, or a section in a removed or added classes + * This was originally for inheritance changes, so the JDiff page could + * be a class changes page, or a section in a removed or added classes. * table. Since there was no easy way to tell which type the link * should be, it is now just a link to the relevant Javadoc page. */ public static String linkToClass(String className, String memberName, String memberType, boolean useNew) { if (!useNew && HTMLReportGenerator.oldDocPrefix == null) { - return "<tt>" + className + "</tt>"; // No link possible + return "<code>" + className + "</code>"; // No link possible } API api = oldAPI_; String prefix = HTMLReportGenerator.oldDocPrefix; @@ -886,7 +886,7 @@ public class APIComparator { System.out.println("Warning: class " + className + " not found in the new API when creating Javadoc link"); else System.out.println("Warning: class " + className + " not found in the old API when creating Javadoc link"); - return "<tt>" + className + "</tt>"; + return "<code>" + className + "</code>"; } int clsIdx = className.indexOf(cls.name_); if (clsIdx != -1) { @@ -895,13 +895,13 @@ public class APIComparator { String res = "<a href=\"" + prefix + pkgRef + cls.name_ + ".html#" + memberName; if (memberType != null) res += "(" + memberType + ")"; - res += "\" target=\"_top\">" + "<tt>" + cls.name_ + "</tt></a>"; + res += "\" target=\"_top\">" + "<code>" + cls.name_ + "</code></a>"; return res; } - return "<tt>" + className + "</tt>"; - } + return "<code>" + className + "</code>"; + } - /** + /** * Return the number of methods which are locally defined. */ public int numLocalMethods(List methods) { diff --git a/src/jdiff/Comments.java b/src/jdiff/Comments.java index b732596..0ead7ee 100755 --- a/src/jdiff/Comments.java +++ b/src/jdiff/Comments.java @@ -73,9 +73,9 @@ public class Comments { } if (XMLToAPI.validateXML) { - parser.setFeature("http://xml.org/sax/features/namespaces", true); - parser.setFeature("http://xml.org/sax/features/validation", true); - parser.setFeature("http://apache.org/xml/features/validation/schema", true); + parser.setFeature("https://xml.org/sax/features/namespaces", true); + parser.setFeature("https://xml.org/sax/features/validation", true); + parser.setFeature("https://apache.org/xml/features/validation/schema", true); } parser.setContentHandler(handler); parser.setErrorHandler(handler); @@ -125,7 +125,7 @@ public class Comments { PrintWriter xsdFile = new PrintWriter(fos); // The contents of the comments.xsd file xsdFile.println("<?xml version=\"1.0\" encoding=\"iso-8859-1\" standalone=\"no\"?>"); - xsdFile.println("<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">"); + xsdFile.println("<xsd:schema xmlns:xsd=\"https://www.w3.org/2001/XMLSchema\">"); xsdFile.println(); xsdFile.println("<xsd:annotation>"); xsdFile.println(" <xsd:documentation>"); diff --git a/src/jdiff/CommentsHandler.java b/src/jdiff/CommentsHandler.java index 8061fbe..9872cb7 100755 --- a/src/jdiff/CommentsHandler.java +++ b/src/jdiff/CommentsHandler.java @@ -17,8 +17,8 @@ import org.xml.sax.helpers.DefaultHandler; * use tags such as <p/> rather than just <p>, since the XML * parser used requires that or matching end elements. * - * From http://www.w3.org/TR/2000/REC-xhtml1-20000126: - * "Empty elements must either have an end tag or the start tag must end with /<". + * From https://www.w3.org/TR/2000/REC-xhtml1-20000126: + * "Empty elements must either have an end tag or the start tag must end with /<". * * See the file LICENSE.txt for copyright details. * @author Matthew Doar, mdoar@pobox.com diff --git a/src/jdiff/ConstructorAPI.java b/src/jdiff/ConstructorAPI.java index 8fc7159..65467ef 100755 --- a/src/jdiff/ConstructorAPI.java +++ b/src/jdiff/ConstructorAPI.java @@ -81,9 +81,10 @@ class ConstructorAPI implements Comparable { * Tests two constructors, using just the name and type, used by indexOf(). */ public boolean equals(Object o) { + ConstructorAPI constructorAPI = (ConstructorAPI)o; if (compareNullIsLeast(name_, constructorAPI.name_) == 0 && - compareNullIsLeast(type_, constructorAPI.type_) == 0) + compareNullIsLeast(getSignature(), constructorAPI.getSignature()) == 0) return true; return false; } @@ -119,4 +120,4 @@ class ConstructorAPI implements Comparable { signature_ = res; return res; } -} +}
\ No newline at end of file diff --git a/src/jdiff/Diff.java b/src/jdiff/Diff.java index a9c9776..8cba311 100755 --- a/src/jdiff/Diff.java +++ b/src/jdiff/Diff.java @@ -324,7 +324,7 @@ class Diff { diffFile.println("</TITLE>"); diffFile.println("</HEAD>"); diffFile.println("<BODY>"); - + // Write the navigation bar diffFile.println("<!-- Start of nav bar -->"); diffFile.println("<TABLE summary=\"Navigation bar\" BORDER=\"0\" WIDTH=\"100%\" CELLPADDING=\"1\" CELLSPACING=\"0\">"); @@ -336,7 +336,7 @@ class Diff { String pkgRef = currPkgName; pkgRef = pkgRef.replace('.', '/'); pkgRef = HTMLReportGenerator.newDocPrefix + pkgRef + "/package-summary"; - diffFile.println(" <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"" + pkgRef + ".html\" target=\"_top\"><FONT CLASS=\"NavBarFont1\"><B><tt>" + APIDiff.newAPIName_ + "</tt></B></FONT></A> </TD>"); + diffFile.println(" <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"" + pkgRef + ".html\" target=\"_top\"><FONT CLASS=\"NavBarFont1\"><B><code>" + APIDiff.newAPIName_ + "</code></B></FONT></A> </TD>"); diffFile.println(" <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"" + HTMLReportGenerator.reportFileName + "-summary" + HTMLReportGenerator.reportFileExt + "\"><FONT CLASS=\"NavBarFont1\"><B>Overview</B></FONT></A> </TD>"); diffFile.println(" <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <FONT CLASS=\"NavBarFont1\">Package</FONT> </TD>"); diffFile.println(" <TD BGCOLOR=\"#FFFFFF\" CLASS=\"NavBarCell1\"> <FONT CLASS=\"NavBarFont1\">Class</FONT> </TD>"); @@ -468,7 +468,7 @@ class Diff { diffFile.println(" <TABLE summary=\"Navigation bar\" BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"3\">"); diffFile.println(" <TR ALIGN=\"center\" VALIGN=\"top\">"); // Always have a link to the Javadoc files - diffFile.println(" <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"" + HTMLReportGenerator.newDocPrefix + "index.html\" target=\"_top\"><FONT CLASS=\"NavBarFont1\"><B><tt>" + APIDiff.newAPIName_ + "</tt></B></FONT></A> </TD>"); + diffFile.println(" <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"" + HTMLReportGenerator.newDocPrefix + "index.html\" target=\"_top\"><FONT CLASS=\"NavBarFont1\"><B><code>" + APIDiff.newAPIName_ + "</code></B></FONT></A> </TD>"); diffFile.println(" <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"" + HTMLReportGenerator.reportFileName + "-summary" + HTMLReportGenerator.reportFileExt + "\"><FONT CLASS=\"NavBarFont1\"><B>Overview</B></FONT></A> </TD>"); diffFile.println(" <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <FONT CLASS=\"NavBarFont1\">Package</FONT> </TD>"); diffFile.println(" <TD BGCOLOR=\"#FFFFFF\" CLASS=\"NavBarCell1\"> <FONT CLASS=\"NavBarFont1\">Class</FONT> </TD>"); @@ -632,23 +632,23 @@ class Diff { */ public static int insertEffect = 1; - /** + /** * For each package and class, the first DiffOutput is added to * this hash table. Used when generating navigation bars. */ public static Hashtable firstDiffOutput = new Hashtable(); - /** + /** * If set, then show changes in implementation-related modifiers such as - * native and synchronized. For more information, see - * http://java.sun.com/j2se/1.4.1/docs/tooldocs/solaris/javadoc.html#generatedapideclarations + * native and synchronized. For more information, see + * https://java.sun.com/j2se/1.4.1/docs/tooldocs/solaris/javadoc.html#generatedapideclarations */ public static boolean showAllChanges = false; /** The list of documentation differences. */ private static List docDiffs = new ArrayList(); // DiffOutput[] - + /** Set to enable increased logging verbosity for debugging. */ private static boolean trace = false; - -} + +} diff --git a/src/jdiff/HTMLFiles.java b/src/jdiff/HTMLFiles.java index a141e6c..3b3cf14 100755 --- a/src/jdiff/HTMLFiles.java +++ b/src/jdiff/HTMLFiles.java @@ -43,31 +43,31 @@ public class HTMLFiles { h_.writeHTMLTitle(h_.windowTitle); // Note that the stylesheet is in the same directory h_.writeStyleSheetRef(true); - h_.writeText("</HEAD>"); + h_.writeText("</head>"); // Note that the top-level frame file doesn't have the BODY tag - h_.writeText("<FRAMESET COLS=\"20%,80%\">"); - h_.writeText("<frameset rows=\"196,**\">"); + h_.writeText("<frameset cols=\"242,**\" framespacing=\"1\" frameborder=\"yes\" border=\"1\" bordercolor=\"#e9e9e9\"> "); + h_.writeText("<frameset rows=\"174,**\" framespacing=\"1\" frameborder=\"yes\" border=\"1\" bordercolor=\"#e9e9e9\">"); // Convert filenames to web links String tlfLink = h_.reportFileName + "/jdiff_topleftframe" + h_.reportFileExt; String allDiffsLink = h_.reportFileName + "/alldiffs_index_all" + h_.reportFileExt; String csnLink = h_.reportFileName + "/" + h_.reportFileName + "-summary" + h_.reportFileExt; - h_.writeText(" <FRAME SRC=\"" + tlfLink + "\" SCROLLING=\"no\" NAME=\"topleftframe\">"); - h_.writeText(" <FRAME SRC=\"" + allDiffsLink + "\" SCROLLING=\"auto\" NAME=\"bottomleftframe\">"); - h_.writeText(" </FRAMESET>"); - h_.writeText(" <FRAME SRC=\"" + csnLink + "\" SCROLLING=\"auto\" NAME=\"rightframe\">"); - h_.writeText("</FRAMESET>"); - h_.writeText("<NOFRAMES>"); - h_.writeText("<H2>"); + h_.writeText(" <frame src=\"" + tlfLink + "\" scrolling=\"no\" name=\"topleftframe\" frameborder=\"1\">"); + h_.writeText(" <frame src=\"" + allDiffsLink + "\" scrolling=\"auto\" name=\"bottomleftframe\" frameborder=\"1\">"); + h_.writeText(" </frameset>"); + h_.writeText(" <frame src=\"" + csnLink + "\" scrolling=\"auto\" name=\"rightframe\" frameborder=\"1\">"); + h_.writeText("</frameset>"); + h_.writeText("<noframes>"); + h_.writeText("<h2>"); h_.writeText("Frame Alert"); - h_.writeText("</H2>\n"); - h_.writeText("<P>"); + h_.writeText("</h2>\n"); + h_.writeText("<p>"); h_.writeText("This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client."); - h_.writeText("<BR>"); - h_.writeText("Link to <A HREF=\"" + csnLink + "\" target=\"_top\">Non-frame version.</A>"); - h_.writeText("</NOFRAMES>"); - h_.writeText("</HTML>"); + h_.writeText("<br>"); + h_.writeText("Link to <a href=\"" + csnLink + "\" target=\"_top\">Non-frame version.</A>"); + h_.writeText("</noframes>"); + h_.writeText("</html>"); h_.reportFile.close(); } catch(IOException e) { System.out.println("IO Error while attempting to create " + tln); @@ -76,39 +76,39 @@ public class HTMLFiles { } } - /** Emit a top left frame with all the links to the index files. */ + /** Emit a frame with all the links to the index files. */ public void emitTopLeftFile(String tlf) { try { FileOutputStream fos = new FileOutputStream(tlf); h_.reportFile = new PrintWriter(fos); h_.writeStartHTMLHeader(); - h_.writeHTMLTitle("Android Diffs Index"); + h_.writeHTMLTitle("Android API Version Differences"); h_.writeStyleSheetRef(); h_.writeText("</HEAD>"); - h_.writeText("<BODY>"); + h_.writeText("<BODY class=\"gc-documentation\" style=\"padding:12px;\">"); - h_.writeText("<table summary=\"Links to all index files\" BORDER=\"0\" WIDTH=\"100%\" cellspacing=\"0\" cellpadding=\"0\">"); + h_.writeText("<table class=\"jdiffIndex\" summary=\"Links to diff index files\" BORDER=\"0\" WIDTH=\"100%\" cellspacing=\"0\" cellpadding=\"0\" style=\"margin:0\">"); h_.writeText("<TR>"); h_.writeText(" <th class=\"indexHeader\" nowrap>"); h_.writeText(" Select a Diffs Index:</th>"); h_.writeText("</TR>"); h_.writeText("<TR>"); - h_.writeText(" <TD><FONT CLASS=\"indexText\" size=\"-1\"><A HREF=\"alldiffs_index_all" + h_.reportFileExt + "\" TARGET=\"bottomleftframe\">All Differences</A></FONT><br></TD>"); + h_.writeText(" <TD><FONT CLASS=\"indexText\" size=\"-2\"><A HREF=\"alldiffs_index_all" + h_.reportFileExt + "\" TARGET=\"bottomleftframe\">All Differences</A></FONT><br></TD>"); h_.writeText("</TR>"); h_.writeText("<TR>"); - h_.writeText(" <TD NOWRAP><FONT CLASS=\"indexText\" size=\"-1\"><A HREF=\"packages_index_all" + h_.reportFileExt + "\" TARGET=\"bottomleftframe\">By Package</A></FONT><br></TD>"); + h_.writeText(" <TD NOWRAP><FONT CLASS=\"indexText\" size=\"-2\"><A HREF=\"packages_index_all" + h_.reportFileExt + "\" TARGET=\"bottomleftframe\">By Package</A></FONT><br></TD>"); h_.writeText("</TR>"); h_.writeText("<TR>"); - h_.writeText(" <TD NOWRAP><FONT CLASS=\"indexText\" size=\"-1\"><A HREF=\"classes_index_all" + h_.reportFileExt + "\" TARGET=\"bottomleftframe\">By Class</A></FONT><br></TD>"); + h_.writeText(" <TD NOWRAP><FONT CLASS=\"indexText\" size=\"-2\"><A HREF=\"classes_index_all" + h_.reportFileExt + "\" TARGET=\"bottomleftframe\">By Class</A></FONT><br></TD>"); h_.writeText("</TR>"); h_.writeText("<TR>"); - h_.writeText(" <TD NOWRAP><FONT CLASS=\"indexText\" size=\"-1\"><A HREF=\"constructors_index_all" + h_.reportFileExt + "\" TARGET=\"bottomleftframe\">By Constructor</A></FONT><br></TD>"); + h_.writeText(" <TD NOWRAP><FONT CLASS=\"indexText\" size=\"-2\"><A HREF=\"constructors_index_all" + h_.reportFileExt + "\" TARGET=\"bottomleftframe\">By Constructor</A></FONT><br></TD>"); h_.writeText("</TR>"); h_.writeText("<TR>"); - h_.writeText(" <TD NOWRAP><FONT CLASS=\"indexText\" size=\"-1\"><A HREF=\"methods_index_all" + h_.reportFileExt + "\" TARGET=\"bottomleftframe\">By Method</A></FONT><br></TD>"); + h_.writeText(" <TD NOWRAP><FONT CLASS=\"indexText\" size=\"-2\"><A HREF=\"methods_index_all" + h_.reportFileExt + "\" TARGET=\"bottomleftframe\">By Method</A></FONT><br></TD>"); h_.writeText("</TR>"); h_.writeText("<TR>"); - h_.writeText(" <TD NOWRAP><FONT CLASS=\"indexText\" size=\"-1\"><A HREF=\"fields_index_all" + h_.reportFileExt + "\" TARGET=\"bottomleftframe\">By Field</A></FONT><br></TD>"); + h_.writeText(" <TD NOWRAP><FONT CLASS=\"indexText\" size=\"-2\"><A HREF=\"fields_index_all" + h_.reportFileExt + "\" TARGET=\"bottomleftframe\">By Field</A></FONT><br></TD>"); h_.writeText("</TR>"); h_.writeText("</TABLE>"); @@ -140,7 +140,7 @@ public class HTMLFiles { h_.writeText(" <TABLE summary=\"Navigation bar\" BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"3\">"); h_.writeText(" <TR ALIGN=\"center\" VALIGN=\"top\">"); // Always have a link to the Javadoc files - h_.writeText(" <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"" + h_.newDocPrefix + "index.html\" target=\"_top\"><FONT CLASS=\"NavBarFont1\"><B><tt>" + apiDiff.newAPIName_ + "</tt></B></FONT></A> </TD>"); + h_.writeText(" <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"" + h_.newDocPrefix + "index.html\" target=\"_top\"><FONT CLASS=\"NavBarFont1\"><B><code>" + apiDiff.newAPIName_ + "</code></B></FONT></A> </TD>"); h_.writeText(" <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"" + h_.reportFileName + "-summary" + h_.reportFileExt + "\"><FONT CLASS=\"NavBarFont1\"><B>Overview</B></FONT></A> </TD>"); h_.writeText(" <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <FONT CLASS=\"NavBarFont1\">Package</FONT> </TD>"); h_.writeText(" <TD BGCOLOR=\"#FFFFFF\" CLASS=\"NavBarCell1\"> <FONT CLASS=\"NavBarFont1\">Class</FONT> </TD>"); @@ -167,17 +167,17 @@ public class HTMLFiles { h_.writeText(" <A HREF=\"" + "../" + h_.reportFileName + h_.reportFileExt + "\" TARGET=\"_top\"><B>FRAMES</B></A> "); h_.writeText(" <A HREF=\"jdiff_help" + h_.reportFileExt + "\" TARGET=\"_top\"><B>NO FRAMES</B></A></FONT></TD>"); h_.writeText("</TR>"); - + h_.writeText("</TABLE>"); h_.writeText("<HR>"); h_.writeText ("<!-- End of nav bar -->"); - h_.writeText("<center>"); + h_.writeText("<center>"); h_.writeText("<H1>JDiff Documentation</H1>"); - h_.writeText("</center>"); + h_.writeText("</center>"); h_.writeText("<BLOCKQUOTE>"); - h_.writeText("JDiff is a <a href=\"http://java.sun.com/j2se/javadoc/\" target=\"_top\">Javadoc</a> doclet which generates a report of the API differences between two versions of a product. It does not report changes in Javadoc comments, or changes in what a class or method does. "); + h_.writeText("JDiff is a <a href=\"https://java.sun.com/j2se/javadoc/\" target=\"_top\">Javadoc</a> doclet which generates a report of the API differences between two versions of a product. It does not report changes in Javadoc comments, or changes in what a class or method does. "); h_.writeText("This help page describes the different parts of the output from JDiff."); h_.writeText("</BLOCKQUOTE>"); @@ -197,23 +197,23 @@ public class HTMLFiles { h_.writeText("<BLOCKQUOTE>"); h_.writeText("You can always tell when you are reading a JDiff page, rather than a Javadoc page, by the color of the index bar and the color of the background. "); - h_.writeText("Links which take you to a Javadoc page are always in a <tt>typewriter</tt> font. "); + h_.writeText("Links which take you to a Javadoc page are always in a <code>typewriter</code> font. "); h_.writeText("Just like Javadoc, all interface names are in <i>italic</i>, and class names are not italicized. Where there are multiple entries in an index with the same name, the heading for them is also in italics, but is not a link."); h_.writeText("</BLOCKQUOTE>"); h_.writeText("<BLOCKQUOTE>"); - h_.writeText("<H3><b><tt>Javadoc</tt></b></H3>"); + h_.writeText("<H3><b><code>Javadoc</code></b></H3>"); h_.writeText("This is a link to the <a href=\"" + h_.newDocPrefix + "index.html\" target=\"_top\">top-level</a> Javadoc page for the new version of the product."); h_.writeText("</BLOCKQUOTE>"); - + h_.writeText("<BLOCKQUOTE>"); - h_.writeText("<H3>Overview</H3>"); - h_.writeText("The <a href=\"" + h_.reportFileName + "-summary" + - h_.reportFileExt + "\">overview</a> is the top-level summary of what was removed, added and changed between versions."); + h_.writeText("<H3>Overview</H3>"); + h_.writeText("The <a href=\"" + h_.reportFileName + "-summary" + + h_.reportFileExt + "\">overview</a> is the top-level summary of what was removed, added and changed between versions."); h_.writeText("</BLOCKQUOTE>"); - + h_.writeText("<BLOCKQUOTE>"); - h_.writeText("<H3>Package</H3>"); + h_.writeText("<H3>Package</H3>"); h_.writeText("This is a link to the package containing the current changed class or interface."); h_.writeText("</BLOCKQUOTE>"); @@ -265,7 +265,7 @@ public class HTMLFiles { } } - /** Emit the CSS external stylesheet file. */ + /** Emit the external stylesheet file. */ public void emitStylesheet() { String stylesheetFileName = "stylesheet-jdiff.css"; if (h_.outputDir != null) @@ -277,56 +277,10 @@ public class HTMLFiles { h_.writeText("/* (" + JDiff.jDiffLocation + ") */"); //h_.writeText("/* on " + new Date() + " */"); h_.writeText(); - //h_.writeText("/* Define colors, fonts and other style attributes here to override the defaults */"); - //h_.writeText(); - //h_.writeText("/* Page background color */"); - //h_.writeText("body { background-color: " + h_.bgcolor + "; font-family: arial; }"); - //First argument after backgroun: is for older Netscape browsers - //For more information, see http://css.nu/pointers/bugs.html and - //http://www.richinstyle.com/bugs/netscape4.html - //h_.writeText("body { background: #CCFFFF url(background.gif); font-family: arial; }"); - //h_.writeText(); - //h_.writeText("/* Table colors */"); - //h_.writeText(".TableHeadingColor { background: #CCCCFF } /* Dark mauve */"); - //h_.writeText(".TableSubHeadingColor { background: #EEEEFF } /* Light mauve */"); - //h_.writeText(".TableRowColor { background: #FFFFFF } /* White */"); - //h_.writeText(); - //h_.writeText("/* Font used in left-hand frame lists */"); - //h_.writeText(".FrameTitleFont { font-size: normal; font-family: normal }"); - //h_.writeText(".FrameHeadingFont { font-size: normal; font-family: normal }"); - //h_.writeText(".FrameItemFont { font-size: normal; font-family: normal }"); - //h_.writeText(); - //h_.writeText("/* Example of smaller, sans-serif font in frames */"); - //h_.writeText("/* .FrameItemFont { font-size: 10pt; font-family: Helvetica, Arial, sans-serif } */"); - //h_.writeText(); - //h_.writeText("/* Navigation bar fonts and colors */"); - //h_.writeText(".NavBarCell1 { background-color:#FFFFCC;} /* Changed to yellowish to make difference from Javadoc clear */"); - //h_.writeText(".NavBarCell1Rev { background-color:#00008B;}/* Dark Blue */"); - //h_.writeText(".NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;}"); - //h_.writeText(".NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;}"); - //h_.writeText(); - //h_.writeText(".NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;}"); - //h_.writeText(".NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;}"); - //h_.writeText(); - h_.writeText("/* "); - h_.writeText(" Links which become blue when hovered upon and show that they have been "); - h_.writeText(" visited. "); - h_.writeText("*/"); - h_.writeText(".hiddenlink {text-decoration:none;}"); - h_.writeText("a.hiddenlink:link {color: black; text-decoration: none}"); - h_.writeText("a.hiddenlink:visited {color: purple; text-decoration: none}"); - h_.writeText("a.hiddenlink:hover {color: blue; text-decoration: underline;}"); - h_.writeText(); - h_.writeText("/* "); - h_.writeText(" Links which become blue when hovered upon but do not show that they have "); - h_.writeText(" been visited. "); - h_.writeText("*/"); - h_.writeText("a.staysblack:link {color: black; text-decoration: none}"); - h_.writeText("a.staysblack:visited {color: black; text-decoration: none}"); - h_.writeText("a.staysblack:hover {color: blue; text-decoration: underline;}"); - h_.writeText(""); + h_.writeText("div.and-diff-id {border: 1px solid #eee;position:relative;float:right;clear:both;padding:0px;}"); h_.writeText("table.diffspectable {border:1px;padding:0px;margin:0px;}"); + h_.writeText(".diffspechead {background-color:#eee;}"); h_.writeText(".diffspectable tr {border:0px;padding:0px;}"); h_.writeText(".diffspectable td {background-color:eee;border:0px;font-size:90%;font-weight:normal;padding:0px;padding-left:1px;padding-right:1px;text-align:center;color:777;}"); h_.writeText("td.diffvalueold {color:orange;background-color:white;border:0px;font-size:80%;font-style:normal;text-align:left;padding:0px;padding-left:1px;padding-right:1px;line-height:.95em;}"); @@ -334,28 +288,46 @@ public class HTMLFiles { h_.writeText("td.diffvalue {color:444;background-color:white;border:0px;font-size:80%;font-weight:normal;text-align:left;padding:0px;padding-left:1px;padding-right:1px;line-height:.95em;}"); h_.writeText("td.diffspec {background-color:white;border:0px;font-size:80%;font-weight:normal;padding:1px;color:444;text-align:right;padding-right:.5em;line-height:.95em;}"); h_.writeText("tt {font-size:11pt;font-family:monospace;}"); - h_.writeText("code {font-size:11pt;font-family:monospace;}"); - h_.writeText(".indexHeader {font-size:11pt;line-height:.8em;}"); - h_.writeText(".indexText {font-size:9pt;line-height:.8em;padding-left:1em;}"); - - h_.writeText(".pagecontenth1 {"); - h_.writeText(" line-height: 130%;"); - h_.writeText(" font-size: 170%;"); - h_.writeText(" xmargin: 0 0 0 -10px;"); - h_.writeText(" padding: .8em 0 0;"); - h_.writeText(" border: none;"); - h_.writeText(" background: none;"); - h_.writeText("}"); - h_.writeText(""); - h_.writeText(".pagecontenth2 {"); - h_.writeText(" font-size: 130%;"); - h_.writeText(" font-weight: bold;"); - h_.writeText(" margin: 2em 0 0 -10px; "); - h_.writeText(" padding: 1px 3px;"); - h_.writeText(" position: relative;"); - h_.writeText(" border-top: 1px solid #3366CC;"); - h_.writeText(" background-color: #e5ecf9;"); - h_.writeText("}"); + h_.writeText(".indexHeader {"); + h_.writeText(" font-size:96%;"); + h_.writeText(" line-height:.8em;}"); + + h_.writeText(".jdiffIndex td {"); + h_.writeText(" font-size:96%;"); + h_.writeText(" xline-height:.8em;"); + h_.writeText(" padding:2px;"); + h_.writeText(" padding-left:1em;}"); + + h_.writeText(".indexText {"); + h_.writeText(" font-size:100%;"); + h_.writeText(" padding-left:1em;}"); + + h_.writeText("#indexTableCaption {"); + h_.writeText(" font-size:96%;"); + h_.writeText(" margin-top:.25em;"); + h_.writeText(" margin-bottom:0;"); + h_.writeText(" }"); + + h_.writeText(".hiddenlink {"); + h_.writeText(" font-size:96%;"); + h_.writeText(" line-height:.8em;"); + h_.writeText(" text-decoration:none;}"); + + h_.writeText("a {"); + h_.writeText(" text-decoration:none;}"); + + h_.writeText("a:hover {"); + h_.writeText(" text-decoration:underline;}"); + + h_.writeText(".indexBox {"); + h_.writeText(" border: 1px solid red;"); + h_.writeText(" margin:1em 0 0 0;}"); + + h_.writeText(".letterIndexHead {"); + h_.writeText(" font-size: 1.5em;font-weight:9;"); + h_.writeText(" margin:0 0 0em 0;"); + h_.writeText(" border: 1px solid red;}"); + h_.reportFile.close(); } catch(IOException e) { diff --git a/src/jdiff/HTMLIndexes.java b/src/jdiff/HTMLIndexes.java index 9e65d96..5cd90a1 100755 --- a/src/jdiff/HTMLIndexes.java +++ b/src/jdiff/HTMLIndexes.java @@ -84,15 +84,15 @@ public class HTMLIndexes { filename += "_all" + h_.reportFileExt; title = programElementType + " Differences Index"; } - + FileOutputStream fos = new FileOutputStream(filename); h_.reportFile = new PrintWriter(fos); h_.writeStartHTMLHeader(); h_.writeHTMLTitle(title); h_.writeStyleSheetRef(); h_.writeText("</HEAD>"); - h_.writeText("<BODY>"); - + h_.writeText("<BODY class=\"gc-documentation\" style=\"padding:12px;\">"); + if (programElementType.compareTo("Package") == 0) { emitPackagesIndex(apiDiff, indexType); } else if (programElementType.compareTo("Class") == 0) { @@ -145,7 +145,7 @@ public class HTMLIndexes { // Don't emit a reference to the current letter if (Character.toUpperCase(sw) != Character.toUpperCase(currChar)) { if (swu == '_') { - h_.writeText("<a href=\"#" + swu + "\"><font size=\"" + size + "\">" + "underscore" + "</font></a> "); + h_.writeText("<a href=\"#" + swu + "\"><font size=\"" + size + "\">" + "_" + "</font></a> "); } else { h_.writeText("<a href=\"#" + swu + "\"><font size=\"" + size + "\">" + swu + "</font></a> "); } @@ -162,7 +162,7 @@ public class HTMLIndexes { * added and changes sub-indexes. */ private void emitIndexHeader(String indexName, int indexType, - boolean hasRemovals, + boolean hasRemovals, boolean hasAdditions, boolean hasChanges) { String linkIndexName = indexName.toLowerCase(); boolean isAllDiffs = false; @@ -171,71 +171,66 @@ public class HTMLIndexes { isAllDiffs = true; } h_.writeText("<a NAME=\"topheader\"></a>"); // Named anchor - h_.writeText("<table summary=\"Index for " + indexName + "\" width=\"100%\" class=\"index\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"); + h_.writeText("<table summary=\"Index for " + indexName + "\" width=\"100%\" class=\"jdiffIndex\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"padding-bottom:0;margin-bottom:0;\">"); h_.writeText(" <tr>"); h_.writeText(" <th class=\"indexHeader\">"); h_.writeText(" Filter the Index:"); h_.writeText(" </th>"); h_.writeText(" </tr>"); h_.writeText(" <tr>"); - h_.writeText(" <td class=\"indexText\" style=\"line-height:1.5em;padding-left:2em;\">"); -// h_.writeText(" <div style=\"line-height:1.25em;padding-left:1em;>\">"); -// h_.writeText(" <FONT SIZE=\"-1\">"); - // The index name is also a hidden link to the *index_all page + h_.writeText(" <td class=\"indexText\" style=\"line-height:1.3em;padding-left:2em;\">"); + if (indexType == 3) { h_.writeText("<b>" + indexName + "</b>"); } else if (isAllDiffs) { - h_.writeText("<a href=\"" + linkIndexName + "_index_all" + h_.reportFileExt + "\" class=\"hiddenlink\">" + indexName + "</a>"); + h_.writeText("<a href=\"" + linkIndexName + "_index_all" + h_.reportFileExt + "\" xclass=\"hiddenlink\">" + indexName + "</a>"); } else { h_.writeText("<a href=\"" + linkIndexName + "_index_all" + h_.reportFileExt + "\" class=\"staysblack\">All " + indexName + "</a>"); } -// h_.writeText(" </FONT>"); h_.writeText(" <br>"); -// h_.writeText(" <FONT SIZE=\"-1\">"); + if (hasRemovals) { if (indexType == 0) { h_.writeText("<b>Removals</b>"); } else { - h_.writeText("<A HREF=\"" + linkIndexName + "_index_removals" + h_.reportFileExt + "\" class=\"hiddenlink\">Removals</A>"); + h_.writeText("<A HREF=\"" + linkIndexName + "_index_removals" + h_.reportFileExt + "\" xclass=\"hiddenlink\">Removals</A>"); } } else { h_.writeText("<font color=\"#999999\">Removals</font>"); } -// h_.writeText(" </FONT>"); h_.writeText(" <br>"); -// h_.writeText(" <FONT SIZE=\"-1\">"); + if (hasAdditions) { if (indexType == 1) { h_.writeText("<b>Additions</b>"); } else { - h_.writeText("<A HREF=\"" + linkIndexName + "_index_additions" + h_.reportFileExt + "\"class=\"hiddenlink\">Additions</A>"); + h_.writeText("<A HREF=\"" + linkIndexName + "_index_additions" + h_.reportFileExt + "\"xclass=\"hiddenlink\">Additions</A>"); } } else { h_.writeText("<font color=\"#999999\">Additions</font>"); } -// h_.writeText(" </FONT>"); h_.writeText(" <br>"); -// h_.writeText(" <FONT SIZE=\"-1\">"); + if (hasChanges) { if (indexType == 2) { h_.writeText("<b>Changes</b>"); } else { - h_.writeText("<A HREF=\"" + linkIndexName + "_index_changes" + h_.reportFileExt + "\"class=\"hiddenlink\">Changes</A>"); + h_.writeText("<A HREF=\"" + linkIndexName + "_index_changes" + h_.reportFileExt + "\"xclass=\"hiddenlink\">Changes</A>"); } } else { h_.writeText("<font color=\"#999999\">Changes</font>"); } -// h_.writeText(" </FONT>"); -// h_.writeText(" </div>"); + h_.writeText(" </td>"); h_.writeText(" </tr>"); h_.writeText("</table>"); - h_.writeText("<font size=\"-2\"><strong>Bold</strong> indicates New; <strike>Strike</strike> indicates deleted</font>"); - h_.writeText(" </br>"); + h_.writeText("<div id=\"indexTableCaption\" style=\"background-color:#eee;padding:0 4px 0 4px;font-size:11px;margin-bottom:1em;\">"); + h_.writeText("Listed as: <span style=\"color:#069\"><strong>Added</strong></span>, <span style=\"color:#069\"><strike>Removed</strike></span>, <span style=\"color:#069\">Changed</span></font>"); + h_.writeText("</div>"); } @@ -281,14 +276,15 @@ public class HTMLIndexes { // Package names are unique, so no need to check for duplicates. iter = packageNames.iterator(); char oldsw = '\0'; + h_.writeText("<div id=\"indexTableEntries\">"); while (iter.hasNext()) { Index pkg = (Index)(iter.next()); oldsw = emitPackageIndexEntry(pkg, oldsw); } } - /** - * Emit an index entry for a package. + /** + * Emit an index entry for a package. * Package names are unique, so no need to check for duplicates. */ public char emitPackageIndexEntry(Index pkg, char oldsw) { @@ -497,7 +493,7 @@ public class HTMLIndexes { // Add the named anchor for this new letter h_.writeText("<A NAME=\"" + Character.toUpperCase(res) + "\"></A>"); if (sw == '_') - h_.writeText("<br><b>underscore</b> "); + h_.writeText("<br><b>_</b> "); else h_.writeText("<br><font size=\"+2\">" + Character.toUpperCase(sw) + "</font> "); generateLetterIndex(classNames, sw, false); @@ -600,7 +596,7 @@ public class HTMLIndexes { // Add the named anchor for this new letter h_.writeText("<A NAME=\"" + Character.toUpperCase(res) + "\"></A>"); if (sw == '_') - h_.writeText("<br><b>underscore</b> "); + h_.writeText("<br><b>_</b> "); else h_.writeText("<br><font size=\"+2\">" + Character.toUpperCase(sw) + "</font> "); generateLetterIndex(ctorNames, sw, false); @@ -700,7 +696,7 @@ public class HTMLIndexes { // Add the named anchor for this new letter h_.writeText("<A NAME=\"" + Character.toUpperCase(res) + "\"></A>"); if (sw == '_') - h_.writeText("<br><b>underscore</b> "); + h_.writeText("<br><b>_</b> "); else h_.writeText("<br><font size=\"+2\">" + Character.toUpperCase(sw) + "</font> "); generateLetterIndex(methNames, sw, false); @@ -816,7 +812,7 @@ public class HTMLIndexes { // Add the named anchor for this new letter h_.writeText("<A NAME=\"" + Character.toUpperCase(res) + "\"></A>"); if (sw == '_') - h_.writeText("<br><b>underscore</b> "); + h_.writeText("<br><b>_</b> "); else h_.writeText("<br><font size=\"+2\">" + Character.toUpperCase(sw) + "</font> "); generateLetterIndex(fieldNames, sw, false); @@ -826,42 +822,41 @@ public class HTMLIndexes { h_.writeText("<i>" + fld.name_ + "</i><br>"); } if (multipleMarker != 0) { -// More context than this is helpful here: h_.indent(INDENT_SIZE); - h_.writeText(" in "); + h_.writeText("<nobr> in "); } // Deal with each type of difference if (fld.changeType_ == 0) { - String commentID = className + "." + fld.name_; - if (multipleMarker == 0) { + String commentID = className + "." + fld.name_; + if (multipleMarker == 0) { h_.writeText("<nobr><A HREF=\"" + memberRef + h_.reportFileExt + "#" + commentID + "\" class=\"hiddenlink\" target=\"rightframe\"><strike>" + fld.name_ + "</strike></A>"); h_.writeText("</nobr><br>"); } else { - h_.writeText("<nobr><A HREF=\"" + memberRef + h_.reportFileExt + "#" + commentID + "\" class=\"hiddenlink\" target=\"rightframe\"><strike>" + className + "</strike></A>"); + h_.writeText("<A HREF=\"" + memberRef + h_.reportFileExt + "#" + commentID + "\" class=\"hiddenlink\" target=\"rightframe\"><strike>" + className + "</strike></A>"); h_.writeText("</nobr><br>"); } } else if (fld.changeType_ == 1) { - String commentID = className + "." + fld.name_; - if (multipleMarker == 0) { + String commentID = className + "." + fld.name_; + if (multipleMarker == 0) { h_.writeText("<nobr><A HREF=\"" + memberRef + h_.reportFileExt + "#" + commentID + "\" class=\"hiddenlink\" target=\"rightframe\">" + fld.name_ + "</A>"); h_.writeText("</nobr><br>"); } else { - h_.writeText("<nobr><A HREF=\"" + memberRef + h_.reportFileExt + "#" + commentID + "\" class=\"hiddenlink\" target=\"rightframe\">" + className + "</A>"); + h_.writeText("<A HREF=\"" + memberRef + h_.reportFileExt + "#" + commentID + "\" class=\"hiddenlink\" target=\"rightframe\">" + className + "</A>"); h_.writeText("</nobr><br>"); } } else if (fld.changeType_ == 2) { - String commentID = className + "." + fld.name_; - if (multipleMarker == 0) { + String commentID = className + "." + fld.name_; + if (multipleMarker == 0) { h_.writeText("<nobr><A HREF=\"" + memberRef + h_.reportFileExt + "#" + commentID + "\" class=\"hiddenlink\" target=\"rightframe\">" + fld.name_ + "</A>"); h_.writeText("</nobr><br>"); } else { - h_.writeText("<nobr><A HREF=\"" + memberRef + h_.reportFileExt + "#" + commentID + "\" class=\"hiddenlink\" target=\"rightframe\">" + className + "</A>"); + h_.writeText("<A HREF=\"" + memberRef + h_.reportFileExt + "#" + commentID + "\" class=\"hiddenlink\" target=\"rightframe\">" + className + "</A>"); h_.writeText("</nobr><br>"); } } return res; } - /** + /** * Emit the index of all changes, which appears in the bottom left frame. * Has to be run after all the other indexes have been written, since it * uses data from when they are generated. diff --git a/src/jdiff/HTMLReportGenerator.java b/src/jdiff/HTMLReportGenerator.java index c896525..5ba10a6 100755 --- a/src/jdiff/HTMLReportGenerator.java +++ b/src/jdiff/HTMLReportGenerator.java @@ -87,42 +87,38 @@ public class HTMLReportGenerator { // writeText("<div class=\"g-section g-tpl-180\">"); // Add the nav bar for the summary page - writeNavigationBar(reportFileName + "-summary", null, null, + writeNavigationBar(reportFileName + "-summary", null, null, null, 0, true, - apiDiff.packagesRemoved.size() != 0, + apiDiff.packagesRemoved.size() != 0, apiDiff.packagesAdded.size() != 0, apiDiff.packagesChanged.size() != 0); - + + writeText(" <div id=\"docTitleContainer\">"); // Write the title in the body with some formatting if (docTitle == null) { - //writeText("<center>"); - writeText(" <div id=\"titleAligner\" style=\"vertical-align:top;padding:1em;margin-left:0;text-align:left;\">"); - writeText(" <H1 class=\"pagecontenth1\">API Differences Report</H1>"); - writeText(" </div>"); + //writeText("<center>"); + writeText("<h1>Android API Differences Report</h1>"); } else { - writeText(" <div id=\"titleAligner\" style=\"vertical-align:top;padding:1em;margin-left:0;text-align:left;\">"); - writeText(" <H1 class=\"pagecontenth1\">" + docTitle + "</H1>"); - writeText(" </div>"); + writeText(" <h1>" + docTitle + "</h1>"); } - writeText("<p>This document details the changes in the Android framework API. It shows "); - writeText("additions, modifications, and removals for packages, classes, methods, and "); - writeText("fields. Each reference to an API change includes a brief description of the "); - writeText("API and an explanation of the change and suggested workaround, where available.</p>"); + writeText("<p>This report details the changes in the core Android framework API between two <a "); writeText("href=\"https://developer.android.com/guide/appendix/api-levels.html\" target=\"_top\">API Level</a> "); + writeText("specifications. It shows additions, modifications, and removals for packages, classes, methods, and fields. "); + writeText("The report also includes general statistics that characterize the extent and type of the differences.</p>"); - writeText("<p>The differences described in this report are based a comparison of the APIs "); - writeText("whose versions are specified in the upper-right corner of this page. It compares a "); - writeText("newer \"to\" API to an older \"from\" version, noting any changes relative to the "); - writeText("older API. So, for example, indicated API removals are no longer present in the \"to\" "); - writeText("API.</p>"); + writeText("<p>This report is based a comparison of the Android API specifications "); + writeText("whose API Level identifiers are given in the upper-right corner of this page. It compares a "); + writeText("newer \"to\" API to an older \"from\" API, noting all changes relative to the "); + writeText("older API. So, for example, API elements marked as removed are no longer present in the \"to\" "); + writeText("API specification.</p>"); writeText("<p>To navigate the report, use the \"Select a Diffs Index\" and \"Filter the Index\" "); writeText("controls on the left. The report uses text formatting to indicate <em>interface names</em>, "); - writeText("<a href= ><tt>links to reference documentation</tt></a>, and <a href= >links to change "); - writeText("description</a>. </p>"); + writeText("<a href= ><code>links to reference documentation</code></a>, and <a href= >links to change "); + writeText("description</a>. The statistics are accessible from the \"Statistics\" link in the upper-right corner.</p>"); writeText("<p>For more information about the Android framework API and SDK, "); - writeText("see the <a href=\"http://code.google.com/android/index.html\" target=\"_top\">Android product site</a>.</p>"); + writeText("see the <a href=\"https://developer.android.com/index.html\" target=\"_top\">Android Developers site</a>.</p>"); // Write the contents and the other files as well writeReport(apiDiff); @@ -236,29 +232,29 @@ public class HTMLReportGenerator { reportChangedPackage(pkgDiffs, i); } } - writeText("</div><!-- end pagecontent -->"); - writeText("</div><!-- end codesitecontent -->"); - writeText("<div style=\"padding-left: 10px; padding-right: 10px; margin-top: 0; padding-bottom: 15px;\">"); - writeText(" <table style=\"width: 100%; border: none;\"><tr>"); - writeText(" <td style=\"text-align:center;font-size: 10pt; border: none; color: ccc;\"> "); - writeText(" <span>©2008 Google - "); - writeText(" <a href=\"http://code.google.com\">Code Home</a> - "); - writeText(" <a href=\"http://www.google.com/accounts/TOS\">Site Terms of Service</a> - "); - writeText(" <a href=\"http://www.google.com/privacy.html\">Privacy Policy</a> "); - writeText(" </span>"); - writeText(" <div style=\"position:relative;margin-top:-2em;" ); - writeText(" font-size:8pt;color:aaa;text-align:right;\">"); - writeText(" <em>Generated by <a href=\"http://www.jdiff.org/\">JDiff</a></em><br><img "); - writeText(" align=\"right\" src=\"../../../assets/jdiff_logo.gif\">"); - writeText(" </span>"); - writeText(" </td>"); - writeText(" </tr></table>"); - writeText("</div>"); - writeText("</div><!-- end gc-containter -->"); -} - - /** - * Write out the details of a changed package in a separate file. + writeText(" </div> "); + writeText(" <div id=\"footer\">"); + writeText(" <div id=\"copyright\">"); + writeText(" Except as noted, this content is licensed under "); + writeText(" <a href=\"https://creativecommons.org/licenses/by/2.5/\"> Creative Commons Attribution 2.5</a>."); + writeText(" For details and restrictions, see the <a href=\"https://developer.android.com/license.html\">Content License</a>."); + writeText(" </div>"); + writeText(" <div id=\"footerlinks\">"); + writeText(" <p>"); + writeText(" <a href=\"https://www.android.com/terms.html\">Site Terms of Service</a> -"); + writeText(" <a href=\"https://www.android.com/privacy.html\">Privacy Policy</a> -"); + writeText(" <a href=\"https://www.android.com/branding.html\">Brand Guidelines</a>"); + writeText(" </p>"); + writeText(" </div>"); + writeText(" </div> <!-- end footer -->"); + writeText(" </div><!-- end doc-content -->"); + writeText(" </div> <!-- end body-content --> "); + } + + + + /** + * Write out the details of a changed package in a separate file. */ public void reportChangedPackage(PackageDiff[] pkgDiffs, int pkgIndex) { PackageDiff pkgDiff = pkgDiffs[pkgIndex]; @@ -290,7 +286,7 @@ public class HTMLReportGenerator { pkgRef = pkgRef.replace('.', '/'); pkgRef = newDocPrefix + pkgRef + "/package-summary"; // A link to the package in the new API - String linkedPkgName = "<A HREF=\"" + pkgRef + ".html\" target=\"_top\"><font size=\"+1\"><tt>" + pkgName + "</tt></font></A>"; + String linkedPkgName = "<A HREF=\"" + pkgRef + ".html\" target=\"_top\"><font size=\"+1\"><code>" + pkgName + "</code></font></A>"; String prevPkgRef = null; if (pkgIndex != 0) { prevPkgRef = "pkg_" + pkgDiffs[pkgIndex-1].name_ + reportFileExt; @@ -300,7 +296,7 @@ public class HTMLReportGenerator { if (pkgIndex < pkgDiffs.length - 1) { nextPkgRef = "pkg_" + pkgDiffs[pkgIndex+1].name_ + reportFileExt; } - + writeSectionHeader("Package " + linkedPkgName, pkgName, prevPkgRef, nextPkgRef, null, 1, @@ -316,16 +312,16 @@ public class HTMLReportGenerator { String newPkgRef = pkgDocRef; if (oldDocPrefix != null) oldPkgRef = oldDocPrefix + oldPkgRef; - else + else oldPkgRef = null; newPkgRef = newDocPrefix + newPkgRef; - if (oldPkgRef != null) + if (oldPkgRef != null) pkgDiff.documentationChange_ += "<A HREF=\"" + oldPkgRef + - ".html#package_description\" target=\"_self\"><font size=\"+1\"><tt>old</tt></font></A> to "; + ".html#package_description\" target=\"_self\"><code>old</code></A> to "; else - pkgDiff.documentationChange_ += "<font size=\"+1\"><tt>old</tt></font> to "; - pkgDiff.documentationChange_ += "<A HREF=\"" + newPkgRef + - ".html#package_description\" target=\"_self\"><font size=\"+1\"><tt>new</tt></font></A>. "; + pkgDiff.documentationChange_ += "<font size=\"+1\"><code>old</code></font> to "; + pkgDiff.documentationChange_ += "<A HREF=\"" + newPkgRef + + ".html#package_description\" target=\"_self\"><code>new</code></A>. "; writeText(pkgDiff.documentationChange_); } @@ -469,7 +465,7 @@ public class HTMLReportGenerator { classRef = newDocPrefix + classRef; } // A link to the class in the new API - String linkedClassName = "<A HREF=\"" + classRef + ".html\" target=\"_top\"><font size=\"+1\"><tt>" + className + "</tt></font></A>"; + String linkedClassName = "<A HREF=\"" + classRef + ".html\" target=\"_top\"><font size=\"+2\"><code>" + className + "</code></font></A>"; String lcn = pkgName + "." + linkedClassName; //Links to the previous and next classes String prevClassRef = null; @@ -516,13 +512,13 @@ public class HTMLReportGenerator { oldClassRef = oldDocPrefix + oldClassRef; } } - if (oldDocPrefix != null) + if (oldDocPrefix != null) classDiff.documentationChange_ += "<A HREF=\"" + oldClassRef + - ".html\" target=\"_self\"><font size=\"+1\"><tt>old</tt></font></A> to "; + ".html\" target=\"_self\"><code>old</code></A> to "; else - classDiff.documentationChange_ += "<font size=\"+1\"><tt>old</tt></font> to "; - classDiff.documentationChange_ += "<A HREF=\"" + classRef + - ".html\" target=\"_self\"><font size=\"+1\"><tt>new</tt></font></A>. "; + classDiff.documentationChange_ += "<font size=\"+1\"><code>old</code></font> to "; + classDiff.documentationChange_ += "<A HREF=\"" + classRef + + ".html\" target=\"_self\"><code>new</code></A>. "; writeText(classDiff.documentationChange_); } @@ -704,8 +700,8 @@ public class HTMLReportGenerator { /** Write the start of the HTML header. */ public void writeStartHTMLHeader(boolean addDate) { - writeText("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Frameset//EN\"\"" + RootDocToXML.baseURI + "/TR/REC-html40/frameset.dtd\">"); - writeText("<HTML>"); + writeText("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"https://www.w3.org/TR/html4/strict.dtd\">"); + writeText("<HTML style=\"overflow:auto;\">"); writeText("<HEAD>"); writeText("<meta name=\"generator\" content=\"JDiff v" + JDiff.version + "\">"); writeText("<!-- Generated by the JDiff Javadoc doclet -->"); @@ -730,61 +726,72 @@ public class HTMLReportGenerator { writeStyleSheetRef(false); } - /** + /** * Write the HTML style sheet reference. If inSameDir is set, don't add * "../" to the location. */ public void writeStyleSheetRef(boolean inSameDir) { if (inSameDir) { - writeText("<link rel=\"stylesheet\" type=\"text/css\" href=\"../../../assets/codesite/codesite.css\" />"); - writeText("<link rel=\"stylesheet\" type=\"text/css\" href=\"../../../assets/codesite/codesearch.css\" />"); - writeText("<link rel=\"stylesheet\" type=\"text/css\" href=\"../../../assets/codesite/semantic_headers.css\" />"); - writeText("<link rel=\"stylesheet\" type=\"text/css\" href=\"../../../assets/style.css\" />"); - writeText("<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"stylesheet-jdiff.css\" TITLE=\"Style\">"); - } - else { - writeText("<link rel=\"stylesheet\" type=\"text/css\" href=\"../../../assets/codesite/codesite.css\" />"); - writeText("<link rel=\"stylesheet\" type=\"text/css\" href=\"../../../assets/codesite/codesearch.css\" />"); - writeText("<link rel=\"stylesheet\" type=\"text/css\" href=\"../../../assets/codesite/semantic_headers.css\" />"); - writeText("<link rel=\"stylesheet\" type=\"text/css\" href=\"../../../assets/style.css\" />"); - writeText("<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"../stylesheet-jdiff.css\" TITLE=\"Style\">"); - } -// This doesn't work in non-windows browsers, so have to change the stylesheet -// writeText("<!-- Override the color choice for the navigation bar -->"); -// writeText("<STYLE>"); -// //writeText(".NavBarCell1 { background-color:#FFFF99;} /* palegoldenrod */"); -// writeText(".NavBarCell1 { background-color:#FFFFCC;} /* */"); -// writeText("</STYLE>"); + writeText("<link href=\"../../../assets/android-developer-docs.css\" rel=\"stylesheet\" type=\"text/css\" />"); + writeText("<link href=\"stylesheet-jdiff.css\" rel=\"stylesheet\" type=\"text/css\" />"); + writeText("<noscript>"); + writeText("<style type=\"text/css\">"); + writeText("body{overflow:auto;}"); + writeText("#body-content{position:relative; top:0;}"); + writeText("#doc-content{overflow:visible;border-left:3px solid #666;}"); + writeText("#side-nav{padding:0;}"); + writeText("#side-nav .toggle-list ul {display:block;}"); + writeText("#resize-packages-nav{border-bottom:3px solid #666;}"); + writeText("</style>"); + writeText("</noscript>"); + writeText("<style type=\"text/css\">"); + writeText("</style>"); + } else { + writeText("<link href=\"../../../../assets/android-developer-docs.css\" rel=\"stylesheet\" type=\"text/css\" />"); + writeText("<link href=\"../stylesheet-jdiff.css\" rel=\"stylesheet\" type=\"text/css\" />"); + writeText("<noscript>"); + writeText("<style type=\"text/css\">"); + writeText("body{overflow:auto;}"); + writeText("#body-content{position:relative; top:0;}"); + writeText("#doc-content{overflow:visible;border-left:3px solid #666;}"); + writeText("#side-nav{padding:0;}"); + writeText("#side-nav .toggle-list ul {display:block;}"); + writeText("#resize-packages-nav{border-bottom:3px solid #666;}"); + writeText("</style>"); + writeText("</noscript>"); + writeText("<style type=\"text/css\">"); + writeText("</style>"); + } } /** Write the HTML footer. */ public void writeHTMLFooter() { - writeText("<script src=\"http://www.google-analytics.com/ga.js\" type=\"text/javascript\">"); - writeText("</script>"); - writeText("<script type=\"text/javascript\">"); - writeText(" try {"); - writeText(" var pageTracker = _gat._getTracker(\"UA-18071-1\");"); - writeText(" pageTracker._setAllowAnchor(true);"); - writeText(" pageTracker._initData();"); - writeText(" pageTracker._trackPageview();"); - writeText(" } catch(e) {}"); - writeText("</script>"); - writeText("</BODY>"); - writeText("</HTML>"); + writeText("<script src=\"https://www.google-analytics.com/ga.js\" type=\"text/javascript\">"); + writeText("</script>"); + writeText("<script type=\"text/javascript\">"); + writeText(" try {"); + writeText(" var pageTracker = _gat._getTracker(\"UA-5831155-1\");"); + writeText(" pageTracker._setAllowAnchor(true);"); + writeText(" pageTracker._initData();"); + writeText(" pageTracker._trackPageview();"); + writeText(" } catch(e) {}"); + writeText("</script>"); + writeText("</BODY>"); + writeText("</HTML>"); } - /** - * Write a section header, which includes a navigation bar. - * + /** + * Write a section header, which includes a navigation bar. + * * @param title Title of the header. Contains any links necessary. - * @param packageName The name of the current package, with no slashes or + * @param packageName The name of the current package, with no slashes or * links in it. May be null - * @param prevElemLink An HTML link to the previous element (a package or + * @param prevElemLink An HTML link to the previous element (a package or * class). May be null. - * @param nextElemLink An HTML link to the next element (a package or + * @param nextElemLink An HTML link to the next element (a package or * class). May be null. - * @param className The name of the current class, with no slashes or + * @param className The name of the current class, with no slashes or * links in it. May be null. * @param level 0 = overview, 1 = package, 2 = class/interface */ @@ -817,45 +824,39 @@ public class HTMLReportGenerator { * links in it. May be null * @param level 0 = overview, 1 = package, 2 = class/interface */ - public void writeSectionFooter(String packageName, + public void writeSectionFooter(String packageName, String prevElemLink, String nextElemLink, String className, int level) { - writeText("</div><!-- end codesitecontent -->"); - writeText("<div style=\"padding-left: 10px; padding-right: 10px; margin-top: 0; padding-bottom: 15px;\">"); - writeText(" <table style=\"width: 100%; border: none;\"><tr>"); - writeText(" <td style=\"text-align:center;font-size: 10pt; border: none; color: ccc;\"> "); - writeText(" <span>©2008 Google - "); - writeText(" <a href=\"http://code.google.com\">Code Home</a> - "); - writeText(" <a href=\"http://www.google.com/accounts/TOS\">Site Terms of Service</a> - "); - writeText(" <a href=\"http://www.google.com/privacy.html\">Privacy Policy</a> "); - writeText(" </span>"); - writeText(" <div style=\"xborder:1px solid red;position:relative;margin-top:-2em;" ); - writeText(" font-size:8pt;color:aaa;text-align:right;\">"); - writeText(" <em>Generated by <a href=\"http://www.jdiff.org/\">JDiff</a></em><br><img "); - writeText(" align=\"right\" src=\"../../../assets/jdiff_logo.gif\">"); - writeText(" </span>"); - writeText(" </td>"); - writeText(" </tr></table>"); - writeText("</div>"); - writeText("</div><!-- end gc-containter -->"); -/* - reportFile.println("<HR>"); - writeNavigationBar(packageName, prevElemLink, nextElemLink, - className, level, false, - false, false, false); -*/ + writeText(" </div> "); + writeText(" <div id=\"footer\">"); + writeText(" <div id=\"copyright\">"); + writeText(" Except as noted, this content is licensed under "); + writeText(" <a href=\"https://creativecommons.org/licenses/by/2.5/\"> Creative Commons Attribution 2.5</a>."); + writeText(" For details and restrictions, see the <a href=\"https://developer.android.com/license.html\">Content License</a>."); + writeText(" </div>"); + writeText(" <div id=\"footerlinks\">"); + writeText(" <p>"); + writeText(" <a href=\"https://www.android.com/terms.html\">Site Terms of Service</a> -"); + writeText(" <a href=\"https://www.android.com/privacy.html\">Privacy Policy</a> -"); + writeText(" <a href=\"https://www.android.com/branding.html\">Brand Guidelines</a>"); + writeText(" </p>"); + writeText(" </div>"); + writeText(" </div> <!-- end footer -->"); + writeText(" </div><!-- end doc-content -->"); + writeText(" </div> <!-- end body-content --> "); + } - - /** - * Write a navigation bar section header. - * - * @param pkgName The name of the current package, with no slashes or + + /** + * Write a navigation bar section header. + * + * @param pkgName The name of the current package, with no slashes or * links in it. - * @param prevElemLink An HTML link to the previous element (a package or + * @param prevElemLink An HTML link to the previous element (a package or * class). May be null. - * @param nextElemLink An HTML link to the next element (a package or + * @param nextElemLink An HTML link to the next element (a package or * class). May be null. - * @param className The name of the current class, with no slashes or + * @param className The name of the current class, with no slashes or * links in it. May be null. * @param level 0 = overview, 1 = package, 2 = class/interface */ @@ -864,250 +865,70 @@ public class HTMLReportGenerator { String prevElemLink, String nextElemLink, String className, int level, boolean upperNavigationBar, - boolean hasRemovals, boolean hasAdditions, + boolean hasRemovals, boolean hasAdditions, boolean hasChanges) { - String oldAPIName = "Old API"; - if (apiDiff.oldAPIName_ != null) - oldAPIName = apiDiff.oldAPIName_; - String newAPIName = "New API"; - if (apiDiff.newAPIName_ != null) - newAPIName = apiDiff.newAPIName_; + String oldAPIName = "Old API"; + if (apiDiff.oldAPIName_ != null) + oldAPIName = apiDiff.oldAPIName_; + String newAPIName = "New API"; + if (apiDiff.newAPIName_ != null) + newAPIName = apiDiff.newAPIName_; - SimpleDateFormat formatter - = new SimpleDateFormat ("yyyy.MM.dd HH:mm"); - Date day = new Date(); + SimpleDateFormat formatter + = new SimpleDateFormat ("yyyy.MM.dd HH:mm"); + Date day = new Date(); reportFile.println("<!-- Start of nav bar -->"); - reportFile.println("<div id=\"gc-container\" style=\"padding-left:1em;padding-right:1em;\" id=\"pagecontent\">"); reportFile.println("<a name=\"top\"></a>"); - reportFile.println("<div id=\"gc-header\">"); - reportFile.println(" <div id=\"logo\" style=\"padding-left:1em;\">"); - reportFile.println(" <a href=\"../../../documentation.html\" target=\"_top\"><img style=\"border: 0;\" src=\"../../../assets-google/android-logo-sm.gif\" \"/></a>"); - reportFile.println(" </div> <!-- End logo -->"); - reportFile.println(" <div class=\"and-diff-id\">"); - reportFile.println(" <table class=\"diffspectable\">"); + reportFile.println("<div id=\"header\" style=\"margin-bottom:0;padding-bottom:0;\">"); + reportFile.println("<div id=\"headerLeft\">"); + reportFile.println("<a href=\"../../../../index.html\" tabindex=\"-1\" target=\"_top\"><img src=\"../../../../assets/images/bg_logo.png\" alt=\"Android Developers\" /></a>"); + reportFile.println("</div>"); + reportFile.println(" <div id=\"headerRight\">"); + reportFile.println(" <div id=\"headerLinks\">"); + reportFile.println("<!-- <img src=\"/assets/images/icon_world.jpg\" alt=\"\" /> -->"); + reportFile.println("<span class=\"text\">"); + reportFile.println("<!-- <a href=\"#\">English</a> | -->"); + reportFile.println("<nobr><a href=\"https://developer.android.com\" target=\"_top\">Android Developers</a> | <a href=\"https://www.android.com\" target=\"_top\">Android.com</a></nobr>"); + reportFile.println("</span>"); + reportFile.println("</div>"); + reportFile.println(" <div class=\"and-diff-id\" style=\"margin-top:6px;margin-right:8px;\">"); + reportFile.println(" <table class=\"diffspectable\">"); reportFile.println(" <tr>"); reportFile.println(" <td colspan=\"2\" class=\"diffspechead\">API Diff Specification</td>"); reportFile.println(" </tr>"); reportFile.println(" <tr>"); - reportFile.println(" <td class=\"diffspec\" style=\"padding-top:.25em\">To Version:</td>"); + reportFile.println(" <td class=\"diffspec\" style=\"padding-top:.25em\">To Level:</td>"); reportFile.println(" <td class=\"diffvaluenew\" style=\"padding-top:.25em\">" + newAPIName + "</td>"); reportFile.println(" </tr>"); reportFile.println(" <tr>"); - reportFile.println(" <td class=\"diffspec\">From Version:</td>"); + reportFile.println(" <td class=\"diffspec\">From Level:</td>"); reportFile.println(" <td class=\"diffvalueold\">" + oldAPIName + "</td>"); reportFile.println(" </tr>"); -// reportFile.println(" <tr>"); -// reportFile.println(" <td class=\"diffspec\">Product Type:</td>"); -// reportFile.println(" <td class=\"diffvalue\">Generic</td>"); -// reportFile.println(" </tr>"); reportFile.println(" <tr>"); reportFile.println(" <td class=\"diffspec\">Generated</td>"); reportFile.println(" <td class=\"diffvalue\">" + formatter.format( day ) + "</td>"); reportFile.println(" </tr>"); reportFile.println(" </table>"); - reportFile.println(" </div> <!-- End and-diff-id -->"); - - if (doStats) { - reportFile.println(" <div class=\"and-diff-id\">"); + reportFile.println(" </div><!-- End and-diff-id -->"); + if (doStats) { + reportFile.println(" <div class=\"and-diff-id\" style=\"margin-right:8px;\">"); reportFile.println(" <table class=\"diffspectable\">"); reportFile.println(" <tr>"); - reportFile.println(" <td class=\"diffspec\" colspan=\"2\"><a href=\"jdiff_statistics.html\">Statistics</a></div>"); + reportFile.println(" <td class=\"diffspec\" colspan=\"2\"><a href=\"jdiff_statistics.html\">Statistics</a>"); reportFile.println(" </tr>"); reportFile.println(" </table>"); reportFile.println(" </div> <!-- End and-diff-id -->"); } - - reportFile.println("</div> <!-- End gc-header -->"); - reportFile.println("<div id=\"codesiteContent\" style=\"margin-top: 70px;margin-bottom:80px;\">"); - -/* - reportFile.println("<TABLE summary=\"Navigation bar\" BORDER=\"0\" WIDTH=\"100%\" CELLPADDING=\"1\" CELLSPACING=\"0\">"); - reportFile.println(" <TR>"); - reportFile.println(" <TD COLSPAN=2 BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\">"); - reportFile.println(" <TABLE summary=\"Navigation bar\" BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"3\">"); - reportFile.println(" <TR ALIGN=\"center\" VALIGN=\"top\">"); - boolean atOverview = (level == 0); - boolean atPackage = (level == 1); - boolean atClass = (level == 2); - - // Always have a link to the Javadoc files - if (atOverview) { - reportFile.println(" <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"" + newDocPrefix + "index.html\" target=\"_top\"><FONT CLASS=\"NavBarFont1\"><B><font size=\"+1\"><tt>" + apiDiff.newAPIName_ + "</tt></font></B></FONT></A> </TD>"); - } else if (atPackage) { - String pkgRef = pkgName; - pkgRef = pkgRef.replace('.', '/'); - pkgRef = newDocPrefix + pkgRef + "/package-summary"; - reportFile.println(" <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"" + pkgRef + ".html\" target=\"_top\"><FONT CLASS=\"NavBarFont1\"><B><font size=\"+1\"><tt>" + apiDiff.newAPIName_ + "</tt></font></B></FONT></A> </TD>"); - } else if (atClass) { - String classRef = pkgName + "." + className; - classRef = classRef.replace('.', '/'); - if (className.indexOf('.') != -1) { - classRef = pkgName + "."; - classRef = classRef.replace('.', '/'); - classRef = newDocPrefix + classRef + className; - } else { - classRef = newDocPrefix + classRef; - } - reportFile.println(" <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"" + classRef + ".html\" target=\"_top\"><FONT CLASS=\"NavBarFont1\"><B><font size=\"+1\"><tt>" + apiDiff.newAPIName_ + "</tt></font></B></FONT></A> </TD>"); - } - - if (atOverview) { - reportFile.println(" <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1Rev\"> <FONT CLASS=\"NavBarFont1Rev\"><B>Overview</B></FONT> </TD>"); - reportFile.println(" <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <FONT CLASS=\"NavBarFont1\">Package</FONT> </TD>"); - reportFile.println(" <TD BGCOLOR=\"#FFFFFF\" CLASS=\"NavBarCell1\"> <FONT CLASS=\"NavBarFont1\">Class</FONT> </TD>"); - } - - String changesSummaryName = reportFileName + "-summary" + reportFileExt; - if (atPackage) { - reportFile.println(" <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"" + changesSummaryName + "\"><FONT CLASS=\"NavBarFont1\"><B>Overview</B></FONT></A> </TD>"); - reportFile.println(" <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1Rev\"> <FONT CLASS=\"NavBarFont1Rev\"><B>Package</B></FONT> </TD>"); - reportFile.println(" <TD BGCOLOR=\"#FFFFFF\" CLASS=\"NavBarCell1\"> <FONT CLASS=\"NavBarFont1\">Class</FONT> </TD>"); - } - if (atClass) { - reportFile.println(" <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"" + changesSummaryName + "\"><FONT CLASS=\"NavBarFont1\"><B>Overview</B></FONT></A> </TD>"); - reportFile.println(" <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"pkg_" + pkgName + reportFileExt + "\"><FONT CLASS=\"NavBarFont1\"><B>Package</B></FONT></A> </TD>"); - reportFile.println(" <TD BGCOLOR=\"#FFFFFF\" CLASS=\"NavBarCell1Rev\"> <FONT CLASS=\"NavBarFont1Rev\"><B>Class</B></FONT> </TD>"); - } - - if (!Diff.noDocDiffs) { - if (atPackage) { - String id = (String)Diff.firstDiffOutput.get(pkgName + "!package"); - if (id != null) - reportFile.println(" <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"" + Diff.diffFileName + "index" + reportFileExt + "#" + id + "\"><FONT CLASS=\"NavBarFont1\"><B>Text Changes</B></FONT></A> </TD>"); - else - reportFile.println(" <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <FONT CLASS=\"NavBarFont1\">Text Changes</FONT> </TD>"); - } else if (atClass) { - String id = (String)Diff.firstDiffOutput.get(pkgName + "." + className + "!class"); - if (id != null) - reportFile.println(" <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"" + Diff.diffFileName + "index" + reportFileExt + "#" + id + "\"><FONT CLASS=\"NavBarFont1\"><B>Text Changes</B></FONT></A> </TD>"); - else - reportFile.println(" <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <FONT CLASS=\"NavBarFont1\">Text Changes</FONT> </TD>"); - } else { - reportFile.println(" <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"" + Diff.diffFileName + "index" + reportFileExt + "\"><FONT CLASS=\"NavBarFont1\"><B>Text Changes</B></FONT></A> </TD>"); - } - } - - if (doStats) { - reportFile.println(" <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"jdiff_statistics" + reportFileExt + "\"><FONT CLASS=\"NavBarFont1\"><B>Statistics</B></FONT></A> </TD>"); - } - - // Always have a link to the JDiff help file - reportFile.println(" <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"jdiff_help" + reportFileExt + "\"><FONT CLASS=\"NavBarFont1\"><B>Help</B></FONT></A> </TD>"); - reportFile.println(" </TR>"); - reportFile.println(" </TABLE>"); - reportFile.println(" </TD>"); - - // The right hand side title, only added at the top - if (upperNavigationBar) { - reportFile.println(" <TD ALIGN=\"right\" VALIGN=\"top\" ROWSPAN=3><EM><b>Generated by<br><a href=\"" + JDiff.jDiffLocation + "\" class=\"staysblack\" target=\"_top\">JDiff</a></b></EM></TD>"); - } else { - reportFile.println(" <TD ALIGN=\"right\" VALIGN=\"top\" ROWSPAN=3></TD>"); - } - reportFile.println("</TR>"); - - // Links for frames and no frames - reportFile.println("<TR>"); - - // All of the previous and next links, and the frames and non-frames - // links are in one table cell - reportFile.println(" <TD BGCOLOR=\"" + bgcolor + "\" CLASS=\"NavBarCell2\"><FONT SIZE=\"-2\">"); - // Display links to the previous and next packages or classes - if (atPackage || atClass) { - String elemName = "CLASS"; - if (className == null) { - elemName = "PACKAGE"; - } - if (prevElemLink == null) { - reportFile.println(" <B>PREV " + elemName + "</B> "); - } else { - reportFile.println(" <A HREF=\"" + prevElemLink + "\"><B>PREV " + elemName + "</B></A>"); - } - if (nextElemLink == null) { - reportFile.println(" <B>NEXT " + elemName + "</B> "); - } else { - reportFile.println(" <A HREF=\"" + nextElemLink + "\"><B>NEXT " + elemName + "</B></A>"); - } - reportFile.println(" "); - } else { - reportFile.println(" "); - } - // Links for frames and non-frames. - reportFile.println(" <A HREF=\"" + "../" + reportFileName + reportFileExt + "\" TARGET=\"_top\"><B>FRAMES</B></A> "); - if (className == null) { - if (level == 0) { - reportFile.println(" <A HREF=\"" + pkgName + reportFileExt + "\" TARGET=\"_top\"><B>NO FRAMES</B></A></FONT></TD>"); - } else { - reportFile.println(" <A HREF=\"pkg_" + pkgName + reportFileExt + "\" TARGET=\"_top\"><B>NO FRAMES</B></A></FONT></TD>"); - } - } else { - reportFile.println(" <A HREF=\"" + pkgName + "." + className + reportFileExt + "\" TARGET=\"_top\"><B>NO FRAMES</B></A></FONT></TD>"); - } - - // All of the details links are in one table cell - if (atClass) { - // Links to a class page's sections - // The meaning of these three variable is overloaded - boolean hasCtors = hasRemovals; - boolean hasMethods = hasAdditions; - boolean hasFields = hasChanges; - if (hasCtors || hasMethods || hasFields) { - reportFile.println(" <TD BGCOLOR=\"" + bgcolor + "\" CLASS=\"NavBarCell3\"><FONT SIZE=\"-2\"> DETAIL: "); - if (hasCtors) { - reportFile.println("<a href=\"#constructors\">CONSTRUCTORS</a> | "); - } else { - reportFile.println("CONSTRUCTORS | "); - } - if (hasMethods) { - reportFile.println("<a href=\"#methods\">METHODS</a> | "); - } else { - reportFile.println("METHODS | "); - } - if (hasFields) { - reportFile.println("<a href=\"#fields\">FIELDS</a>"); - } else { - reportFile.println("FIELDS"); - } - reportFile.println(" </FONT></TD>"); - } else { - // Make the end of the table line match the length of the top - reportFile.println("<TD BGCOLOR=\"0xFFFFFF\" CLASS=\"NavBarCell3\"></TD>"); - } - } else { - // Links to a package page's sections - if (hasRemovals || hasAdditions || hasChanges) { - reportFile.println(" <TD BGCOLOR=\"" + bgcolor + "\" CLASS=\"NavBarCell3\"><FONT SIZE=\"-2\"> DETAIL: "); - if (hasRemovals) { - reportFile.println("<a href=\"#Removed\">REMOVED</a> | "); - } else { - reportFile.println("REMOVED | "); - } - if (hasAdditions) { - reportFile.println("<a href=\"#Added\">ADDED</a> | "); - } else { - reportFile.println("ADDED | "); - } - if (hasChanges) { - reportFile.println("<a href=\"#Changed\">CHANGED</a>"); - } else { - reportFile.println("CHANGED"); - } - reportFile.println(" </FONT></TD>"); - } else { - // Make the end of the table line match the length of the top - reportFile.println("<TD BGCOLOR=\"0xFFFFFF\" CLASS=\"NavBarCell3\"></TD>"); - } - } - - reportFile.println("</TR>"); - reportFile.println("</TABLE>"); - reportFile.println("<HR>"); - reportFile.println("<!-- End of nav bar -->"); -*/ + reportFile.println(" </div> <!-- End headerRight -->"); + reportFile.println(" </div> <!-- End header -->"); + reportFile.println("<div id=\"body-content\" xstyle=\"padding:12px;padding-right:18px;\">"); + reportFile.println("<div id=\"doc-content\" style=\"position:relative;\">"); + reportFile.println("<div id=\"mainBodyFluid\">"); } - + /** Write the start of a table. */ public void writeTableStart(String title, int colSpan) { reportFile.println("<p>"); @@ -1169,10 +990,10 @@ public class HTMLReportGenerator { pkgRef = oldDocPrefix + pkgRef + "/package-summary"; else pkgRef = newDocPrefix + pkgRef + "/package-summary"; - reportFile.println(" <nobr><A HREF=\"" + pkgRef + ".html\" target=\"_top\"><font size=\"+1\"><tt>" + pkgName + "</tt></font></A></nobr>"); + reportFile.println(" <nobr><A HREF=\"" + pkgRef + ".html\" target=\"_top\"><code>" + pkgName + "</code></A></nobr>"); } else if (linkType == 2) { reportFile.println(" <nobr><A HREF=\"pkg_" + pkgName + reportFileExt + "\">" + pkgName + "</A></nobr>"); - } + } if (!useOld) { reportFile.println(" </TD>"); emitComment(pkgName, possibleComment, linkType); @@ -1225,12 +1046,12 @@ public class HTMLReportGenerator { else classRef = newDocPrefix + classRef; } - reportFile.print(" <nobr><A HREF=\"" + classRef + ".html\" target=\"_top\"><font size=\"+1\"><tt>"); + reportFile.print(" <nobr><A HREF=\"" + classRef + ".html\" target=\"_top\"><code>"); if (isInterface) reportFile.print("<I>" + shownClassName + "</I>"); else reportFile.print(shownClassName); - reportFile.println("</tt></font></A></nobr>"); + reportFile.println("</code></A></nobr>"); } else if (linkType == 2) { reportFile.print(" <nobr><A HREF=\"" + fqName + reportFileExt + "\">"); if (isInterface) @@ -1238,7 +1059,7 @@ public class HTMLReportGenerator { else reportFile.print(shownClassName); reportFile.println("</A></nobr>"); - } + } if (!useOld) { reportFile.println(" </TD>"); emitComment(fqName, possibleComment, linkType); @@ -1269,12 +1090,12 @@ public class HTMLReportGenerator { if (linkType == 0) { if (oldDocPrefix == null) { // No link - reportFile.print(" <nobr>" + pkgName); + reportFile.print(" <nobr>" + className); emitTypeWithParens(shortType); reportFile.println("</nobr>"); } else { - writeCtorTableEntry(pkgName, className, - type, 1, + writeCtorTableEntry(pkgName, className, + type, 1, possibleComment, true); } } else if (linkType == 1) { @@ -1299,7 +1120,7 @@ public class HTMLReportGenerator { } } reportFile.print(" <nobr><A HREF=\"" + memberRef + ".html#" + className + - "(" + type + ")\" target=\"_top\"><font size=\"+1\"><tt>" + shownClassName + "</tt></font></A>"); + "(" + type + ")\" target=\"_top\"><code>" + shownClassName + "</code></A>"); emitTypeWithParens(shortType); reportFile.println("</nobr>"); } @@ -1338,13 +1159,13 @@ public class HTMLReportGenerator { newType = ""; String shortNewType = simpleName(memberDiff.newType_); // Constructors have the linked name, then the type in parentheses. - reportFile.print(" <nobr><A HREF=\"" + memberRef + ".html#" + className + "(" + newType + ")\" target=\"_top\"><font size=\"+1\"><tt>"); + reportFile.print(" <nobr><A HREF=\"" + memberRef + ".html#" + className + "(" + newType + ")\" target=\"_top\"><code>"); reportFile.print(shownClassName); - reportFile.print("</tt></font></A>"); + reportFile.print("</code></A>"); emitTypeWithParens(shortNewType); reportFile.println(" </nobr>"); reportFile.println(" </TD>"); - + // Report changes in documentation if (reportDocChanges && memberDiff.documentationChange_ != null) { String oldMemberRef = null; @@ -1363,15 +1184,15 @@ public class HTMLReportGenerator { if (oldType.compareTo("void") == 0) oldType = ""; } - if (oldDocPrefix != null) - memberDiff.documentationChange_ += "<A HREF=\"" + - oldMemberRef + ".html#" + className + "(" + oldType + - ")\" target=\"_self\"><font size=\"+1\"><tt>old</tt></font></A> to "; + if (oldDocPrefix != null) + memberDiff.documentationChange_ += "<A HREF=\"" + + oldMemberRef + ".html#" + className + "(" + oldType + + ")\" target=\"_self\"><code>old</code></A> to "; else - memberDiff.documentationChange_ += "<font size=\"+1\"><tt>old</tt></font> to "; - memberDiff.documentationChange_ += "<A HREF=\"" + memberRef + - ".html#" + className + "(" + newType + - ")\" target=\"_self\"><font size=\"+1\"><tt>new</tt></font></A>.<br>"; + memberDiff.documentationChange_ += "<font size=\"+1\"><code>old</code></font> to "; + memberDiff.documentationChange_ += "<A HREF=\"" + memberRef + + ".html#" + className + "(" + newType + + ")\" target=\"_self\"><code>new</code></A>.<br>"; } emitChanges(memberDiff, 0); @@ -1380,8 +1201,8 @@ public class HTMLReportGenerator { reportFile.println("</TR>"); } - /** - * Write a table entry for a method. + /** + * Write a table entry for a method. * * linkType: 0 - no link by default, 1 = link to Javadoc HTML file */ @@ -1442,7 +1263,7 @@ public class HTMLReportGenerator { reportFile.print(" <nobr>"); emitType(shortReturnType); reportFile.print(" <A HREF=\"" + memberRef + ".html#" + methodName + - "(" + signature + ")\" target=\"_top\"><font size=\"+1\"><tt>" + methodName + "</tt></font></A>"); + "(" + signature + ")\" target=\"_top\"><code>" + methodName + "</code></A>"); emitTypeWithParens(shortSignature); reportFile.println("</nobr>"); } @@ -1484,23 +1305,23 @@ public class HTMLReportGenerator { memberDiff.modifiersChange_ != null && memberDiff.modifiersChange_.indexOf("but is now inherited from") != -1) { memberRef = memberDiff.inheritedFrom_; - memberRef = memberRef.replace('.', '/'); + memberRef = memberRef.replace('.', '/'); memberRef = newDocPrefix + memberRef; } - + String newReturnType = memberDiff.newType_; - String shortReturnType = simpleName(newReturnType); - String shortSignature = simpleName(newSignature); + String shortReturnType = simpleName(newReturnType); + String shortSignature = simpleName(newSignature); reportFile.print(" <nobr>"); - emitTypeWithNoParens(shortReturnType); - reportFile.print(" <A HREF=\"" + memberRef + ".html#" + - memberName + "(" + newSignature + ")\" target=\"_top\"><font size=\"+1\"><tt>"); + emitTypeWithNoParens(shortReturnType); + reportFile.print(" <A HREF=\"" + memberRef + ".html#" + + memberName + "(" + newSignature + ")\" target=\"_top\"><code>"); reportFile.print(memberName); - reportFile.print("</tt></font></A>"); + reportFile.print("</code></A>"); emitTypeWithParens(shortSignature); reportFile.println(" </nobr>"); reportFile.println(" </TD>"); - + // Report changes in documentation if (reportDocChanges && memberDiff.documentationChange_ != null) { String oldMemberRef = null; @@ -1517,15 +1338,15 @@ public class HTMLReportGenerator { } oldSignature = memberDiff.oldSignature_; } - if (oldDocPrefix != null) - memberDiff.documentationChange_ += "<A HREF=\"" + - oldMemberRef + ".html#" + memberName + "(" + - oldSignature + ")\" target=\"_self\"><font size=\"+1\"><tt>old</tt></font></A> to "; + if (oldDocPrefix != null) + memberDiff.documentationChange_ += "<A HREF=\"" + + oldMemberRef + ".html#" + memberName + "(" + + oldSignature + ")\" target=\"_self\"><code>old</code></A> to "; else - memberDiff.documentationChange_ += "<font size=\"+1\"><tt>old</tt></font> to "; - memberDiff.documentationChange_ += "<A HREF=\"" + memberRef + - ".html#" + memberName + "(" + newSignature + - ")\" target=\"_self\"><font size=\"+1\"><tt>new</tt></font></A>.<br>"; + memberDiff.documentationChange_ += "<code>old</code> to "; + memberDiff.documentationChange_ += "<A HREF=\"" + memberRef + + ".html#" + memberName + "(" + newSignature + + ")\" target=\"_self\"><code>new</code></A>.<br>"; } emitChanges(memberDiff, 1); @@ -1534,7 +1355,7 @@ public class HTMLReportGenerator { int parentIdx = memberDiff.modifiersChange_.indexOf("now inherited from"); if (parentIdx != -1) { // Change the commentID to pick up the appropriate method - commentID = memberDiff.inheritedFrom_ + "." + memberName + + commentID = memberDiff.inheritedFrom_ + "." + memberName + "_changed(" + newSignature + ")"; } } @@ -1597,19 +1418,19 @@ public class HTMLReportGenerator { reportFile.print(" <nobr>"); emitType(shortFieldType); reportFile.println(" <A HREF=\"" + memberRef + ".html#" + fieldName + - "\" target=\"_top\"><font size=\"+1\"><tt>" + fieldName + "</tt></font></A></nobr>"); + "\" target=\"_top\"><code>" + fieldName + "</code></A></nobr>"); } if (!useOld) { reportFile.println(" </TD>"); emitComment(commentID, possibleComment, linkType); reportFile.println("</TR>"); } - } + } - /** + /** * Write a table entry for a changed field. */ - public void writeFieldChangedTableEntry(String pkgName, String className, + public void writeFieldChangedTableEntry(String pkgName, String className, MemberDiff memberDiff) { String memberName = memberDiff.name_; // Generally nowhere to break a member name anyway @@ -1637,20 +1458,20 @@ public class HTMLReportGenerator { memberDiff.modifiersChange_ != null && memberDiff.modifiersChange_.indexOf("but is now inherited from") != -1) { memberRef = memberDiff.inheritedFrom_; - memberRef = memberRef.replace('.', '/'); + memberRef = memberRef.replace('.', '/'); memberRef = newDocPrefix + memberRef; } String newType = memberDiff.newType_; - String shortNewType = simpleName(newType); + String shortNewType = simpleName(newType); reportFile.print(" <nobr>"); emitTypeWithNoParens(shortNewType); - reportFile.print(" <A HREF=\"" + memberRef + ".html#" + - memberName + "\" target=\"_top\"><font size=\"+1\"><tt>"); + reportFile.print(" <A HREF=\"" + memberRef + ".html#" + + memberName + "\" target=\"_top\"><code>"); reportFile.print(memberName); - reportFile.print("</tt></font></A></nobr>"); + reportFile.print("</code></font></A></nobr>"); reportFile.println(" </TD>"); - + // Report changes in documentation if (reportDocChanges && memberDiff.documentationChange_ != null) { String oldMemberRef = null; @@ -1665,13 +1486,13 @@ public class HTMLReportGenerator { oldMemberRef = oldDocPrefix + oldMemberRef; } } - if (oldDocPrefix != null) - memberDiff.documentationChange_ += "<A HREF=\"" + - oldMemberRef + ".html#" + memberName + "\" target=\"_self\"><font size=\"+1\"><tt>old</tt></font></A> to "; + if (oldDocPrefix != null) + memberDiff.documentationChange_ += "<A HREF=\"" + + oldMemberRef + ".html#" + memberName + "\" target=\"_self\"><code>old</code></A> to "; else - memberDiff.documentationChange_ += "<font size=\"+1\"><tt>old</tt></font> to "; - memberDiff.documentationChange_ += "<A HREF=\"" + memberRef + - ".html#" + memberName + "\" target=\"_self\"><font size=\"+1\"><tt>new</tt></font></A>.<br>"; + memberDiff.documentationChange_ += "<code>old</code> to "; + memberDiff.documentationChange_ += "<A HREF=\"" + memberRef + + ".html#" + memberName + "\" target=\"_self\"><code>new</code></A>.<br>"; } emitChanges(memberDiff, 2); @@ -1902,14 +1723,14 @@ public class HTMLReportGenerator { if (sepType == null) sepType = p; else - sepType += ",</nobr> " + p + "<nobr>"; + sepType += ",</nobr> " + p + "<nobr>"; } reportFile.print("(<code>" + sepType + "<nobr></code>)"); } } } - /** + /** * Emit a string which is a type by surrounding it with <code> tags. * Do not surround it with parentheses. Used to display methods' return * types and field types. @@ -2106,20 +1927,20 @@ public class HTMLReportGenerator { */ public static boolean noCommentsOnChanges = false; - /** - * If set, then report changes in documentation (Javadoc comments) + /** + * If set, then report changes in documentation (Javadoc comments) * between the old and the new API. The default is that this is not set. */ public static boolean reportDocChanges = false; - /** + /** * Define the prefix for HTML links to the existing set of Javadoc- * generated documentation for the new API. E.g. For J2SE1.3.x, use - * "http://java.sun.com/j2se/1.3/docs/api/" + * "https://java.sun.com/j2se/1.3/docs/api/" */ public static String newDocPrefix = "../"; - /** + /** * Define the prefix for HTML links to the existing set of Javadoc- * generated documentation for the old API. */ diff --git a/src/jdiff/HTMLStatistics.java b/src/jdiff/HTMLStatistics.java index 6dada5c..31fa213 100755 --- a/src/jdiff/HTMLStatistics.java +++ b/src/jdiff/HTMLStatistics.java @@ -46,8 +46,8 @@ public class HTMLStatistics { // writeText("<div class=\"g-section g-tpl-180\">"); // Add the nav bar for the summary page - - + + // Write a customized navigation bar for the statistics page h_.writeText("<!-- Start of nav bar -->"); @@ -55,113 +55,121 @@ public class HTMLStatistics { = new SimpleDateFormat ("yyyy.MM.dd HH:mm"); Date day = new Date(); - h_.writeText("<div id=\"gc-container\" style=\"padding-left:1em;padding-right:1em;\">"); h_.writeText("<a name=\"top\"></a>"); - h_.writeText("<div id=\"gc-header\">"); - h_.writeText(" <div id=\"logo\" style=\"padding-left:1em;\">"); - h_.writeText(" <a href=\"../../../documentation.html\" target=\"_top\"><img style=\"border: 0;\" src=\"../../../assets-google/android-logo-sm.gif\" \"/></a>"); - h_.writeText(" </div> <!-- End logo -->"); - - h_.writeText("<div class=\"and-diff-id\">"); - h_.writeText("<table class=\"diffspectable\">"); - h_.writeText("<tr>"); - h_.writeText(" <td colspan=\"2\" class=\"diffspechead\">API Diff Specification</td>"); - h_.writeText("</tr>"); + h_.writeText("<div id=\"header\" style=\"margin-bottom:0;xborder-bottom:none;\">"); + h_.writeText("<div id=\"headerLeft\">"); + h_.writeText("<a href=\"../../../../index.html\" tabindex=\"-1\" target=\"_top\"><img src=\"../../../../assets/images/bg_logo.png\" alt=\"Android Developers\" /></a>"); + h_.writeText("</div>"); + h_.writeText(" <div id=\"headerRight\">"); + h_.writeText(" <div id=\"headerLinks\">"); + h_.writeText("<!-- <img src=\"/assets/images/icon_world.jpg\" alt=\"\" /> -->"); + h_.writeText("<span class=\"text\">"); + h_.writeText("<!-- <a href=\"#\">English</a> | -->"); + h_.writeText("<nobr><a href=\"https://developer.android.com\" target=\"_top\">Android Developers</a> | <a href=\"https://www.android.com\" target=\"_top\">Android.com</a></nobr>"); + h_.writeText("</span>"); + h_.writeText("</div>"); + h_.writeText(" <div class=\"and-diff-id\" style=\"margin-top:6px;margin-right:8px;\">"); + h_.writeText(" <table class=\"diffspectable\">"); + h_.writeText(" <tr>"); + h_.writeText(" <td colspan=\"2\" class=\"diffspechead\">API Diff Specification</td>"); + h_.writeText(" </tr>"); h_.writeText(" <tr>"); - h_.writeText(" <td class=\"diffspec\">To Version:</td>"); - h_.writeText(" <td class=\"diffvaluenew\">" + newAPIName + "</td>"); + h_.writeText(" <td class=\"diffspec\" style=\"padding-top:.25em\">To Level:</td>"); + h_.writeText(" <td class=\"diffvaluenew\" style=\"padding-top:.25em\">" + newAPIName + "</td>"); h_.writeText(" </tr>"); h_.writeText(" <tr>"); - h_.writeText(" <td class=\"diffspec\">From Version:</td>"); + h_.writeText(" <td class=\"diffspec\">From Level:</td>"); h_.writeText(" <td class=\"diffvalueold\">" + oldAPIName + "</td>"); h_.writeText(" </tr>"); - h_.writeText("<tr>"); - h_.writeText(" <td class=\"diffspec\">Generated</td>"); - h_.writeText(" <td class=\"diffvalue\">" + formatter.format( day ) + "</td>"); - h_.writeText("</tr>"); - h_.writeText("</table>"); - h_.writeText(" </div> <!-- End and-diff-id -->"); - - h_.writeText(" <div class=\"and-diff-id\">"); - h_.writeText(" <table class=\"diffspectable\">"); h_.writeText(" <tr>"); - h_.writeText(" <td class=\"diffspec\" colspan=\"2\"><a href=\"../changes.html\" target=\"_top\">Top of Report</a></div>"); + h_.writeText(" <td class=\"diffspec\">Generated</td>"); + h_.writeText(" <td class=\"diffvalue\">" + formatter.format( day ) + "</td>"); h_.writeText(" </tr>"); h_.writeText(" </table>"); - h_.writeText(" </div> <!-- End and-diff-id -->"); + h_.writeText(" </div><!-- End and-diff-id -->"); - h_.writeText("</div> <!-- End gc-header -->"); - h_.writeText("<div id=\"codesiteContent\" style=\"margin-top: 70px;margin-bottom:80px;\">"); + h_.writeText(" <div class=\"and-diff-id\" style=\"margin-right:8px;\">"); + h_.writeText(" <table class=\"diffspectable\">"); + h_.writeText(" <tr>"); + h_.writeText(" <td class=\"diffspec\" colspan=\"2\"><a href=\"../changes.html\" target=\"_top\">Top of Report</a>"); + h_.writeText(" </tr>"); + h_.writeText(" </table>"); + h_.writeText(" </div> <!-- End and-diff-id -->"); - // Write the title in the body with some formatting - h_.writeText("<div style=\"xborder:1px solid yellow;vertical-align:top;padding:1em;margin-left:0;text-align:left;\">"); - h_.writeText(" <H1 class=\"pagecontenth1\">API Change Statistics</H1>"); - h_.writeText("</div>"); + h_.writeText(" </div> <!-- End headerRight -->"); + h_.writeText(" </div> <!-- End header -->"); + h_.writeText("<div id=\"body-content\">"); + h_.writeText("<div id=\"doc-content\" style=\"position:relative;\">"); + h_.writeText("<div id=\"mainBodyFluid\">"); + h_.writeText("<h1>API Change Statistics</h1>"); - h_.writeText("<p>"); - h_.writeText("The percent change statistic reported for all elements in each API is defined recursively as follows:</p>"); - h_.writeText("<pre>"); - h_.writeText("Percentage difference = 100 * (added + removed + 2*changed)"); - h_.writeText(" -----------------------------------"); - h_.writeText(" sum of public elements in BOTH APIs"); - h_.writeText("</pre>"); - h_.writeText("<p>where <code>added</code> is the number of packages added, <code>removed</code> is the number of packages removed, and <code>changed</code> is the number of packages changed."); - h_.writeText("This definition is applied recursively for the classes and their program elements, so the value for a changed package will be less than 1, unless every class in that package has changed."); - h_.writeText("The definition ensures that if all packages are removed and all new packages are"); - h_.writeText("added, the change will be 100%. Values are rounded here, so a value of 0% indicates a percentage difference of less than 0.5%.</p>"); - h_.writeText("<p>The overall difference between the two APIs is approximately <span style=\"color:222;font-weight:bold;\">" + (int)(apiDiff.pdiff) + "%</span>."); + DecimalFormat df2 = new DecimalFormat( "#,###,###,##0.00" ); + double dd = apiDiff.pdiff; + double dd2dec = new Double(df2.format(dd)).doubleValue(); + + h_.writeText("<p>The overall difference between API Levels " + oldAPIName + " and " + newAPIName + " is approximately <span style=\"color:222;font-weight:bold;\">" + dd2dec + "%</span>."); + h_.writeText("</p>"); + + h_.writeText("<br>"); + h_.writeText("<a name=\"numbers\"></a>"); + h_.writeText("<h2>Total of Differences, by Number and Type</h2>"); + h_.writeText("<p>"); + h_.writeText("The table below lists the numbers of program elements (packages, classes, constructors, methods, and fields) that were added, changed, or removed. The table includes only the highest-level program elements — that is, if a class with two methods was added, the number of methods added does not include those two methods, but the number of classes added does include that class."); h_.writeText("</p>"); - h_.writeText("<br><h2 class=\"pagecontenth2\">Contents</h2>"); - h_.writeText("<dl><dt><a href=\"#packages\">Changed Packages</a></dt> <dd>Sorted by percentage difference</dd>"); - h_.writeText("<dt><a href=\"#classes\">Changed Classes and <i>Interfaces</i></a></dt><dd>Sorted by percentage difference</dd>"); - h_.writeText("<dt><a href=\"#numbers\">Total of Differences</a></dt><dd>Listed by number and type</dd></dl>"); + emitNumbersByElement(apiDiff); h_.writeText("<br>"); h_.writeText("<a name=\"packages\"></a>"); - h_.writeText("<h2 class=\"pagecontenth2\">Changed Packages, Sorted by Percentage Difference</h2>"); + h_.writeText("<h2>Changed Packages, Sorted by Percentage Difference</h2>"); emitPackagesByDiff(apiDiff); + h_.writeText("<p style=\"font-size:10px\">* See <a href=\"#calculation\">Calculation of Change Percentages</a>, below.</p>"); h_.writeText("<br>"); h_.writeText("<a name=\"classes\"></a>"); - h_.writeText("<h2 class=\"pagecontenth2\">Changed Classes and <i>Interfaces</i>, Sorted by Percentage Difference</h2>"); + h_.writeText("<h2>Changed Classes and <i>Interfaces</i>, Sorted by Percentage Difference</h2>"); emitClassesByDiff(apiDiff); + h_.writeText("<p style=\"font-size:10px\">* See <a href=\"#calculation\">Calculation of Change Percentages</a>, below.</p>"); h_.writeText("<br>"); - h_.writeText("<a name=\"numbers\"></a>"); - h_.writeText("<h2 class=\"pagecontenth2\">Total of Differences, by Number and Type</h2>"); + h_.writeText("<h2 id=\"calculation\">Calculation of Change Percentages</h2>"); h_.writeText("<p>"); - h_.writeText("The table below lists the numbers of program elements (packages, classes, constructors, methods, and fields) that were removed, added or changed. The table includes only the highest-level program elements — that is, if a class with two methods was added, the number of methods added does not include those two methods, but the number of classes added does include that class."); - h_.writeText("</p>"); - - emitNumbersByElement(apiDiff); - - h_.writeText("</div><!-- end codesitecontent -->"); - h_.writeText("<div style=\"padding-left: 10px; padding-right: 10px; margin-top: 0; padding-bottom: 15px;\">"); - h_.writeText(" <table style=\"width: 100%; border: none;\"><tr>"); - h_.writeText(" <td style=\"text-align:center;font-size: 10pt; border: none; color: ccc;\"> "); - h_.writeText(" <span>©2008 Google - "); - h_.writeText(" <a href=\"http://code.google.com\">Code Home</a> - "); - h_.writeText(" <a href=\"http://www.google.com/accounts/TOS\">Site Terms of Sservice</a> - "); - h_.writeText(" <a href=\"http://www.google.com/privacy.html\">Privacy Policy</a> "); - h_.writeText(" </span>"); - h_.writeText(" <div style=\"xborder 1px solid red;position:relative;margin-top:-2em;" ); - h_.writeText(" font-size:8pt;color:aaa;text-align:right;\">"); - h_.writeText(" <em>Generated by <a href=\"http://www.jdiff.org/\">JDiff</a></em><br><img "); - h_.writeText(" align=\"right\" src=\"../../../assets/jdiff_logo.gif\">"); - h_.writeText(" </span>"); - h_.writeText(" </td>"); - h_.writeText(" </tr></table>"); - h_.writeText("</div>"); - h_.writeText("</div><!-- end gc-containter -->"); - - h_.writeText("<script src=\"http://www.google-analytics.com/ga.js\" type=\"text/javascript\">"); + h_.writeText("The percent change statistic reported for all elements in the "to" API Level specification is defined recursively as follows:</p>"); + h_.writeText("<pre>"); + h_.writeText("Percentage difference = 100 * (added + removed + 2*changed)"); + h_.writeText(" -----------------------------------"); + h_.writeText(" sum of public elements in BOTH APIs"); + h_.writeText("</pre>"); + h_.writeText("<p>where <code>added</code> is the number of packages added, <code>removed</code> is the number of packages removed, and <code>changed</code> is the number of packages changed."); + h_.writeText("This definition is applied recursively for the classes and their program elements, so the value for a changed package will be less than 1, unless every class in that package has changed."); + h_.writeText("The definition ensures that if all packages are removed and all new packages are"); + h_.writeText("added, the change will be 100%.</p>"); + + h_.writeText(" </div> "); + h_.writeText(" <div id=\"footer\">"); + h_.writeText(" <div id=\"copyright\">"); + h_.writeText(" Except as noted, this content is licensed under "); + h_.writeText(" <a href=\"https://creativecommons.org/licenses/by/2.5/\"> Creative Commons Attribution 2.5</a>."); + h_.writeText(" For details and restrictions, see the <a href=\"https://developer.android.com/license.html\">Content License</a>."); + h_.writeText(" </div>"); + h_.writeText(" <div id=\"footerlinks\">"); + h_.writeText(" <p>"); + h_.writeText(" <a href=\"https://www.android.com/terms.html\">Site Terms of Service</a> -"); + h_.writeText(" <a href=\"https://www.android.com/privacy.html\">Privacy Policy</a> -"); + h_.writeText(" <a href=\"https://www.android.com/branding.html\">Brand Guidelines</a>"); + h_.writeText(" </p>"); + h_.writeText(" </div>"); + h_.writeText(" </div> <!-- end footer -->"); + h_.writeText(" </div><!-- end doc-content -->"); + h_.writeText(" </div> <!-- end body-content --> "); + + h_.writeText("<script src=\"https://www.google-analytics.com/ga.js\" type=\"text/javascript\">"); h_.writeText("</script>"); h_.writeText("<script type=\"text/javascript\">"); h_.writeText(" try {"); - h_.writeText(" var pageTracker = _gat._getTracker(\"UA-18071-1\");"); + h_.writeText(" var pageTracker = _gat._getTracker(\"UA-5831155-1\");"); h_.writeText(" pageTracker._setAllowAnchor(true);"); h_.writeText(" pageTracker._initData();"); h_.writeText(" pageTracker._trackPageview();"); @@ -182,13 +190,13 @@ public class HTMLStatistics { * of the values. */ public void emitPackagesByDiff(APIDiff apiDiff) { - + Collections.sort(apiDiff.packagesChanged, new ComparePkgPdiffs()); // Write out the table start - h_.writeText("<TABLE summary=\"Packages sorted by percentage difference\" BORDER=\"1\" WIDTH=\"100%\" cellspacing=\"0\" cellpadding=\"0\">"); - h_.writeText("<TR WIDTH=\"20%\">"); - h_.writeText(" <TH>Percentage<br>Difference</TH>"); + h_.writeText("<TABLE summary=\"Packages sorted by percentage difference\" WIDTH=\"100%\">"); + h_.writeText("<TR>"); + h_.writeText(" <TH WIDTH=\"10%\">Percentage Difference*</TH>"); h_.writeText(" <TH>Package</TH>"); h_.writeText("</TR>"); @@ -273,9 +281,9 @@ public class HTMLStatistics { Collections.sort(allChangedClasses, new CompareClassPdiffs()); // Write out the table start - h_.writeText("<TABLE summary=\"Classes sorted by percentage difference\" BORDER=\"1\" WIDTH=\"100%\" cellspacing=\"0\" cellpadding=\"0\">"); + h_.writeText("<TABLE summary=\"Classes sorted by percentage difference\" WIDTH=\"100%\">"); h_.writeText("<TR WIDTH=\"20%\">"); - h_.writeText(" <TH><b>Percentage<br>Difference</b></TH>"); + h_.writeText(" <TH WIDTH=\"10%\">Percentage<br>Difference*</TH>"); h_.writeText(" <TH><b>Class or <i>Interface</i></b></TH>"); h_.writeText("</TR>"); @@ -389,32 +397,29 @@ public class HTMLStatistics { numMethodsRemoved += classDiff.methodsRemoved.size(); numMethodsAdded += classDiff.methodsAdded.size(); numMethodsChanged += classDiff.methodsChanged.size(); - + numFieldsRemoved += classDiff.fieldsRemoved.size(); numFieldsAdded += classDiff.fieldsAdded.size(); numFieldsChanged += classDiff.fieldsChanged.size(); } } - + // Write out the table - h_.writeText("<TABLE summary=\"Number of differences\" BORDER=\"1\" WIDTH=\"100%\" cellspacing=\"0\" cellpadding=\"0\">"); + h_.writeText("<TABLE summary=\"Number of differences\" WIDTH=\"100%\">"); h_.writeText("<TR>"); - h_.writeText(" <TH COLSPAN=5 NOWRAP>"); - h_.writeText(" Number of Differences</TH>"); - h_.writeText("</TR>"); - h_.writeText("<TR>"); - h_.writeText(" <TH> </TD>"); - h_.writeText(" <TH ALIGN=\"center\"><b>Removals</b></TH>"); + h_.writeText(" <th>Type</th>"); h_.writeText(" <TH ALIGN=\"center\"><b>Additions</b></TH>"); h_.writeText(" <TH ALIGN=\"center\"><b>Changes</b></TH>"); + h_.writeText(" <TH ALIGN=\"center\">Removals</TH>"); h_.writeText(" <TH ALIGN=\"center\"><b>Total</b></TH>"); h_.writeText("</TR>"); h_.writeText("<TR>"); h_.writeText(" <TD>Packages</TD>"); - h_.writeText(" <TD ALIGN=\"right\">" + numPackagesRemoved + "</TD>"); + h_.writeText(" <TD ALIGN=\"right\">" + numPackagesAdded + "</TD>"); h_.writeText(" <TD ALIGN=\"right\">" + numPackagesChanged + "</TD>"); + h_.writeText(" <TD ALIGN=\"right\">" + numPackagesRemoved + "</TD>"); int numPackages = numPackagesRemoved + numPackagesAdded + numPackagesChanged; h_.writeText(" <TD ALIGN=\"right\">" + numPackages + "</TD>"); h_.writeText("</TR>"); @@ -425,9 +430,10 @@ public class HTMLStatistics { h_.writeText("<TR>"); h_.writeText(" <TD>Classes and <i>Interfaces</i></TD>"); - h_.writeText(" <TD ALIGN=\"right\">" + numClassesRemoved + "</TD>"); + h_.writeText(" <TD ALIGN=\"right\">" + numClassesAdded + "</TD>"); h_.writeText(" <TD ALIGN=\"right\">" + numClassesChanged + "</TD>"); + h_.writeText(" <TD ALIGN=\"right\">" + numClassesRemoved + "</TD>"); int numClasses = numClassesRemoved + numClassesAdded + numClassesChanged; h_.writeText(" <TD ALIGN=\"right\">" + numClasses + "</TD>"); h_.writeText("</TR>"); @@ -438,9 +444,9 @@ public class HTMLStatistics { h_.writeText("<TR>"); h_.writeText(" <TD>Constructors</TD>"); - h_.writeText(" <TD ALIGN=\"right\">" + numCtorsRemoved + "</TD>"); h_.writeText(" <TD ALIGN=\"right\">" + numCtorsAdded + "</TD>"); h_.writeText(" <TD ALIGN=\"right\">" + numCtorsChanged + "</TD>"); + h_.writeText(" <TD ALIGN=\"right\">" + numCtorsRemoved + "</TD>"); int numCtors = numCtorsRemoved + numCtorsAdded + numCtorsChanged; h_.writeText(" <TD ALIGN=\"right\">" + numCtors + "</TD>"); h_.writeText("</TR>"); @@ -451,9 +457,9 @@ public class HTMLStatistics { h_.writeText("<TR>"); h_.writeText(" <TD>Methods</TD>"); - h_.writeText(" <TD ALIGN=\"right\">" + numMethodsRemoved + "</TD>"); h_.writeText(" <TD ALIGN=\"right\">" + numMethodsAdded + "</TD>"); h_.writeText(" <TD ALIGN=\"right\">" + numMethodsChanged + "</TD>"); + h_.writeText(" <TD ALIGN=\"right\">" + numMethodsRemoved + "</TD>"); int numMethods = numMethodsRemoved + numMethodsAdded + numMethodsChanged; h_.writeText(" <TD ALIGN=\"right\">" + numMethods + "</TD>"); h_.writeText("</TR>"); @@ -464,9 +470,9 @@ public class HTMLStatistics { h_.writeText("<TR>"); h_.writeText(" <TD>Fields</TD>"); - h_.writeText(" <TD ALIGN=\"right\">" + numFieldsRemoved + "</TD>"); h_.writeText(" <TD ALIGN=\"right\">" + numFieldsAdded + "</TD>"); h_.writeText(" <TD ALIGN=\"right\">" + numFieldsChanged + "</TD>"); + h_.writeText(" <TD ALIGN=\"right\">" + numFieldsRemoved + "</TD>"); int numFields = numFieldsRemoved + numFieldsAdded + numFieldsChanged; h_.writeText(" <TD ALIGN=\"right\">" + numFields + "</TD>"); h_.writeText("</TR>"); @@ -476,12 +482,13 @@ public class HTMLStatistics { numChanged += numFieldsChanged; h_.writeText("<TR>"); - h_.writeText(" <TD><b>Total</b></TD>"); - h_.writeText(" <TD ALIGN=\"right\">" + numRemoved + "</TD>"); - h_.writeText(" <TD ALIGN=\"right\">" + numAdded + "</TD>"); - h_.writeText(" <TD ALIGN=\"right\">" + numChanged + "</TD>"); + h_.writeText(" <TD style=\"background-color:#FAFAFA\"><b>Total</b></TD>"); + + h_.writeText(" <TD style=\"background-color:#FAFAFA\" ALIGN=\"right\"><strong>" + numAdded + "</strong></TD>"); + h_.writeText(" <TD style=\"background-color:#FAFAFA\" ALIGN=\"right\"><strong>" + numChanged + "</strong></TD>"); + h_.writeText(" <TD style=\"background-color:#FAFAFA\" ALIGN=\"right\"><strong>" + numRemoved + "</strong></TD>"); int total = numRemoved + numAdded + numChanged; - h_.writeText(" <TD ALIGN=\"right\">" + total + "</TD>"); + h_.writeText(" <TD style=\"background-color:#FAFAFA\" ALIGN=\"right\"><strong>" + total + "</strong></TD>"); h_.writeText("</TR>"); h_.writeText("</TABLE>"); diff --git a/src/jdiff/JDiff.java b/src/jdiff/JDiff.java index 14a7a97..c5cc25a 100755 --- a/src/jdiff/JDiff.java +++ b/src/jdiff/JDiff.java @@ -270,13 +270,13 @@ public class JDiff extends Doclet { /** If set, then read in two XML files and compare their APIs. */ static boolean compareAPIs = false; - /** - * The file separator for the local filesystem, forward or backward slash. + /** + * The file separator for the local filesystem, forward or backward slash. */ static String DIR_SEP = System.getProperty("file.separator"); /** Details for where to find JDiff. */ - static final String jDiffLocation = "http://www.jdiff.org"; + static final String jDiffLocation = "https://www.jdiff.org"; /** Contact email address for the primary JDiff maintainer. */ static final String authorEmail = "mdoar@pobox.com"; diff --git a/src/jdiff/MergeChanges.java b/src/jdiff/MergeChanges.java index 7ef0a84..1474949 100755 --- a/src/jdiff/MergeChanges.java +++ b/src/jdiff/MergeChanges.java @@ -190,11 +190,11 @@ class MergeChanges { int endRemoved = classDiff.methodsRemoved.lastIndexOf(removedMethod); int startAdded = classDiff.methodsAdded.indexOf(removedMethod); int endAdded = classDiff.methodsAdded.lastIndexOf(removedMethod); - if (startRemoved != -1 && endRemoved != -1 && + if (startRemoved != -1 && endRemoved != -1 && startAdded != -1 && endAdded != -1) { // Find the index of the current removed method int removedIdx = -1; - for (int i = startRemoved; i <= endRemoved; i++) { + for (int i = startRemoved; i <= endRemoved; i++) { if (removedMethod.equalSignatures(classDiff.methodsRemoved.get(i))) { removedIdx = i; break; @@ -204,7 +204,7 @@ class MergeChanges { System.out.println("Error: removed method index not found"); System.exit(5); } - // Find the index of the added method with the same signature, if + // Find the index of the added method with the same signature, if // it exists, and make sure it is defined locally. int addedIdx = -1; for (int i = startAdded; i <= endAdded; i++) { @@ -274,7 +274,7 @@ class MergeChanges { } // Native or not if (Diff.showAllChanges && - oldMethod.isNative_ != newMethod.isNative_) { + oldMethod.isNative_ != newMethod.isNative_) { String changeText = ""; if (oldMethod.isNative_) changeText += "Changed from native to non-native."; @@ -284,7 +284,7 @@ class MergeChanges { } // Synchronized or not if (Diff.showAllChanges && - oldMethod.isSynchronized_ != newMethod.isSynchronized_) { + oldMethod.isSynchronized_ != newMethod.isSynchronized_) { String changeText = ""; if (oldMethod.isSynchronized_) changeText += "Changed from synchronized to non-synchronized."; @@ -340,4 +340,4 @@ class MergeChanges { /** Set to enable increased logging verbosity for debugging. */ private static boolean trace = false; -} +}
\ No newline at end of file diff --git a/src/jdiff/RootDocToXML.java b/src/jdiff/RootDocToXML.java index 5717287..cb2f0e2 100755 --- a/src/jdiff/RootDocToXML.java +++ b/src/jdiff/RootDocToXML.java @@ -82,7 +82,7 @@ public class RootDocToXML { } } else { xsdFileName = outputDirectory; - if (!xsdFileName.endsWith(JDiff.DIR_SEP)) + if (!xsdFileName.endsWith(JDiff.DIR_SEP)) xsdFileName += JDiff.DIR_SEP; } xsdFileName += "api.xsd"; @@ -91,7 +91,7 @@ public class RootDocToXML { PrintWriter xsdFile = new PrintWriter(fos); // The contents of the api.xsd file xsdFile.println("<?xml version=\"1.0\" encoding=\"iso-8859-1\" standalone=\"no\"?>"); - xsdFile.println("<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">"); + xsdFile.println("<xsd:schema xmlns:xsd=\"https://www.w3.org/2001/XMLSchema\">"); xsdFile.println(""); xsdFile.println("<xsd:annotation>"); xsdFile.println(" <xsd:documentation>"); @@ -770,16 +770,16 @@ public class RootDocToXML { int val = Character.getNumericValue(c); // if (s.indexOf("which is also a test for non-printable") != -1) // System.out.println("** Char " + i + "[" + c + "], val =" + val); //DEBUG - // Ranges from http://www.unicode.org/unicode/reports/tr20/ + // Ranges from https://www.unicode.org/unicode/reports/tr20/ // Should really replace 0x2028 and 0x2029 with <br/> if (val == 0x0 || - inRange(val, 0x2028, 0x2029) || - inRange(val, 0x202A, 0x202E) || - inRange(val, 0x206A, 0x206F) || - inRange(val, 0xFFF9, 0xFFFC) || + inRange(val, 0x2028, 0x2029) || + inRange(val, 0x202A, 0x202E) || + inRange(val, 0x206A, 0x206F) || + inRange(val, 0xFFF9, 0xFFFC) || inRange(val, 0xE0000, 0xE007F)) { if (trace) { - System.out.println("Warning: changed non-printing character " + sa[i] + " in " + doc.name()); + System.out.println("Warning: changed non-printing character " + sa[i] + " in " + doc.name()); } sa[i] = '#'; } @@ -1110,31 +1110,31 @@ public class RootDocToXML { */ public static boolean doExclude = false; - /** + /** * Exclude program elements marked with this String, e.g. "@exclude". */ public static String excludeTag = null; - /** - * The base URI for locating necessary DTDs and Schemas. By default, this - * is "http://www.w3.org". A typical value to use local copies of DTD files + /** + * The base URI for locating necessary DTDs and Schemas. By default, this + * is "https://www.w3.org". A typical value to use local copies of DTD files * might be "file:///C:/jdiff/lib" */ - public static String baseURI = "http://www.w3.org"; + public static String baseURI = "https://www.w3.org"; - /** + /** * If set, then strip out non-printing characters from documentation. * Default is that this is set. */ static boolean stripNonPrintables = true; - /** + /** * If set, then add the information about the source file and line number * which is available in J2SE1.4. Default is that this is not set. */ static boolean addSrcInfo = false; - /** + /** * If set, scan classes with no packages. * If the source is a jar file this may duplicates classes, so * disable it using the -packagesonly option. Default is that this is diff --git a/src/jdiff/XMLToAPI.java b/src/jdiff/XMLToAPI.java index a7fe33a..1246553 100755 --- a/src/jdiff/XMLToAPI.java +++ b/src/jdiff/XMLToAPI.java @@ -60,9 +60,9 @@ public class XMLToAPI { } if (validateXML) { - parser.setFeature("http://xml.org/sax/features/namespaces", true); - parser.setFeature("http://xml.org/sax/features/validation", true); - parser.setFeature("http://apache.org/xml/features/validation/schema", true); + parser.setFeature("https://xml.org/sax/features/namespaces", true); + parser.setFeature("https://xml.org/sax/features/validation", true); + parser.setFeature("https://apache.org/xml/features/validation/schema", true); } parser.setContentHandler(handler); |