changeset 1552:642f469e5217 jdk7u25-b31

Merge
author asaha
date Thu, 06 Jun 2013 22:28:03 -0700
parents 0a86c8b57a92 582f4660bb6b
children a825dd3a95fd
files .hgtags
diffstat 3 files changed, 92 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Tue May 28 10:36:40 2013 -0700
+++ b/.hgtags	Thu Jun 06 22:28:03 2013 -0700
@@ -251,6 +251,7 @@
 2782a1c60faf7585dee0af0ef585aeed3288e521 jdk7u17-b02
 0abc443a68676c7231b274a324d27204c735acac jdk7u17-b30
 1a9b32d36ff86136549f20156cf3e821295228a0 jdk7u17-b31
+a91bdaf125d89b8b2c6ff86c8055aab3b7d2546c jdk7u17-b32
 8a12629ea21378f96666628f472cd9a6936a4933 jdk7u21-b01
 82103a284427a2512fe884d8f232f1a83d46beb6 jdk7u21-b02
 9adfe6a84c3884d5c24f6655e89546a6e0a80129 jdk7u21-b03
@@ -263,4 +264,21 @@
 de06078efe709392d7faf44803d54b74599f6bda jdk7u21-b10
 e120818fc321b5d9d8573a58bf5f6a6eb7471229 jdk7u21-b11
 ff6f8ab2635c6e0b0f6bb1a68dca48b4fc31b107 jdk7u21-b30
+a87ad97e80ae1861143b477d8a8990dc6ecc9173 jdk7u21-b12
+55c56025da9d9833aa8fff50cb897f7aa99f4a13 jdk7u21-b31
+884621bb9042cd4a06e230307f1e26f1c518346d jdk7u25-b01
+1311e3618232058b09fe7ea25eda4af8d3fe6807 jdk7u25-b02
+8dc40e209a12638ea18bb7ee436051768afa5d39 jdk7u25-b03
+d7f974b867c4cf771ab749871c2ff4d3f869f13f jdk7u25-b04
+e8d01d8ee8f547f97d8670157ddf5a798459b85a jdk7u25-b05
+25489e38393b7c70fb826069d50860fbc409d11d jdk7u25-b06
+11fd425a3ebee6fa02bd684d356300b3619e5e7a jdk7u25-b07
+edaa697ef947de30b940bef0a546590d09c99cd3 jdk7u25-b08
+17ee569d0c0130824ba27bc1b090114e6075c5f2 jdk7u25-b09
+41c1b02cd6a8fa7746752cc911da3dd4d380098d jdk7u25-b10
+0da9ef0d9fc5b017f960d65ae0cd07860a259621 jdk7u25-b11
+28358b2489b2ca29c1a6b79f643204da8924a3d7 jdk7u25-b12
+5ed8c453480063838b632c74f528924f529361a2 jdk7u25-b13
+c6342ec6a12f7283e2a73a80a44dcdd3683e2e8b jdk7u25-b14
+3b8323e24a636ac0638604d19fc116eb0eef6cdb jdk7u25-b15
 a87ad97e80ae1861143b477d8a8990dc6ecc9173 jdk7u21-b50
--- a/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java	Tue May 28 10:36:40 2013 -0700
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java	Thu Jun 06 22:28:03 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -312,8 +312,42 @@
         String scriptCode = DocletConstants.NL + "    targetPage = \"\" + window.location.search;" + DocletConstants.NL +
                 "    if (targetPage != \"\" && targetPage != \"undefined\")" + DocletConstants.NL +
                 "        targetPage = targetPage.substring(1);" + DocletConstants.NL +
-                "    if (targetPage.indexOf(\":\") != -1)" + DocletConstants.NL +
+                "    if (targetPage.indexOf(\":\") != -1 || (targetPage != \"\" && !validURL(targetPage)))" + DocletConstants.NL +
                 "        targetPage = \"undefined\";" + DocletConstants.NL +
