changeset 1681:2a790207cfbb

Merge
author coffeys
date Wed, 19 Jun 2013 11:54:23 +0100
parents 2ec76773052f 0586afeb2caa
children 2f691b03f200 762cb639ef48
files
diffstat 3 files changed, 85 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Sun May 12 18:18:54 2013 -0700
+++ b/.hgtags	Wed Jun 19 11:54:23 2013 +0100
@@ -275,6 +275,7 @@
 2782a1c60faf7585dee0af0ef585aeed3288e521 jdk7u17-b02
 0abc443a68676c7231b274a324d27204c735acac jdk7u17-b30
 1a9b32d36ff86136549f20156cf3e821295228a0 jdk7u17-b31
+a91bdaf125d89b8b2c6ff86c8055aab3b7d2546c jdk7u17-b32
 8a12629ea21378f96666628f472cd9a6936a4933 jdk7u21-b01
 82103a284427a2512fe884d8f232f1a83d46beb6 jdk7u21-b02
 9adfe6a84c3884d5c24f6655e89546a6e0a80129 jdk7u21-b03
@@ -288,6 +289,17 @@
 e120818fc321b5d9d8573a58bf5f6a6eb7471229 jdk7u21-b11
 ff6f8ab2635c6e0b0f6bb1a68dca48b4fc31b107 jdk7u21-b30
 a87ad97e80ae1861143b477d8a8990dc6ecc9173 jdk7u21-b12
+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
 cf80c545434cfe44034e667079673ce42cc9cdbf jdk7u14-b16
 aecd58f25d7f21827ae1b020ae8cfb44857c439f jdk7u14-b17
 577f9625ec558c18e9de6e3428fd0f9cca823033 jdk7u14-b18
@@ -303,3 +315,4 @@
 5bd6f156bc01b6a4e901fc5607663dfc249e9105 jdk7u40-b26
 12506bba2b67cd4b229550da67ff85b984549a28 jdk7u40-b27
 9f2eea2fae59c5242d1bb4cbca967bb6fbb99865 jdk7u40-b28
+bfe3575143fddbf71c2e570b580afef007d171e4 jdk7u40-b29
--- a/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java	Sun May 12 18:18:54 2013 -0700
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java	Wed Jun 19 11:54:23 2013 +0100
@@ -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,41 @@
         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 +
+                "        if (!(url.indexOf(\".html\") == 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	Sun May 12 18:18:54 2013 -0700
+++ b/test/com/sun/javadoc/testJavascript/TestJavascript.java	Wed Jun 19 11:54:23 2013 +0100
@@ -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
  * @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,41 @@
                         "    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 +
+            "        if (!(url.indexOf(\".html\") == 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 +