changeset 1682:2f691b03f200

Merge
author coffeys
date Tue, 02 Jul 2013 11:35:15 +0100
parents 2a790207cfbb 056f998e75f8
children 8d0d4c97fdad
files
diffstat 4 files changed, 27 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Wed Jun 19 11:54:23 2013 +0100
+++ b/.hgtags	Tue Jul 02 11:35:15 2013 +0100
@@ -300,6 +300,13 @@
 17ee569d0c0130824ba27bc1b090114e6075c5f2 jdk7u25-b09
 41c1b02cd6a8fa7746752cc911da3dd4d380098d jdk7u25-b10
 0da9ef0d9fc5b017f960d65ae0cd07860a259621 jdk7u25-b11
+28358b2489b2ca29c1a6b79f643204da8924a3d7 jdk7u25-b12
+5ed8c453480063838b632c74f528924f529361a2 jdk7u25-b13
+c6342ec6a12f7283e2a73a80a44dcdd3683e2e8b jdk7u25-b14
+3b8323e24a636ac0638604d19fc116eb0eef6cdb jdk7u25-b15
+5d95c1e7c0913ad4bc0b5f0b559510d32557def2 jdk7u25-b30
+7294a7be7dbde9c3789f9fa881baa6b8fcd51674 jdk7u25-b16
+aaf5e30d5549ec5200b991806e62db3e866181a7 jdk7u25-b32
 cf80c545434cfe44034e667079673ce42cc9cdbf jdk7u14-b16
 aecd58f25d7f21827ae1b020ae8cfb44857c439f jdk7u14-b17
 577f9625ec558c18e9de6e3428fd0f9cca823033 jdk7u14-b18
@@ -316,3 +323,5 @@
 12506bba2b67cd4b229550da67ff85b984549a28 jdk7u40-b27
 9f2eea2fae59c5242d1bb4cbca967bb6fbb99865 jdk7u40-b28
 bfe3575143fddbf71c2e570b580afef007d171e4 jdk7u40-b29
+0586afeb2caa0b4595bf5b306657a5dd1f0d121c jdk7u40-b30
+9c343668b0a95e5510f715014884e5d45df9dfb0 jdk7u40-b31
--- a/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java	Wed Jun 19 11:54:23 2013 +0100
+++ b/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java	Tue Jul 02 11:35:15 2013 +0100
@@ -315,7 +315,8 @@
                 "    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 +
+                "        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 +
--- a/src/share/classes/com/sun/tools/javac/comp/Resolve.java	Wed Jun 19 11:54:23 2013 +0100
+++ b/src/share/classes/com/sun/tools/javac/comp/Resolve.java	Tue Jul 02 11:35:15 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -48,6 +48,7 @@
 import java.util.Set;
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.LinkedHashSet;
 
 /** Helper class for name resolution, used mostly by the attribution phase.
  *
@@ -306,11 +307,11 @@
         }
 
     /** Try to instantiate the type of a method so that it fits
-     *  given type arguments and argument types. If succesful, return
+     *  given type arguments and argument types. If successful, return
      *  the method's instantiated type, else return null.
      *  The instantiation will take into account an additional leading
      *  formal parameter if the method is an instance method seen as a member
-     *  of un underdetermined site In this case, we treat site as an additional
+     *  of an undetermined site In this case, we treat site as an additional
      *  parameter and the parameters of the class containing the method as
      *  additional type variables that get instantiated.
      *
@@ -2121,7 +2122,7 @@
      */
     class InapplicableSymbolsError extends ResolveError {
 
-        private List<Candidate> candidates = List.nil();
+        private Set<Candidate> candidates = new LinkedHashSet<Candidate>();
 
         InapplicableSymbolsError(Symbol sym) {
             super(WRONG_MTHS, "inapplicable symbols");
@@ -2135,7 +2136,7 @@
                 Name name,
                 List<Type> argtypes,
                 List<Type> typeargtypes) {
-            if (candidates.nonEmpty()) {
+            if (!candidates.isEmpty()) {
                 JCDiagnostic err = diags.create(dkind,
                         log.currentSource(),
                         pos,
@@ -2153,24 +2154,26 @@
         //where
         List<JCDiagnostic> candidateDetails(Type site) {
             List<JCDiagnostic> details = List.nil();
-            for (Candidate c : candidates)
+            for (Candidate c : candidates) {
                 details = details.prepend(c.getDiagnostic(site));
+            }
             return details.reverse();
         }
 
         Symbol addCandidate(MethodResolutionPhase currentStep, Symbol sym, JCDiagnostic details) {
             Candidate c = new Candidate(currentStep, sym, details);
-            if (c.isValid() && !candidates.contains(c))
-                candidates = candidates.append(c);
+            if (c.isValid() && !candidates.contains(c)) {
+                candidates.add(c);
+            }
             return this;
         }
 
         void clear() {
-            candidates = List.nil();
+            candidates.clear();
         }
 
         private Name getName() {
-            Symbol sym = candidates.head.sym;
+            Symbol sym = candidates.iterator().next().sym;
             return sym.name == names.init ?
                 sym.owner.name :
                 sym.name;
--- a/test/com/sun/javadoc/testJavascript/TestJavascript.java	Wed Jun 19 11:54:23 2013 +0100
+++ b/test/com/sun/javadoc/testJavascript/TestJavascript.java	Tue Jul 02 11:35:15 2013 +0100
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug      4665566 4855876 7025314 8012375
+ * @bug      4665566 4855876 7025314 8012375 8015998
  * @summary  Verify that the output has the right javascript.
  * @author   jamieh
  * @library  ../lib/
@@ -56,7 +56,8 @@
             "    if (targetPage.indexOf(\":\") != -1 || (targetPage != \"\" && !validURL(targetPage)))" + NL +
             "        targetPage = \"undefined\";" + NL +
             "    function validURL(url) {" + NL +
-            "        if (!(url.indexOf(\".html\") == url.length - 5))" + 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 +