+                "    function validURL(url) {" + DocletConstants.NL +
+                "        var pos = url.indexOf(\".html\");" + DocletConstants.NL +
+                "        if (pos == -1 || pos != url.length - 5)" + DocletConstants.NL +
+                "            return false;" + DocletConstants.NL +
+                "        var allowNumber = false;" + DocletConstants.NL +
+                "        var allowSep = false;" + DocletConstants.NL +
+                "        var seenDot = false;" + DocletConstants.NL +
+                "        for (var i = 0; i < url.length - 5; i++) {" + DocletConstants.NL +
+                "            var ch = url.charAt(i);" + DocletConstants.NL +
+                "            if ('a' <= ch && ch <= 'z' ||" + DocletConstants.NL +
+                "                    'A' <= ch && ch <= 'Z' ||" + DocletConstants.NL +
+                "                    ch == '$' ||" + DocletConstants.NL +
+                "                    ch == '_') {" + DocletConstants.NL +
+                "                allowNumber = true;" + DocletConstants.NL +
+                "                allowSep = true;" + DocletConstants.NL +
+                "            } else if ('0' <= ch && ch <= '9'" + DocletConstants.NL +
+                "                    || ch == '-') {" + DocletConstants.NL +
+                "                if (!allowNumber)" + DocletConstants.NL +
+                "                     return false;" + DocletConstants.NL +
+                "            } else if (ch == '/' || ch == '.') {" + DocletConstants.NL +
+                "                if (!allowSep)" + DocletConstants.NL +
+                "                    return false;" + DocletConstants.NL +
+                "                allowNumber = false;" + DocletConstants.NL +
+                "                allowSep = false;" + DocletConstants.NL +
+                "                if (ch == '.')" + DocletConstants.NL +
+                "                     seenDot = true;" + DocletConstants.NL +
+                "                if (ch == '/' && seenDot)" + DocletConstants.NL +
+                "                     return false;" + DocletConstants.NL +
+                "            } else {" + DocletConstants.NL +
+                "                return false;"+ DocletConstants.NL +
+                "            }" + DocletConstants.NL +
+                "        }" + DocletConstants.NL +
+                "        return true;" + DocletConstants.NL +
+                "    }" + DocletConstants.NL +
                 "    function loadFrames() {" + DocletConstants.NL +
                 "        if (targetPage != \"\" && targetPage != \"undefined\")" + DocletConstants.NL +
                 "             top.classFrame.location = top.targetPage;" + DocletConstants.NL +
--- a/test/com/sun/javadoc/testJavascript/TestJavascript.java	Tue May 28 10:36:40 2013 -0700
+++ b/test/com/sun/javadoc/testJavascript/TestJavascript.java	Thu Jun 06 22:28:03 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug      4665566 4855876 7025314
+ * @bug      4665566 4855876 7025314 8012375 8015998
  * @summary  Verify that the output has the right javascript.
  * @author   jamieh
  * @library  ../lib/
@@ -35,7 +35,7 @@
 public class TestJavascript extends JavadocTester {
 
     //Test information.
-    private static final String BUG_ID = "4665566-4855876";
+    private static final String BUG_ID = "4665566-4855876-8012375";
 
     //Javadoc arguments.
     private static final String[] ARGS = new String[] {
@@ -53,8 +53,42 @@
                         "    targetPage = \"\" + window.location.search;" + NL +
             "    if (targetPage != \"\" && targetPage != \"undefined\")" + NL +
             "        targetPage = targetPage.substring(1);" + NL +
-            "    if (targetPage.indexOf(\":\") != -1)" + NL +
+            "    if (targetPage.indexOf(\":\") != -1 || (targetPage != \"\" && !validURL(targetPage)))" + NL +
             "        targetPage = \"undefined\";" + NL +
+            "    function validURL(url) {" + NL +
+            "        var pos = url.indexOf(\".html\");" + NL +
+            "        if (pos == -1 || pos != url.length - 5)" + NL +
+            "            return false;" + NL +
+            "        var allowNumber = false;" + NL +
+            "        var allowSep = false;" + NL +
+            "        var seenDot = false;" + NL +
+            "        for (var i = 0; i < url.length - 5; i++) {" + NL +
+            "            var ch = url.charAt(i);" + NL +
+            "            if ('a' <= ch && ch <= 'z' ||" + NL +
+            "                    'A' <= ch && ch <= 'Z' ||" + NL +
+            "                    ch == '$' ||" + NL +
+            "                    ch == '_') {" + NL +
+            "                allowNumber = true;" + NL +
+            "                allowSep = true;" + NL +
+            "            } else if ('0' <= ch && ch <= '9'" + NL +
+            "                    || ch == '-') {" + NL +
+            "                if (!allowNumber)" + NL +
+            "                     return false;" + NL +
+            "            } else if (ch == '/' || ch == '.') {" + NL +
+            "                if (!allowSep)" + NL +
+            "                    return false;" + NL +
+            "                allowNumber = false;" + NL +
+            "                allowSep = false;" + NL +
+            "                if (ch == '.')" + NL +
+            "                     seenDot = true;" + NL +
+            "                if (ch == '/' && seenDot)" + NL +
+            "                     return false;" + NL +
+            "            } else {" + NL +
+            "                return false;" + NL +
+            "            }" + NL +
+            "        }" + NL +
+            "        return true;" + NL +
+            "    }" + NL +
             "    function loadFrames() {" + NL +
             "        if (targetPage != \"\" && targetPage != \"undefined\")" + NL +
             "             top.classFrame.location = top.targetPage;" + NL +