Merge

Thu, 04 Jun 2015 15:32:38 -0700

author
asaha
date
Thu, 04 Jun 2015 15:32:38 -0700
changeset 2921
0e6eb53f9c8c
parent 2920
012e7188c34e
parent 2866
50e8eb362040
child 2922
aabcaaa69d3a

Merge

.hgtags file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/javac/jvm/LVTRanges.java file | annotate | diff | comparison | revisions
test/tools/javac/varargs/T8049075/VarargsAndWildcardParameterizedTypeTest.java file | annotate | diff | comparison | revisions
     1.1 --- a/.hgtags	Thu May 07 18:15:48 2015 -0700
     1.2 +++ b/.hgtags	Thu Jun 04 15:32:38 2015 -0700
     1.3 @@ -415,6 +415,29 @@
     1.4  90def0a14f4ad8c99fcda34f2745b6158823e21c jdk8u51-b09
     1.5  417f734de62d74c69e3a8465340bfb3aca60151a jdk8u51-b10
     1.6  8ac1243890d4f427a32320b81ae1be38f81f0c62 jdk8u51-b11
     1.7 +f65c2fc549b5e9184da67e3a4f81260c27a88010 jdk8u51-b12
     1.8 +3836d67a94a92befedd97064358270c6f0760e5c jdk8u51-b13
     1.9 +f3a44c7deac2b23a53f0fd35b22a5d9181291616 jdk8u51-b14
    1.10 +f77e8d012e8d6ee3432515ad68dd4f630dd08d56 jdk8u51-b15
    1.11 +0c514d1fd006fc79d35b670de10c370c8d559db7 jdk8u60-b00
    1.12 +0ba07c272e33c93377a5d7ed98b9de873cc91980 jdk8u60-b01
    1.13 +387cf62ce7895dd5e067aaa51faa93d5c078583e jdk8u60-b02
    1.14 +e59ced856c92d542b6ea11a3a76e2f0a1ffae17a jdk8u60-b03
    1.15 +27bb4c63fd70483bb63a6d830c595e691bf28a34 jdk8u60-b04
    1.16 +fc98314cff57ce33bfe3093441804ee0a3446622 jdk8u60-b05
    1.17 +44d168f9ad16609062e359ee70c6699ec4525b45 jdk8u60-b06
    1.18 +39b47ffeb7780407561c0b189c3b3ab497868518 jdk8u60-b07
    1.19 +e5b93c508212e0db2301cc25f5ada882367d1d9b jdk8u60-b08
    1.20 +76adee5ad278e33675fdd236179fa83f20de5cc3 jdk8u60-b09
    1.21 +ba758e1ffa6960266e5c619b7771ca779ee5d148 jdk8u60-b10
    1.22 +ac218cf56d8ba365ba341132933629c10dbfcc06 jdk8u60-b11
    1.23 +84eb517777335f079ba16c1fa49e7c36f0c444aa jdk8u60-b12
    1.24 +9df2a728410bb8603d0cc39bdebed8fa93430cb2 jdk8u60-b13
    1.25 +a136ed2f3041e48f340d891208cc8ac0171a7816 jdk8u60-b14
    1.26 +248db113703a917fd38b637d384848a5e458ebcc jdk8u60-b15
    1.27 +ecb7e46b820f293bb644f92bc1af3ede53bceced jdk8u60-b16
    1.28 +87dcdc1fd75bf827c8a4596b183de7ea73cb75e1 jdk8u60-b17
    1.29 +e7e42c79861ea1ab7495de5f238c01f98035a8a8 jdk8u60-b18
    1.30  779397f90251ea813cb44621dc27f780e5c20449 jdk8u52-b06
    1.31  e0ce6be9142ed1e2f0ce3ee13090ec01c6c44721 jdk8u52-b07
    1.32  779397f90251ea813cb44621dc27f780e5c20449 jdk8u65-b00
     2.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java	Thu May 07 18:15:48 2015 -0700
     2.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java	Thu Jun 04 15:32:38 2015 -0700
     2.3 @@ -113,7 +113,7 @@
     2.4              Content captionSpan;
     2.5              Content span;
     2.6              if (type.isDefaultTab()) {
     2.7 -                captionSpan = HtmlTree.SPAN(new StringContent(type.text()));
     2.8 +                captionSpan = HtmlTree.SPAN(configuration.getResource(type.resourceKey()));
     2.9                  span = HtmlTree.SPAN(type.tabId(),
    2.10                          HtmlStyle.activeTableTab, captionSpan);
    2.11              } else {
    2.12 @@ -136,7 +136,7 @@
    2.13       */
    2.14      public Content getMethodTypeLinks(MethodTypes methodType) {
    2.15          String jsShow = "javascript:show(" + methodType.value() +");";
    2.16 -        HtmlTree link = HtmlTree.A(jsShow, new StringContent(methodType.text()));
    2.17 +        HtmlTree link = HtmlTree.A(jsShow, configuration.getResource(methodType.resourceKey()));
    2.18          return link;
    2.19      }
    2.20  
     3.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java	Thu May 07 18:15:48 2015 -0700
     3.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java	Thu Jun 04 15:32:38 2015 -0700
     3.3 @@ -471,10 +471,10 @@
     3.4          for (Map.Entry<String,Integer> entry : typeMap.entrySet()) {
     3.5              vars.append(sep);
     3.6              sep = ",";
     3.7 -            vars.append("\"");
     3.8 -            vars.append(entry.getKey());
     3.9 -            vars.append("\":");
    3.10 -            vars.append(entry.getValue());
    3.11 +            vars.append("\"")
    3.12 +                    .append(entry.getKey())
    3.13 +                    .append("\":")
    3.14 +                    .append(entry.getValue());
    3.15          }
    3.16          vars.append("};").append(DocletConstants.NL);
    3.17          sep = "";
    3.18 @@ -482,11 +482,19 @@
    3.19          for (MethodTypes entry : methodTypes) {
    3.20              vars.append(sep);
    3.21              sep = ",";
    3.22 -            vars.append(entry.value()).append(":");
    3.23 -            vars.append("[").append("\"").append(entry.tabId());
    3.24 -            vars.append("\"").append(sep).append("\"").append(entry.text()).append("\"]");
    3.25 +            vars.append(entry.value())
    3.26 +                    .append(":")
    3.27 +                    .append("[")
    3.28 +                    .append("\"")
    3.29 +                    .append(entry.tabId())
    3.30 +                    .append("\"")
    3.31 +                    .append(sep)
    3.32 +                    .append("\"")
    3.33 +                    .append(configuration.getText(entry.resourceKey()))
    3.34 +                    .append("\"]");
    3.35          }
    3.36 -        vars.append("};").append(DocletConstants.NL);
    3.37 +        vars.append("};")
    3.38 +                .append(DocletConstants.NL);
    3.39          addStyles(HtmlStyle.altColor, vars);
    3.40          addStyles(HtmlStyle.rowColor, vars);
    3.41          addStyles(HtmlStyle.tableTab, vars);
     4.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets.properties	Thu May 07 18:15:48 2015 -0700
     4.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets.properties	Thu Jun 04 15:32:38 2015 -0700
     4.3 @@ -150,6 +150,13 @@
     4.4  doclet.Constructors=Constructors
     4.5  doclet.methods=methods
     4.6  doclet.Methods=Methods
     4.7 +doclet.All_Methods=All Methods
     4.8 +doclet.Static_Methods=Static Methods
     4.9 +doclet.Instance_Methods=Instance Methods
    4.10 +doclet.Abstract_Methods=Abstract Methods
    4.11 +doclet.Concrete_Methods=Concrete Methods
    4.12 +doclet.Default_Methods=Default Methods
    4.13 +doclet.Deprecated_Methods=Deprecated Methods
    4.14  doclet.annotation_type_optional_members=optional elements
    4.15  doclet.Annotation_Type_Optional_Members=Optional Elements
    4.16  doclet.annotation_type_required_members=required elements
     5.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css	Thu May 07 18:15:48 2015 -0700
     5.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css	Thu Jun 04 15:32:38 2015 -0700
     5.3 @@ -463,7 +463,6 @@
     5.4  .useSummary td, .constantsSummary td, .deprecatedSummary td {
     5.5      text-align:left;
     5.6      padding:0px 0px 12px 10px;
     5.7 -    width:100%;
     5.8  }
     5.9  th.colOne, th.colFirst, th.colLast, .useSummary th, .constantsSummary th,
    5.10  td.colOne, td.colFirst, td.colLast, .useSummary td, .constantsSummary td{
    5.11 @@ -488,6 +487,7 @@
    5.12      font-size:13px;
    5.13  }
    5.14  .overviewSummary td.colFirst, .overviewSummary th.colFirst,
    5.15 +.useSummary td.colFirst, .useSummary th.colFirst,
    5.16  .overviewSummary td.colOne, .overviewSummary th.colOne,
    5.17  .memberSummary td.colFirst, .memberSummary th.colFirst,
    5.18  .memberSummary td.colOne, .memberSummary th.colOne,
     6.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/MethodTypes.java	Thu May 07 18:15:48 2015 -0700
     6.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/MethodTypes.java	Thu Jun 04 15:32:38 2015 -0700
     6.3 @@ -1,5 +1,5 @@
     6.4  /*
     6.5 - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
     6.6 + * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
     6.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     6.8   *
     6.9   * This code is free software; you can redistribute it and/or modify it
    6.10 @@ -31,22 +31,22 @@
    6.11   * @author Bhavesh Patel
    6.12   */
    6.13  public enum MethodTypes {
    6.14 -    ALL(0xffff, "All Methods", "t0", true),
    6.15 -    STATIC(0x1, "Static Methods", "t1", false),
    6.16 -    INSTANCE(0x2, "Instance Methods", "t2", false),
    6.17 -    ABSTRACT(0x4, "Abstract Methods", "t3", false),
    6.18 -    CONCRETE(0x8, "Concrete Methods", "t4", false),
    6.19 -    DEFAULT(0x10, "Default Methods", "t5", false),
    6.20 -    DEPRECATED(0x20, "Deprecated Methods", "t6", false);
    6.21 +    ALL(0xffff, "doclet.All_Methods", "t0", true),
    6.22 +    STATIC(0x1, "doclet.Static_Methods", "t1", false),
    6.23 +    INSTANCE(0x2, "doclet.Instance_Methods", "t2", false),
    6.24 +    ABSTRACT(0x4, "doclet.Abstract_Methods", "t3", false),
    6.25 +    CONCRETE(0x8, "doclet.Concrete_Methods", "t4", false),
    6.26 +    DEFAULT(0x10, "doclet.Default_Methods", "t5", false),
    6.27 +    DEPRECATED(0x20, "doclet.Deprecated_Methods", "t6", false);
    6.28  
    6.29      private final int value;
    6.30 -    private final String text;
    6.31 +    private final String resourceKey;
    6.32      private final String tabId;
    6.33      private final boolean isDefaultTab;
    6.34  
    6.35 -    MethodTypes(int v, String t, String id, boolean dt) {
    6.36 +    MethodTypes(int v, String k, String id, boolean dt) {
    6.37          this.value = v;
    6.38 -        this.text = t;
    6.39 +        this.resourceKey = k;
    6.40          this.tabId = id;
    6.41          this.isDefaultTab = dt;
    6.42      }
    6.43 @@ -55,8 +55,8 @@
    6.44          return value;
    6.45      }
    6.46  
    6.47 -    public String text() {
    6.48 -        return text;
    6.49 +    public String resourceKey() {
    6.50 +        return resourceKey;
    6.51      }
    6.52  
    6.53      public String tabId() {
     7.1 --- a/src/share/classes/com/sun/tools/javac/code/Symbol.java	Thu May 07 18:15:48 2015 -0700
     7.2 +++ b/src/share/classes/com/sun/tools/javac/code/Symbol.java	Thu Jun 04 15:32:38 2015 -0700
     7.3 @@ -1153,6 +1153,16 @@
     7.4          public <R, P> R accept(Symbol.Visitor<R, P> v, P p) {
     7.5              return v.visitClassSymbol(this, p);
     7.6          }
     7.7 +
     7.8 +        public void markAbstractIfNeeded(Types types) {
     7.9 +            if (types.enter.getEnv(this) != null &&
    7.10 +                (flags() & ENUM) != 0 && types.supertype(type).tsym == types.syms.enumSym &&
    7.11 +                (flags() & (FINAL | ABSTRACT)) == 0) {
    7.12 +                if (types.firstUnimplementedAbstract(this) != null)
    7.13 +                    // add the ABSTRACT flag to an enum
    7.14 +                    flags_field |= ABSTRACT;
    7.15 +            }
    7.16 +        }
    7.17      }
    7.18  
    7.19  
     8.1 --- a/src/share/classes/com/sun/tools/javac/code/Types.java	Thu May 07 18:15:48 2015 -0700
     8.2 +++ b/src/share/classes/com/sun/tools/javac/code/Types.java	Thu Jun 04 15:32:38 2015 -0700
     8.3 @@ -47,6 +47,7 @@
     8.4  import com.sun.tools.javac.util.*;
     8.5  import static com.sun.tools.javac.code.BoundKind.*;
     8.6  import static com.sun.tools.javac.code.Flags.*;
     8.7 +import static com.sun.tools.javac.code.Kinds.MTH;
     8.8  import static com.sun.tools.javac.code.Scope.*;
     8.9  import static com.sun.tools.javac.code.Symbol.*;
    8.10  import static com.sun.tools.javac.code.Type.*;
    8.11 @@ -85,6 +86,7 @@
    8.12      final boolean allowBoxing;
    8.13      final boolean allowCovariantReturns;
    8.14      final boolean allowObjectToPrimitiveCast;
    8.15 +    final boolean allowDefaultMethods;
    8.16      final ClassReader reader;
    8.17      final Check chk;
    8.18      final Enter enter;
    8.19 @@ -111,6 +113,7 @@
    8.20          allowBoxing = source.allowBoxing();
    8.21          allowCovariantReturns = source.allowCovariantReturns();
    8.22          allowObjectToPrimitiveCast = source.allowObjectToPrimitiveCast();
    8.23 +        allowDefaultMethods = source.allowDefaultMethods();
    8.24          reader = ClassReader.instance(context);
    8.25          chk = Check.instance(context);
    8.26          enter = Enter.instance(context);
    8.27 @@ -2763,6 +2766,59 @@
    8.28      // </editor-fold>
    8.29  
    8.30  
    8.31 +    /** Return first abstract member of class `sym'.
    8.32 +     */
    8.33 +    public MethodSymbol firstUnimplementedAbstract(ClassSymbol sym) {
    8.34 +        try {
    8.35 +            return firstUnimplementedAbstractImpl(sym, sym);
    8.36 +        } catch (CompletionFailure ex) {
    8.37 +            chk.completionError(enter.getEnv(sym).tree.pos(), ex);
    8.38 +            return null;
    8.39 +        }
    8.40 +    }
    8.41 +        //where:
    8.42 +        private MethodSymbol firstUnimplementedAbstractImpl(ClassSymbol impl, ClassSymbol c) {
    8.43 +            MethodSymbol undef = null;
    8.44 +            // Do not bother to search in classes that are not abstract,
    8.45 +            // since they cannot have abstract members.
    8.46 +            if (c == impl || (c.flags() & (ABSTRACT | INTERFACE)) != 0) {
    8.47 +                Scope s = c.members();
    8.48 +                for (Scope.Entry e = s.elems;
    8.49 +                     undef == null && e != null;
    8.50 +                     e = e.sibling) {
    8.51 +                    if (e.sym.kind == MTH &&
    8.52 +                        (e.sym.flags() & (ABSTRACT|IPROXY|DEFAULT)) == ABSTRACT) {
    8.53 +                        MethodSymbol absmeth = (MethodSymbol)e.sym;
    8.54 +                        MethodSymbol implmeth = absmeth.implementation(impl, this, true);
    8.55 +                        if (implmeth == null || implmeth == absmeth) {
    8.56 +                            //look for default implementations
    8.57 +                            if (allowDefaultMethods) {
    8.58 +                                MethodSymbol prov = interfaceCandidates(impl.type, absmeth).head;
    8.59 +                                if (prov != null && prov.overrides(absmeth, impl, this, true)) {
    8.60 +                                    implmeth = prov;
    8.61 +                                }
    8.62 +                            }
    8.63 +                        }
    8.64 +                        if (implmeth == null || implmeth == absmeth) {
    8.65 +                            undef = absmeth;
    8.66 +                        }
    8.67 +                    }
    8.68 +                }
    8.69 +                if (undef == null) {
    8.70 +                    Type st = supertype(c.type);
    8.71 +                    if (st.hasTag(CLASS))
    8.72 +                        undef = firstUnimplementedAbstractImpl(impl, (ClassSymbol)st.tsym);
    8.73 +                }
    8.74 +                for (List<Type> l = interfaces(c.type);
    8.75 +                     undef == null && l.nonEmpty();
    8.76 +                     l = l.tail) {
    8.77 +                    undef = firstUnimplementedAbstractImpl(impl, (ClassSymbol)l.head.tsym);
    8.78 +                }
    8.79 +            }
    8.80 +            return undef;
    8.81 +        }
    8.82 +
    8.83 +
    8.84      //where
    8.85      public List<MethodSymbol> interfaceCandidates(Type site, MethodSymbol ms) {
    8.86          Filter<Symbol> filter = new MethodFilter(ms, site);
     9.1 --- a/src/share/classes/com/sun/tools/javac/comp/Attr.java	Thu May 07 18:15:48 2015 -0700
     9.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Attr.java	Thu Jun 04 15:32:38 2015 -0700
     9.3 @@ -4269,6 +4269,8 @@
     9.4              chk.validate(tree.implementing, env);
     9.5          }
     9.6  
     9.7 +        c.markAbstractIfNeeded(types);
     9.8 +
     9.9          // If this is a non-abstract class, check that it has no abstract
    9.10          // methods or unimplemented methods of an implemented interface.
    9.11          if ((c.flags() & (ABSTRACT | INTERFACE)) == 0) {
    10.1 --- a/src/share/classes/com/sun/tools/javac/comp/Check.java	Thu May 07 18:15:48 2015 -0700
    10.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Check.java	Thu Jun 04 15:32:38 2015 -0700
    10.3 @@ -2049,70 +2049,15 @@
    10.4       *  @param c            The class.
    10.5       */
    10.6      void checkAllDefined(DiagnosticPosition pos, ClassSymbol c) {
    10.7 -        try {
    10.8 -            MethodSymbol undef = firstUndef(c, c);
    10.9 -            if (undef != null) {
   10.10 -                if ((c.flags() & ENUM) != 0 &&
   10.11 -                    types.supertype(c.type).tsym == syms.enumSym &&
   10.12 -                    (c.flags() & FINAL) == 0) {
   10.13 -                    // add the ABSTRACT flag to an enum
   10.14 -                    c.flags_field |= ABSTRACT;
   10.15 -                } else {
   10.16 -                    MethodSymbol undef1 =
   10.17 -                        new MethodSymbol(undef.flags(), undef.name,
   10.18 -                                         types.memberType(c.type, undef), undef.owner);
   10.19 -                    log.error(pos, "does.not.override.abstract",
   10.20 -                              c, undef1, undef1.location());
   10.21 -                }
   10.22 -            }
   10.23 -        } catch (CompletionFailure ex) {
   10.24 -            completionError(pos, ex);
   10.25 +        MethodSymbol undef = types.firstUnimplementedAbstract(c);
   10.26 +        if (undef != null) {
   10.27 +            MethodSymbol undef1 =
   10.28 +                new MethodSymbol(undef.flags(), undef.name,
   10.29 +                                 types.memberType(c.type, undef), undef.owner);
   10.30 +            log.error(pos, "does.not.override.abstract",
   10.31 +                      c, undef1, undef1.location());
   10.32          }
   10.33      }
   10.34 -//where
   10.35 -        /** Return first abstract member of class `c' that is not defined
   10.36 -         *  in `impl', null if there is none.
   10.37 -         */
   10.38 -        private MethodSymbol firstUndef(ClassSymbol impl, ClassSymbol c) {
   10.39 -            MethodSymbol undef = null;
   10.40 -            // Do not bother to search in classes that are not abstract,
   10.41 -            // since they cannot have abstract members.
   10.42 -            if (c == impl || (c.flags() & (ABSTRACT | INTERFACE)) != 0) {
   10.43 -                Scope s = c.members();
   10.44 -                for (Scope.Entry e = s.elems;
   10.45 -                     undef == null && e != null;
   10.46 -                     e = e.sibling) {
   10.47 -                    if (e.sym.kind == MTH &&
   10.48 -                        (e.sym.flags() & (ABSTRACT|IPROXY|DEFAULT)) == ABSTRACT) {
   10.49 -                        MethodSymbol absmeth = (MethodSymbol)e.sym;
   10.50 -                        MethodSymbol implmeth = absmeth.implementation(impl, types, true);
   10.51 -                        if (implmeth == null || implmeth == absmeth) {
   10.52 -                            //look for default implementations
   10.53 -                            if (allowDefaultMethods) {
   10.54 -                                MethodSymbol prov = types.interfaceCandidates(impl.type, absmeth).head;
   10.55 -                                if (prov != null && prov.overrides(absmeth, impl, types, true)) {
   10.56 -                                    implmeth = prov;
   10.57 -                                }
   10.58 -                            }
   10.59 -                        }
   10.60 -                        if (implmeth == null || implmeth == absmeth) {
   10.61 -                            undef = absmeth;
   10.62 -                        }
   10.63 -                    }
   10.64 -                }
   10.65 -                if (undef == null) {
   10.66 -                    Type st = types.supertype(c.type);
   10.67 -                    if (st.hasTag(CLASS))
   10.68 -                        undef = firstUndef(impl, (ClassSymbol)st.tsym);
   10.69 -                }
   10.70 -                for (List<Type> l = types.interfaces(c.type);
   10.71 -                     undef == null && l.nonEmpty();
   10.72 -                     l = l.tail) {
   10.73 -                    undef = firstUndef(impl, (ClassSymbol)l.head.tsym);
   10.74 -                }
   10.75 -            }
   10.76 -            return undef;
   10.77 -        }
   10.78  
   10.79      void checkNonCyclicDecl(JCClassDecl tree) {
   10.80          CycleChecker cc = new CycleChecker();
    11.1 --- a/src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java	Thu May 07 18:15:48 2015 -0700
    11.2 +++ b/src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java	Thu Jun 04 15:32:38 2015 -0700
    11.3 @@ -1,5 +1,5 @@
    11.4  /*
    11.5 - * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
    11.6 + * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
    11.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    11.8   *
    11.9   * This code is free software; you can redistribute it and/or modify it
   11.10 @@ -224,7 +224,8 @@
   11.11              DeferredStuckPolicy deferredStuckPolicy;
   11.12              if (resultInfo.pt.hasTag(NONE) || resultInfo.pt.isErroneous()) {
   11.13                  deferredStuckPolicy = dummyStuckPolicy;
   11.14 -            } else if (resultInfo.checkContext.deferredAttrContext().mode == AttrMode.SPECULATIVE) {
   11.15 +            } else if (resultInfo.checkContext.deferredAttrContext().mode == AttrMode.SPECULATIVE ||
   11.16 +                    resultInfo.checkContext.deferredAttrContext().insideOverloadPhase()) {
   11.17                  deferredStuckPolicy = new OverloadStuckPolicy(resultInfo, this);
   11.18              } else {
   11.19                  deferredStuckPolicy = new CheckStuckPolicy(resultInfo, this);
    12.1 --- a/src/share/classes/com/sun/tools/javac/comp/Infer.java	Thu May 07 18:15:48 2015 -0700
    12.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Infer.java	Thu Jun 04 15:32:38 2015 -0700
    12.3 @@ -315,11 +315,9 @@
    12.4              for (Type aLowerBound : from.getBounds(InferenceBound.LOWER)) {
    12.5                  for (Type anotherLowerBound : from.getBounds(InferenceBound.LOWER)) {
    12.6                      if (aLowerBound != anotherLowerBound &&
    12.7 -                        commonSuperWithDiffParameterization(aLowerBound, anotherLowerBound)) {
    12.8 -                        /* self comment check if any lower bound may be and undetVar,
    12.9 -                         * in that case the result of this call may be a false positive.
   12.10 -                         * Should this be restricted to non free types?
   12.11 -                         */
   12.12 +                            !inferenceContext.free(aLowerBound) &&
   12.13 +                            !inferenceContext.free(anotherLowerBound) &&
   12.14 +                            commonSuperWithDiffParameterization(aLowerBound, anotherLowerBound)) {
   12.15                          return generateReferenceToTargetConstraint(tree, from, to,
   12.16                              resultInfo, inferenceContext);
   12.17                      }
    13.1 --- a/src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java	Thu May 07 18:15:48 2015 -0700
    13.2 +++ b/src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java	Thu Jun 04 15:32:38 2015 -0700
    13.3 @@ -265,7 +265,7 @@
    13.4      @Override
    13.5      public void visitLambda(JCLambda tree) {
    13.6          LambdaTranslationContext localContext = (LambdaTranslationContext)context;
    13.7 -        MethodSymbol sym = (MethodSymbol)localContext.translatedSym;
    13.8 +        MethodSymbol sym = localContext.translatedSym;
    13.9          MethodType lambdaType = (MethodType) sym.type;
   13.10  
   13.11          {
   13.12 @@ -1755,7 +1755,7 @@
   13.13              Map<LambdaSymbolKind, Map<Symbol, Symbol>> translatedSymbols;
   13.14  
   13.15              /** the synthetic symbol for the method hoisting the translated lambda */
   13.16 -            Symbol translatedSym;
   13.17 +            MethodSymbol translatedSym;
   13.18  
   13.19              List<JCVariableDecl> syntheticParams;
   13.20  
   13.21 @@ -1883,7 +1883,7 @@
   13.22               * Translate a symbol of a given kind into something suitable for the
   13.23               * synthetic lambda body
   13.24               */
   13.25 -            Symbol translate(Name name, final Symbol sym, LambdaSymbolKind skind) {
   13.26 +            Symbol translate(final Symbol sym, LambdaSymbolKind skind) {
   13.27                  Symbol ret;
   13.28                  switch (skind) {
   13.29                      case CAPTURED_THIS:
   13.30 @@ -1891,7 +1891,7 @@
   13.31                          break;
   13.32                      case TYPE_VAR:
   13.33                          // Just erase the type var
   13.34 -                        ret = new VarSymbol(sym.flags(), name,
   13.35 +                        ret = new VarSymbol(sym.flags(), sym.name,
   13.36                                  types.erasure(sym.type), sym.owner);
   13.37  
   13.38                          /* this information should also be kept for LVT generation at Gen
   13.39 @@ -1900,7 +1900,7 @@
   13.40                          ((VarSymbol)ret).pos = ((VarSymbol)sym).pos;
   13.41                          break;
   13.42                      case CAPTURED_VAR:
   13.43 -                        ret = new VarSymbol(SYNTHETIC | FINAL | PARAMETER, name, types.erasure(sym.type), translatedSym) {
   13.44 +                        ret = new VarSymbol(SYNTHETIC | FINAL | PARAMETER, sym.name, types.erasure(sym.type), translatedSym) {
   13.45                              @Override
   13.46                              public Symbol baseSymbol() {
   13.47                                  //keep mapping with original captured symbol
   13.48 @@ -1909,16 +1909,16 @@
   13.49                          };
   13.50                          break;
   13.51                      case LOCAL_VAR:
   13.52 -                        ret = new VarSymbol(sym.flags() & FINAL, name, sym.type, translatedSym);
   13.53 +                        ret = new VarSymbol(sym.flags() & FINAL, sym.name, sym.type, translatedSym);
   13.54                          ((VarSymbol) ret).pos = ((VarSymbol) sym).pos;
   13.55                          break;
   13.56                      case PARAM:
   13.57 -                        ret = new VarSymbol((sym.flags() & FINAL) | PARAMETER, name, types.erasure(sym.type), translatedSym);
   13.58 +                        ret = new VarSymbol((sym.flags() & FINAL) | PARAMETER, sym.name, types.erasure(sym.type), translatedSym);
   13.59                          ((VarSymbol) ret).pos = ((VarSymbol) sym).pos;
   13.60                          break;
   13.61                      default:
   13.62 -                        ret = makeSyntheticVar(FINAL, name, types.erasure(sym.type), translatedSym);
   13.63 -                        ((VarSymbol) ret).pos = ((VarSymbol) sym).pos;
   13.64 +                        Assert.error(skind.name());
   13.65 +                        throw new AssertionError();
   13.66                  }
   13.67                  if (ret != sym) {
   13.68                      ret.setDeclarationAttributes(sym.getRawAttributes());
   13.69 @@ -1929,27 +1929,8 @@
   13.70  
   13.71              void addSymbol(Symbol sym, LambdaSymbolKind skind) {
   13.72                  Map<Symbol, Symbol> transMap = getSymbolMap(skind);
   13.73 -                Name preferredName;
   13.74 -                switch (skind) {
   13.75 -                    case CAPTURED_THIS:
   13.76 -                        preferredName = names.fromString("encl$" + transMap.size());
   13.77 -                        break;
   13.78 -                    case CAPTURED_VAR:
   13.79 -                        preferredName = names.fromString("cap$" + transMap.size());
   13.80 -                        break;
   13.81 -                    case LOCAL_VAR:
   13.82 -                        preferredName = sym.name;
   13.83 -                        break;
   13.84 -                    case PARAM:
   13.85 -                        preferredName = sym.name;
   13.86 -                        break;
   13.87 -                    case TYPE_VAR:
   13.88 -                        preferredName = sym.name;
   13.89 -                        break;
   13.90 -                    default: throw new AssertionError();
   13.91 -                }
   13.92                  if (!transMap.containsKey(sym)) {
   13.93 -                    transMap.put(sym, translate(preferredName, sym, skind));
   13.94 +                    transMap.put(sym, translate(sym, skind));
   13.95                  }
   13.96              }
   13.97  
   13.98 @@ -1997,6 +1978,7 @@
   13.99  
  13.100                  //compute synthetic params
  13.101                  ListBuffer<JCVariableDecl> params = new ListBuffer<>();
  13.102 +                ListBuffer<VarSymbol> parameterSymbols = new ListBuffer<>();
  13.103  
  13.104                  // The signature of the method is augmented with the following
  13.105                  // synthetic parameters:
  13.106 @@ -2005,19 +1987,16 @@
  13.107                  // 2) enclosing locals captured by the lambda expression
  13.108                  for (Symbol thisSym : getSymbolMap(CAPTURED_VAR).values()) {
  13.109                      params.append(make.VarDef((VarSymbol) thisSym, null));
  13.110 -                }
  13.111 -                if (methodReferenceReceiver != null) {
  13.112 -                    params.append(make.VarDef(
  13.113 -                            make.Modifiers(PARAMETER|FINAL),
  13.114 -                            names.fromString("$rcvr$"),
  13.115 -                            make.Type(methodReferenceReceiver.type),
  13.116 -                            null));
  13.117 +                    parameterSymbols.append((VarSymbol) thisSym);
  13.118                  }
  13.119                  for (Symbol thisSym : getSymbolMap(PARAM).values()) {
  13.120                      params.append(make.VarDef((VarSymbol) thisSym, null));
  13.121 +                    parameterSymbols.append((VarSymbol) thisSym);
  13.122                  }
  13.123                  syntheticParams = params.toList();
  13.124  
  13.125 +                translatedSym.params = parameterSymbols.toList();
  13.126 +
  13.127                  // Compute and set the lambda name
  13.128                  translatedSym.name = isSerializable()
  13.129                          ? serializedLambdaName()
    14.1 --- a/src/share/classes/com/sun/tools/javac/comp/Lower.java	Thu May 07 18:15:48 2015 -0700
    14.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Lower.java	Thu Jun 04 15:32:38 2015 -0700
    14.3 @@ -2540,7 +2540,7 @@
    14.4          currentMethodSym = currentMethodSymPrev;
    14.5  
    14.6          // Return empty block {} as a placeholder for an inner class.
    14.7 -        result = make_at(tree.pos()).Block(0, List.<JCStatement>nil());
    14.8 +        result = make_at(tree.pos()).Block(SYNTHETIC, List.<JCStatement>nil());
    14.9      }
   14.10  
   14.11      /** Translate an enum class. */
    15.1 --- a/src/share/classes/com/sun/tools/javac/comp/Resolve.java	Thu May 07 18:15:48 2015 -0700
    15.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Resolve.java	Thu Jun 04 15:32:38 2015 -0700
    15.3 @@ -836,20 +836,19 @@
    15.4                                      List<Type> formals,
    15.5                                      Warner warn) {
    15.6              super.argumentsAcceptable(env, deferredAttrContext, argtypes, formals, warn);
    15.7 -            //should we expand formals?
    15.8 +            // should we check varargs element type accessibility?
    15.9              if (deferredAttrContext.phase.isVarargsRequired()) {
   15.10 -                Type typeToCheck = null;
   15.11 -                if (!checkVarargsAccessAfterResolution) {
   15.12 -                    typeToCheck = types.elemtype(formals.last());
   15.13 -                } else if (deferredAttrContext.mode == AttrMode.CHECK) {
   15.14 -                    typeToCheck = types.erasure(types.elemtype(formals.last()));
   15.15 -                }
   15.16 -                if (typeToCheck != null) {
   15.17 -                    varargsAccessible(env, typeToCheck, deferredAttrContext.inferenceContext);
   15.18 +                if (deferredAttrContext.mode == AttrMode.CHECK || !checkVarargsAccessAfterResolution) {
   15.19 +                    varargsAccessible(env, types.elemtype(formals.last()), deferredAttrContext.inferenceContext);
   15.20                  }
   15.21              }
   15.22          }
   15.23  
   15.24 +        /**
   15.25 +         * Test that the runtime array element type corresponding to 't' is accessible.  't' should be the
   15.26 +         * varargs element type of either the method invocation type signature (after inference completes)
   15.27 +         * or the method declaration signature (before inference completes).
   15.28 +         */
   15.29          private void varargsAccessible(final Env<AttrContext> env, final Type t, final InferenceContext inferenceContext) {
   15.30              if (inferenceContext.free(t)) {
   15.31                  inferenceContext.addFreeTypeListener(List.of(t), new FreeTypeListener() {
   15.32 @@ -859,7 +858,7 @@
   15.33                      }
   15.34                  });
   15.35              } else {
   15.36 -                if (!isAccessible(env, t)) {
   15.37 +                if (!isAccessible(env, types.erasure(t))) {
   15.38                      Symbol location = env.enclClass.sym;
   15.39                      reportMC(env.tree, MethodCheckDiag.INACCESSIBLE_VARARGS, inferenceContext, t, Kinds.kindName(location), location);
   15.40                  }
   15.41 @@ -4087,7 +4086,7 @@
   15.42                              s : new MethodSymbol(
   15.43                                  s.flags(),
   15.44                                  s.name,
   15.45 -                                types.createMethodTypeWithThrown(mt, allThrown),
   15.46 +                                types.createMethodTypeWithThrown(s.type, allThrown),
   15.47                                  s.owner);
   15.48                  }
   15.49              }
    16.1 --- a/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java	Thu May 07 18:15:48 2015 -0700
    16.2 +++ b/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java	Thu Jun 04 15:32:38 2015 -0700
    16.3 @@ -1,5 +1,5 @@
    16.4  /*
    16.5 - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
    16.6 + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
    16.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    16.8   *
    16.9   * This code is free software; you can redistribute it and/or modify it
   16.10 @@ -1779,15 +1779,17 @@
   16.11              // The method wasn't found: emit a warning and recover
   16.12              JavaFileObject prevSource = log.useSource(requestingOwner.classfile);
   16.13              try {
   16.14 -                if (failure == null) {
   16.15 -                    log.warning("annotation.method.not.found",
   16.16 -                                container,
   16.17 -                                name);
   16.18 -                } else {
   16.19 -                    log.warning("annotation.method.not.found.reason",
   16.20 -                                container,
   16.21 -                                name,
   16.22 -                                failure.getDetailValue());//diagnostic, if present
   16.23 +                if (lintClassfile) {
   16.24 +                    if (failure == null) {
   16.25 +                        log.warning("annotation.method.not.found",
   16.26 +                                    container,
   16.27 +                                    name);
   16.28 +                    } else {
   16.29 +                        log.warning("annotation.method.not.found.reason",
   16.30 +                                    container,
   16.31 +                                    name,
   16.32 +                                    failure.getDetailValue()); //diagnostic, if present
   16.33 +                    }
   16.34                  }
   16.35              } finally {
   16.36                  log.useSource(prevSource);
    17.1 --- a/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java	Thu May 07 18:15:48 2015 -0700
    17.2 +++ b/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java	Thu Jun 04 15:32:38 2015 -0700
    17.3 @@ -1,5 +1,5 @@
    17.4  /*
    17.5 - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
    17.6 + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
    17.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    17.8   *
    17.9   * This code is free software; you can redistribute it and/or modify it
   17.10 @@ -1027,6 +1027,7 @@
   17.11               l.nonEmpty();
   17.12               l = l.tail) {
   17.13              ClassSymbol inner = l.head;
   17.14 +            inner.markAbstractIfNeeded(types);
   17.15              char flags = (char) adjustFlags(inner.flags_field);
   17.16              if ((flags & INTERFACE) != 0) flags |= ABSTRACT; // Interfaces are always ABSTRACT
   17.17              if (inner.name.isEmpty()) flags &= ~FINAL; // Anonymous class: unset FINAL flag
   17.18 @@ -1186,7 +1187,7 @@
   17.19                      Assert.check(r.start_pc >= 0
   17.20                              && r.start_pc <= code.cp);
   17.21                      databuf.appendChar(r.start_pc);
   17.22 -                    Assert.check(r.length >= 0
   17.23 +                    Assert.check(r.length > 0
   17.24                              && (r.start_pc + r.length) <= code.cp);
   17.25                      databuf.appendChar(r.length);
   17.26                      VarSymbol sym = var.sym;
    18.1 --- a/src/share/classes/com/sun/tools/javac/jvm/Code.java	Thu May 07 18:15:48 2015 -0700
    18.2 +++ b/src/share/classes/com/sun/tools/javac/jvm/Code.java	Thu Jun 04 15:32:38 2015 -0700
    18.3 @@ -1,5 +1,5 @@
    18.4  /*
    18.5 - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
    18.6 + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
    18.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    18.8   *
    18.9   * This code is free software; you can redistribute it and/or modify it
   18.10 @@ -182,8 +182,6 @@
   18.11  
   18.12      final MethodSymbol meth;
   18.13  
   18.14 -    final LVTRanges lvtRanges;
   18.15 -
   18.16      /** Construct a code object, given the settings of the fatcode,
   18.17       *  debugging info switches and the CharacterRangeTable.
   18.18       */
   18.19 @@ -196,8 +194,7 @@
   18.20                  CRTable crt,
   18.21                  Symtab syms,
   18.22                  Types types,
   18.23 -                Pool pool,
   18.24 -                LVTRanges lvtRanges) {
   18.25 +                Pool pool) {
   18.26          this.meth = meth;
   18.27          this.fatcode = fatcode;
   18.28          this.lineMap = lineMap;
   18.29 @@ -219,7 +216,6 @@
   18.30          state = new State();
   18.31          lvar = new LocalVar[20];
   18.32          this.pool = pool;
   18.33 -        this.lvtRanges = lvtRanges;
   18.34      }
   18.35  
   18.36  
   18.37 @@ -1193,7 +1189,9 @@
   18.38      public int entryPoint(State state) {
   18.39          int pc = curCP();
   18.40          alive = true;
   18.41 -        this.state = state.dup();
   18.42 +        State newState = state.dup();
   18.43 +        setDefined(newState.defined);
   18.44 +        this.state = newState;
   18.45          Assert.check(state.stacksize <= max_stack);
   18.46          if (debugCode) System.err.println("entry point " + state);
   18.47          pendingStackMap = needStackMap;
   18.48 @@ -1206,7 +1204,9 @@
   18.49      public int entryPoint(State state, Type pushed) {
   18.50          int pc = curCP();
   18.51          alive = true;
   18.52 -        this.state = state.dup();
   18.53 +        State newState = state.dup();
   18.54 +        setDefined(newState.defined);
   18.55 +        this.state = newState;
   18.56          Assert.check(state.stacksize <= max_stack);
   18.57          this.state.push(pushed);
   18.58          if (debugCode) System.err.println("entry point " + state);
   18.59 @@ -2008,27 +2008,6 @@
   18.60          state.defined.excl(adr);
   18.61      }
   18.62  
   18.63 -
   18.64 -    public void closeAliveRanges(JCTree tree) {
   18.65 -        closeAliveRanges(tree, cp);
   18.66 -    }
   18.67 -
   18.68 -    public void closeAliveRanges(JCTree tree, int closingCP) {
   18.69 -        List<VarSymbol> locals = lvtRanges.getVars(meth, tree);
   18.70 -        for (LocalVar localVar: lvar) {
   18.71 -            for (VarSymbol aliveLocal : locals) {
   18.72 -                if (localVar != null) {
   18.73 -                    if (localVar.sym == aliveLocal && localVar.lastRange() != null) {
   18.74 -                        char length = (char)(closingCP - localVar.lastRange().start_pc);
   18.75 -                        if (length < Character.MAX_VALUE) {
   18.76 -                            localVar.closeRange(length);
   18.77 -                        }
   18.78 -                    }
   18.79 -                }
   18.80 -            }
   18.81 -        }
   18.82 -    }
   18.83 -
   18.84      void adjustAliveRanges(int oldCP, int delta) {
   18.85          for (LocalVar localVar: lvar) {
   18.86              if (localVar != null) {
   18.87 @@ -2193,7 +2172,11 @@
   18.88          boolean keepLocalVariables = varDebugInfo ||
   18.89              (var.sym.isExceptionParameter() && var.sym.hasTypeAnnotations());
   18.90          if (!keepLocalVariables) return;
   18.91 -        if ((var.sym.flags() & Flags.SYNTHETIC) != 0) return;
   18.92 +        //don't keep synthetic vars, unless they are lambda method parameters
   18.93 +        boolean ignoredSyntheticVar = (var.sym.flags() & Flags.SYNTHETIC) != 0 &&
   18.94 +                ((var.sym.owner.flags() & Flags.LAMBDA_METHOD) == 0 ||
   18.95 +                 (var.sym.flags() & Flags.PARAMETER) == 0);
   18.96 +        if (ignoredSyntheticVar) return;
   18.97          if (varBuffer == null)
   18.98              varBuffer = new LocalVar[20];
   18.99          else
    19.1 --- a/src/share/classes/com/sun/tools/javac/jvm/Gen.java	Thu May 07 18:15:48 2015 -0700
    19.2 +++ b/src/share/classes/com/sun/tools/javac/jvm/Gen.java	Thu Jun 04 15:32:38 2015 -0700
    19.3 @@ -1,5 +1,5 @@
    19.4  /*
    19.5 - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
    19.6 + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
    19.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    19.8   *
    19.9   * This code is free software; you can redistribute it and/or modify it
   19.10 @@ -101,10 +101,6 @@
   19.11       */
   19.12      private Pool pool;
   19.13  
   19.14 -    /** LVTRanges info.
   19.15 -     */
   19.16 -    private LVTRanges lvtRanges;
   19.17 -
   19.18      private final boolean typeAnnoAsserts;
   19.19  
   19.20      protected Gen(Context context) {
   19.21 @@ -137,9 +133,6 @@
   19.22              options.isUnset(G_CUSTOM)
   19.23              ? options.isSet(G)
   19.24              : options.isSet(G_CUSTOM, "vars");
   19.25 -        if (varDebugInfo) {
   19.26 -            lvtRanges = LVTRanges.instance(context);
   19.27 -        }
   19.28          genCrt = options.isSet(XJCOV);
   19.29          debugCode = options.isSet("debugcode");
   19.30          allowInvokedynamic = target.hasInvokedynamic() || options.isSet("invokedynamic");
   19.31 @@ -493,7 +486,7 @@
   19.32                  JCBlock block = (JCBlock)def;
   19.33                  if ((block.flags & STATIC) != 0)
   19.34                      clinitCode.append(block);
   19.35 -                else
   19.36 +                else if ((block.flags & SYNTHETIC) == 0)
   19.37                      initCode.append(block);
   19.38                  break;
   19.39              case METHODDEF:
   19.40 @@ -1103,8 +1096,7 @@
   19.41                                                 : null,
   19.42                                          syms,
   19.43                                          types,
   19.44 -                                        pool,
   19.45 -                                        varDebugInfo ? lvtRanges : null);
   19.46 +                                        pool);
   19.47              items = new Items(pool, code, syms, types);
   19.48              if (code.debugCode) {
   19.49                  System.err.println(meth + " for body " + tree);
   19.50 @@ -1207,30 +1199,14 @@
   19.51                  Chain loopDone = c.jumpFalse();
   19.52                  code.resolve(c.trueJumps);
   19.53                  genStat(body, loopEnv, CRT_STATEMENT | CRT_FLOW_TARGET);
   19.54 -                if (varDebugInfo) {
   19.55 -                    checkLoopLocalVarRangeEnding(loop, body,
   19.56 -                            LoopLocalVarRangeEndingPoint.BEFORE_STEPS);
   19.57 -                }
   19.58                  code.resolve(loopEnv.info.cont);
   19.59                  genStats(step, loopEnv);
   19.60 -                if (varDebugInfo) {
   19.61 -                    checkLoopLocalVarRangeEnding(loop, body,
   19.62 -                            LoopLocalVarRangeEndingPoint.AFTER_STEPS);
   19.63 -                }
   19.64                  code.resolve(code.branch(goto_), startpc);
   19.65                  code.resolve(loopDone);
   19.66              } else {
   19.67                  genStat(body, loopEnv, CRT_STATEMENT | CRT_FLOW_TARGET);
   19.68 -                if (varDebugInfo) {
   19.69 -                    checkLoopLocalVarRangeEnding(loop, body,
   19.70 -                            LoopLocalVarRangeEndingPoint.BEFORE_STEPS);
   19.71 -                }
   19.72                  code.resolve(loopEnv.info.cont);
   19.73                  genStats(step, loopEnv);
   19.74 -                if (varDebugInfo) {
   19.75 -                    checkLoopLocalVarRangeEnding(loop, body,
   19.76 -                            LoopLocalVarRangeEndingPoint.AFTER_STEPS);
   19.77 -                }
   19.78                  CondItem c;
   19.79                  if (cond != null) {
   19.80                      code.statBegin(cond.pos);
   19.81 @@ -1247,44 +1223,6 @@
   19.82              }
   19.83          }
   19.84  
   19.85 -        private enum LoopLocalVarRangeEndingPoint {
   19.86 -            BEFORE_STEPS,
   19.87 -            AFTER_STEPS,
   19.88 -        }
   19.89 -
   19.90 -        /**
   19.91 -         *  Checks whether we have reached an alive range ending point for local
   19.92 -         *  variables after a loop.
   19.93 -         *
   19.94 -         *  Local variables alive range ending point for loops varies depending
   19.95 -         *  on the loop type. The range can be closed before or after the code
   19.96 -         *  for the steps sentences has been generated.
   19.97 -         *
   19.98 -         *  - While loops has no steps so in that case the range is closed just
   19.99 -         *  after the body of the loop.
  19.100 -         *
  19.101 -         *  - For-like loops may have steps so as long as the steps sentences
  19.102 -         *  can possibly contain non-synthetic local variables, the alive range
  19.103 -         *  for local variables must be closed after the steps in this case.
  19.104 -        */
  19.105 -        private void checkLoopLocalVarRangeEnding(JCTree loop, JCTree body,
  19.106 -                LoopLocalVarRangeEndingPoint endingPoint) {
  19.107 -            if (varDebugInfo && lvtRanges.containsKey(code.meth, body)) {
  19.108 -                switch (endingPoint) {
  19.109 -                    case BEFORE_STEPS:
  19.110 -                        if (!loop.hasTag(FORLOOP)) {
  19.111 -                            code.closeAliveRanges(body);
  19.112 -                        }
  19.113 -                        break;
  19.114 -                    case AFTER_STEPS:
  19.115 -                        if (loop.hasTag(FORLOOP)) {
  19.116 -                            code.closeAliveRanges(body);
  19.117 -                        }
  19.118 -                        break;
  19.119 -                }
  19.120 -            }
  19.121 -        }
  19.122 -
  19.123      public void visitForeachLoop(JCEnhancedForLoop tree) {
  19.124          throw new AssertionError(); // should have been removed by Lower.
  19.125      }
  19.126 @@ -1398,9 +1336,6 @@
  19.127  
  19.128                  // Generate code for the statements in this case.
  19.129                  genStats(c.stats, switchEnv, CRT_FLOW_TARGET);
  19.130 -                if (varDebugInfo && lvtRanges.containsKey(code.meth, c.stats.last())) {
  19.131 -                    code.closeAliveRanges(c.stats.last());
  19.132 -                }
  19.133              }
  19.134  
  19.135              // Resolve all breaks.
  19.136 @@ -1557,9 +1492,6 @@
  19.137              genFinalizer(env);
  19.138              code.statBegin(TreeInfo.endPos(env.tree));
  19.139              Chain exitChain = code.branch(goto_);
  19.140 -            if (varDebugInfo && lvtRanges.containsKey(code.meth, body)) {
  19.141 -                code.closeAliveRanges(body);
  19.142 -            }
  19.143              endFinalizerGap(env);
  19.144              if (startpc != endpc) for (List<JCCatch> l = catchers; l.nonEmpty(); l = l.tail) {
  19.145                  // start off with exception on stack
  19.146 @@ -1815,17 +1747,11 @@
  19.147              code.resolve(c.trueJumps);
  19.148              genStat(tree.thenpart, env, CRT_STATEMENT | CRT_FLOW_TARGET);
  19.149              thenExit = code.branch(goto_);
  19.150 -            if (varDebugInfo && lvtRanges.containsKey(code.meth, tree.thenpart)) {
  19.151 -                code.closeAliveRanges(tree.thenpart, code.cp);
  19.152 -            }
  19.153          }
  19.154          if (elseChain != null) {
  19.155              code.resolve(elseChain);
  19.156              if (tree.elsepart != null) {
  19.157                  genStat(tree.elsepart, env,CRT_STATEMENT | CRT_FLOW_TARGET);
  19.158 -                if (varDebugInfo && lvtRanges.containsKey(code.meth, tree.elsepart)) {
  19.159 -                    code.closeAliveRanges(tree.elsepart);
  19.160 -                }
  19.161              }
  19.162          }
  19.163          code.resolve(thenExit);
  19.164 @@ -2514,16 +2440,6 @@
  19.165              localEnv.toplevel = env.toplevel;
  19.166              localEnv.enclClass = cdef;
  19.167  
  19.168 -            /*  We must not analyze synthetic methods
  19.169 -             */
  19.170 -            if (varDebugInfo && (cdef.sym.flags() & SYNTHETIC) == 0) {
  19.171 -                try {
  19.172 -                    new LVTAssignAnalyzer().analyzeTree(localEnv);
  19.173 -                } catch (Throwable e) {
  19.174 -                    throw e;
  19.175 -                }
  19.176 -            }
  19.177 -
  19.178              for (List<JCTree> l = cdef.defs; l.nonEmpty(); l = l.tail) {
  19.179                  genDef(l.head, localEnv);
  19.180              }
  19.181 @@ -2609,282 +2525,4 @@
  19.182          }
  19.183      }
  19.184  
  19.185 -    class LVTAssignAnalyzer
  19.186 -        extends Flow.AbstractAssignAnalyzer<LVTAssignAnalyzer.LVTAssignPendingExit> {
  19.187 -
  19.188 -        final LVTBits lvtInits;
  19.189 -
  19.190 -        /*  This class is anchored to a context dependent tree. The tree can
  19.191 -         *  vary inside the same instruction for example in the switch instruction
  19.192 -         *  the same FlowBits instance can be anchored to the whole tree, or
  19.193 -         *  to a given case. The aim is to always anchor the bits to the tree
  19.194 -         *  capable of closing a DA range.
  19.195 -         */
  19.196 -        class LVTBits extends Bits {
  19.197 -
  19.198 -            JCTree currentTree;
  19.199 -            private int[] oldBits = null;
  19.200 -            BitsState stateBeforeOp;
  19.201 -
  19.202 -            @Override
  19.203 -            public void clear() {
  19.204 -                generalOp(null, -1, BitsOpKind.CLEAR);
  19.205 -            }
  19.206 -
  19.207 -            @Override
  19.208 -            protected void internalReset() {
  19.209 -                super.internalReset();
  19.210 -                oldBits = null;
  19.211 -            }
  19.212 -
  19.213 -            @Override
  19.214 -            public Bits assign(Bits someBits) {
  19.215 -                // bits can be null
  19.216 -                oldBits = bits;
  19.217 -                stateBeforeOp = currentState;
  19.218 -                super.assign(someBits);
  19.219 -                changed();
  19.220 -                return this;
  19.221 -            }
  19.222 -
  19.223 -            @Override
  19.224 -            public void excludeFrom(int start) {
  19.225 -                generalOp(null, start, BitsOpKind.EXCL_RANGE);
  19.226 -            }
  19.227 -
  19.228 -            @Override
  19.229 -            public void excl(int x) {
  19.230 -                Assert.check(x >= 0);
  19.231 -                generalOp(null, x, BitsOpKind.EXCL_BIT);
  19.232 -            }
  19.233 -
  19.234 -            @Override
  19.235 -            public Bits andSet(Bits xs) {
  19.236 -               return generalOp(xs, -1, BitsOpKind.AND_SET);
  19.237 -            }
  19.238 -
  19.239 -            @Override
  19.240 -            public Bits orSet(Bits xs) {
  19.241 -                return generalOp(xs, -1, BitsOpKind.OR_SET);
  19.242 -            }
  19.243 -
  19.244 -            @Override
  19.245 -            public Bits diffSet(Bits xs) {
  19.246 -                return generalOp(xs, -1, BitsOpKind.DIFF_SET);
  19.247 -            }
  19.248 -
  19.249 -            @Override
  19.250 -            public Bits xorSet(Bits xs) {
  19.251 -                return generalOp(xs, -1, BitsOpKind.XOR_SET);
  19.252 -            }
  19.253 -
  19.254 -            private Bits generalOp(Bits xs, int i, BitsOpKind opKind) {
  19.255 -                Assert.check(currentState != BitsState.UNKNOWN);
  19.256 -                oldBits = dupBits();
  19.257 -                stateBeforeOp = currentState;
  19.258 -                switch (opKind) {
  19.259 -                    case AND_SET:
  19.260 -                        super.andSet(xs);
  19.261 -                        break;
  19.262 -                    case OR_SET:
  19.263 -                        super.orSet(xs);
  19.264 -                        break;
  19.265 -                    case XOR_SET:
  19.266 -                        super.xorSet(xs);
  19.267 -                        break;
  19.268 -                    case DIFF_SET:
  19.269 -                        super.diffSet(xs);
  19.270 -                        break;
  19.271 -                    case CLEAR:
  19.272 -                        super.clear();
  19.273 -                        break;
  19.274 -                    case EXCL_BIT:
  19.275 -                        super.excl(i);
  19.276 -                        break;
  19.277 -                    case EXCL_RANGE:
  19.278 -                        super.excludeFrom(i);
  19.279 -                        break;
  19.280 -                }
  19.281 -                changed();
  19.282 -                return this;
  19.283 -            }
  19.284 -
  19.285 -            /*  The tree we need to anchor the bits instance to.
  19.286 -             */
  19.287 -            LVTBits at(JCTree tree) {
  19.288 -                this.currentTree = tree;
  19.289 -                return this;
  19.290 -            }
  19.291 -
  19.292 -            /*  If the instance should be changed but the tree is not a closing
  19.293 -             *  tree then a reset is needed or the former tree can mistakingly be
  19.294 -             *  used.
  19.295 -             */
  19.296 -            LVTBits resetTree() {
  19.297 -                this.currentTree = null;
  19.298 -                return this;
  19.299 -            }
  19.300 -
  19.301 -            /** This method will be called after any operation that causes a change to
  19.302 -             *  the bits. Subclasses can thus override it in order to extract information
  19.303 -             *  from the changes produced to the bits by the given operation.
  19.304 -             */
  19.305 -            public void changed() {
  19.306 -                if (currentTree != null &&
  19.307 -                        stateBeforeOp != BitsState.UNKNOWN &&
  19.308 -                        trackTree(currentTree)) {
  19.309 -                    List<VarSymbol> locals = lvtRanges
  19.310 -                            .getVars(currentMethod, currentTree);
  19.311 -                    locals = locals != null ?
  19.312 -                            locals : List.<VarSymbol>nil();
  19.313 -                    for (JCVariableDecl vardecl : vardecls) {
  19.314 -                        //once the first is null, the rest will be so.
  19.315 -                        if (vardecl == null) {
  19.316 -                            break;
  19.317 -                        }
  19.318 -                        if (trackVar(vardecl.sym) && bitChanged(vardecl.sym.adr)) {
  19.319 -                            locals = locals.prepend(vardecl.sym);
  19.320 -                        }
  19.321 -                    }
  19.322 -                    if (!locals.isEmpty()) {
  19.323 -                        lvtRanges.setEntry(currentMethod,
  19.324 -                                currentTree, locals);
  19.325 -                    }
  19.326 -                }
  19.327 -            }
  19.328 -
  19.329 -            boolean bitChanged(int x) {
  19.330 -                boolean isMemberOfBits = isMember(x);
  19.331 -                int[] tmp = bits;
  19.332 -                bits = oldBits;
  19.333 -                boolean isMemberOfOldBits = isMember(x);
  19.334 -                bits = tmp;
  19.335 -                return (!isMemberOfBits && isMemberOfOldBits);
  19.336 -            }
  19.337 -
  19.338 -            boolean trackVar(VarSymbol var) {
  19.339 -                return (var.owner.kind == MTH &&
  19.340 -                        (var.flags() & PARAMETER) == 0 &&
  19.341 -                        trackable(var));
  19.342 -            }
  19.343 -
  19.344 -            boolean trackTree(JCTree tree) {
  19.345 -                switch (tree.getTag()) {
  19.346 -                    // of course a method closes the alive range of a local variable.
  19.347 -                    case METHODDEF:
  19.348 -                    // for while loops we want only the body
  19.349 -                    case WHILELOOP:
  19.350 -                        return false;
  19.351 -                }
  19.352 -                return true;
  19.353 -            }
  19.354 -
  19.355 -        }
  19.356 -
  19.357 -        public class LVTAssignPendingExit extends
  19.358 -                                    Flow.AbstractAssignAnalyzer<LVTAssignPendingExit>.AbstractAssignPendingExit {
  19.359 -
  19.360 -            LVTAssignPendingExit(JCTree tree, final Bits inits, final Bits uninits) {
  19.361 -                super(tree, inits, uninits);
  19.362 -            }
  19.363 -
  19.364 -            @Override
  19.365 -            public void resolveJump(JCTree tree) {
  19.366 -                lvtInits.at(tree);
  19.367 -                super.resolveJump(tree);
  19.368 -            }
  19.369 -        }
  19.370 -
  19.371 -        private LVTAssignAnalyzer() {
  19.372 -            flow.super();
  19.373 -            lvtInits = new LVTBits();
  19.374 -            inits = lvtInits;
  19.375 -        }
  19.376 -
  19.377 -        @Override
  19.378 -        protected void markDead(JCTree tree) {
  19.379 -            lvtInits.at(tree).inclRange(returnadr, nextadr);
  19.380 -            super.markDead(tree);
  19.381 -        }
  19.382 -
  19.383 -        @Override
  19.384 -        protected void merge(JCTree tree) {
  19.385 -            lvtInits.at(tree);
  19.386 -            super.merge(tree);
  19.387 -        }
  19.388 -
  19.389 -        boolean isSyntheticOrMandated(Symbol sym) {
  19.390 -            return (sym.flags() & (SYNTHETIC | MANDATED)) != 0;
  19.391 -        }
  19.392 -
  19.393 -        @Override
  19.394 -        protected boolean trackable(VarSymbol sym) {
  19.395 -            if (isSyntheticOrMandated(sym)) {
  19.396 -                //fast check to avoid tracking synthetic or mandated variables
  19.397 -                return false;
  19.398 -            }
  19.399 -            return super.trackable(sym);
  19.400 -        }
  19.401 -
  19.402 -        @Override
  19.403 -        protected void initParam(JCVariableDecl def) {
  19.404 -            if (!isSyntheticOrMandated(def.sym)) {
  19.405 -                super.initParam(def);
  19.406 -            }
  19.407 -        }
  19.408 -
  19.409 -        @Override
  19.410 -        protected void assignToInits(JCTree tree, Bits bits) {
  19.411 -            lvtInits.at(tree);
  19.412 -            lvtInits.assign(bits);
  19.413 -        }
  19.414 -
  19.415 -        @Override
  19.416 -        protected void andSetInits(JCTree tree, Bits bits) {
  19.417 -            lvtInits.at(tree);
  19.418 -            lvtInits.andSet(bits);
  19.419 -        }
  19.420 -
  19.421 -        @Override
  19.422 -        protected void orSetInits(JCTree tree, Bits bits) {
  19.423 -            lvtInits.at(tree);
  19.424 -            lvtInits.orSet(bits);
  19.425 -        }
  19.426 -
  19.427 -        @Override
  19.428 -        protected void exclVarFromInits(JCTree tree, int adr) {
  19.429 -            lvtInits.at(tree);
  19.430 -            lvtInits.excl(adr);
  19.431 -        }
  19.432 -
  19.433 -        @Override
  19.434 -        protected LVTAssignPendingExit createNewPendingExit(JCTree tree, Bits inits, Bits uninits) {
  19.435 -            return new LVTAssignPendingExit(tree, inits, uninits);
  19.436 -        }
  19.437 -
  19.438 -        MethodSymbol currentMethod;
  19.439 -
  19.440 -        @Override
  19.441 -        public void visitMethodDef(JCMethodDecl tree) {
  19.442 -            if ((tree.sym.flags() & (SYNTHETIC | GENERATEDCONSTR)) != 0
  19.443 -                    && (tree.sym.flags() & LAMBDA_METHOD) == 0) {
  19.444 -                return;
  19.445 -            }
  19.446 -            if (tree.name.equals(names.clinit)) {
  19.447 -                return;
  19.448 -            }
  19.449 -            boolean enumClass = (tree.sym.owner.flags() & ENUM) != 0;
  19.450 -            if (enumClass &&
  19.451 -                    (tree.name.equals(names.valueOf) ||
  19.452 -                    tree.name.equals(names.values) ||
  19.453 -                    tree.name.equals(names.init))) {
  19.454 -                return;
  19.455 -            }
  19.456 -            currentMethod = tree.sym;
  19.457 -
  19.458 -            super.visitMethodDef(tree);
  19.459 -        }
  19.460 -
  19.461 -    }
  19.462 -
  19.463  }
    20.1 --- a/src/share/classes/com/sun/tools/javac/jvm/LVTRanges.java	Thu May 07 18:15:48 2015 -0700
    20.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.3 @@ -1,129 +0,0 @@
    20.4 -/*
    20.5 - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
    20.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    20.7 - *
    20.8 - * This code is free software; you can redistribute it and/or modify it
    20.9 - * under the terms of the GNU General Public License version 2 only, as
   20.10 - * published by the Free Software Foundation.  Oracle designates this
   20.11 - * particular file as subject to the "Classpath" exception as provided
   20.12 - * by Oracle in the LICENSE file that accompanied this code.
   20.13 - *
   20.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
   20.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   20.16 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   20.17 - * version 2 for more details (a copy is included in the LICENSE file that
   20.18 - * accompanied this code).
   20.19 - *
   20.20 - * You should have received a copy of the GNU General Public License version
   20.21 - * 2 along with this work; if not, write to the Free Software Foundation,
   20.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   20.23 - *
   20.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   20.25 - * or visit www.oracle.com if you need additional information or have any
   20.26 - * questions.
   20.27 - */
   20.28 -
   20.29 -package com.sun.tools.javac.jvm;
   20.30 -
   20.31 -import java.util.Map;
   20.32 -import java.util.Map.Entry;
   20.33 -import java.util.WeakHashMap;
   20.34 -
   20.35 -import com.sun.tools.javac.code.Symbol.MethodSymbol;
   20.36 -import com.sun.tools.javac.code.Symbol.VarSymbol;
   20.37 -import com.sun.tools.javac.tree.JCTree;
   20.38 -import com.sun.tools.javac.util.Context;
   20.39 -import com.sun.tools.javac.util.List;
   20.40 -
   20.41 -/** This class contains a one to many relation between a tree and a set of variables.
   20.42 - *  The relation implies that the given tree closes the DA (definite assignment)
   20.43 - *  range for the set of variables.
   20.44 - *
   20.45 - *  <p><b>This is NOT part of any supported API.
   20.46 - *  If you write code that depends on this, you do so at your own risk.
   20.47 - *  This code and its internal interfaces are subject to change or
   20.48 - *  deletion without notice.</b>
   20.49 - */
   20.50 -public class LVTRanges {
   20.51 -    /** The context key for the LVT ranges. */
   20.52 -    protected static final Context.Key<LVTRanges> lvtRangesKey = new Context.Key<>();
   20.53 -
   20.54 -    /** Get the LVTRanges instance for this context. */
   20.55 -    public static LVTRanges instance(Context context) {
   20.56 -        LVTRanges instance = context.get(lvtRangesKey);
   20.57 -        if (instance == null) {
   20.58 -            instance = new LVTRanges(context);
   20.59 -        }
   20.60 -        return instance;
   20.61 -    }
   20.62 -
   20.63 -    private static final long serialVersionUID = 1812267524140424433L;
   20.64 -
   20.65 -    protected Context context;
   20.66 -
   20.67 -    protected Map<MethodSymbol, Map<JCTree, List<VarSymbol>>>
   20.68 -            aliveRangeClosingTrees = new WeakHashMap<>();
   20.69 -
   20.70 -    public LVTRanges(Context context) {
   20.71 -        this.context = context;
   20.72 -        context.put(lvtRangesKey, this);
   20.73 -    }
   20.74 -
   20.75 -    public List<VarSymbol> getVars(MethodSymbol method, JCTree tree) {
   20.76 -        Map<JCTree, List<VarSymbol>> varMap = aliveRangeClosingTrees.get(method);
   20.77 -        return (varMap != null) ? varMap.get(tree) : null;
   20.78 -    }
   20.79 -
   20.80 -    public boolean containsKey(MethodSymbol method, JCTree tree) {
   20.81 -        Map<JCTree, List<VarSymbol>> varMap = aliveRangeClosingTrees.get(method);
   20.82 -        if (varMap == null) {
   20.83 -            return false;
   20.84 -        }
   20.85 -        return varMap.containsKey(tree);
   20.86 -    }
   20.87 -
   20.88 -    public void setEntry(MethodSymbol method, JCTree tree, List<VarSymbol> vars) {
   20.89 -        Map<JCTree, List<VarSymbol>> varMap = aliveRangeClosingTrees.get(method);
   20.90 -        if (varMap != null) {
   20.91 -            varMap.put(tree, vars);
   20.92 -        } else {
   20.93 -            varMap = new WeakHashMap<>();
   20.94 -            varMap.put(tree, vars);
   20.95 -            aliveRangeClosingTrees.put(method, varMap);
   20.96 -        }
   20.97 -    }
   20.98 -
   20.99 -    public List<VarSymbol> removeEntry(MethodSymbol method, JCTree tree) {
  20.100 -        Map<JCTree, List<VarSymbol>> varMap = aliveRangeClosingTrees.get(method);
  20.101 -        if (varMap != null) {
  20.102 -            List<VarSymbol> result = varMap.remove(tree);
  20.103 -            if (varMap.isEmpty()) {
  20.104 -                aliveRangeClosingTrees.remove(method);
  20.105 -            }
  20.106 -            return result;
  20.107 -        }
  20.108 -        return null;
  20.109 -    }
  20.110 -
  20.111 -    /* This method should be used for debugging LVT related issues.
  20.112 -     */
  20.113 -    @Override
  20.114 -    public String toString() {
  20.115 -        String result = "";
  20.116 -        for (Entry<MethodSymbol, Map<JCTree, List<VarSymbol>>> mainEntry: aliveRangeClosingTrees.entrySet()) {
  20.117 -            result += "Method: \n" + mainEntry.getKey().flatName() + "\n";
  20.118 -            int i = 1;
  20.119 -            for (Entry<JCTree, List<VarSymbol>> treeEntry: mainEntry.getValue().entrySet()) {
  20.120 -                result += "    Tree " + i + ": \n" + treeEntry.getKey().toString() + "\n";
  20.121 -                result += "        Variables closed:\n";
  20.122 -                for (VarSymbol var: treeEntry.getValue()) {
  20.123 -                    result += "            " + var.toString();
  20.124 -                }
  20.125 -                result += "\n";
  20.126 -                i++;
  20.127 -            }
  20.128 -        }
  20.129 -        return result;
  20.130 -    }
  20.131 -
  20.132 -}
    21.1 --- a/src/share/classes/com/sun/tools/javac/parser/JavacParser.java	Thu May 07 18:15:48 2015 -0700
    21.2 +++ b/src/share/classes/com/sun/tools/javac/parser/JavacParser.java	Thu Jun 04 15:32:38 2015 -0700
    21.3 @@ -2720,7 +2720,7 @@
    21.4          } else {
    21.5              JCExpression t = term(EXPR | TYPE);
    21.6              if ((lastmode & TYPE) != 0 && LAX_IDENTIFIER.accepts(token.kind)) {
    21.7 -                return variableDeclarators(modifiersOpt(), t, stats).toList();
    21.8 +                return variableDeclarators(mods(pos, 0, List.<JCAnnotation>nil()), t, stats).toList();
    21.9              } else if ((lastmode & TYPE) != 0 && token.kind == COLON) {
   21.10                  error(pos, "bad.initializer", "for-loop");
   21.11                  return List.of((JCStatement)F.at(pos).VarDef(null, null, t, null));
   21.12 @@ -2829,16 +2829,20 @@
   21.13          default: break;
   21.14          }
   21.15  
   21.16 -        /* A modifiers tree with no modifier tokens or annotations
   21.17 -         * has no text position. */
   21.18 -        if ((flags & (Flags.ModifierFlags | Flags.ANNOTATION)) == 0 && annotations.isEmpty())
   21.19 -            pos = Position.NOPOS;
   21.20 -
   21.21 -        JCModifiers mods = F.at(pos).Modifiers(flags, annotations.toList());
   21.22 -        if (pos != Position.NOPOS)
   21.23 -            storeEnd(mods, S.prevToken().endPos);
   21.24 -        return mods;
   21.25 +        return mods(pos, flags, annotations.toList());
   21.26      }
   21.27 +    //where
   21.28 +        JCModifiers mods(int pos, long flags, List<JCAnnotation> annotations) {
   21.29 +            /* A modifiers tree with no modifier tokens or annotations
   21.30 +             * has no text position. */
   21.31 +            if ((flags & (Flags.ModifierFlags | Flags.ANNOTATION)) == 0 && annotations.isEmpty())
   21.32 +                pos = Position.NOPOS;
   21.33 +
   21.34 +            JCModifiers mods = F.at(pos).Modifiers(flags, annotations);
   21.35 +            if (pos != Position.NOPOS)
   21.36 +                storeEnd(mods, S.prevToken().endPos);
   21.37 +            return mods;
   21.38 +        }
   21.39  
   21.40      /** Annotation              = "@" Qualident [ "(" AnnotationFieldValues ")" ]
   21.41       *
    22.1 --- a/src/share/classes/com/sun/tools/javac/resources/javac.properties	Thu May 07 18:15:48 2015 -0700
    22.2 +++ b/src/share/classes/com/sun/tools/javac/resources/javac.properties	Thu Jun 04 15:32:38 2015 -0700
    22.3 @@ -232,8 +232,8 @@
    22.4  
    22.5  javac.msg.bug=\
    22.6  An exception has occurred in the compiler ({0}). \
    22.7 -Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport)  \
    22.8 -after checking the Bug Parade for duplicates. \
    22.9 +Please file a bug at the Java Bug Database (http://bugreport.java.com/bugreport/) \
   22.10 +after checking the database for duplicates. \
   22.11  Include your program and the following diagnostic in your report.  Thank you.
   22.12  
   22.13  javac.msg.io=\
    23.1 --- a/src/share/classes/com/sun/tools/jdeps/Analyzer.java	Thu May 07 18:15:48 2015 -0700
    23.2 +++ b/src/share/classes/com/sun/tools/jdeps/Analyzer.java	Thu Jun 04 15:32:38 2015 -0700
    23.3 @@ -223,7 +223,7 @@
    23.4              Archive targetArchive = findArchive(t);
    23.5              if (filter.accepts(o, archive, t, targetArchive)) {
    23.6                  addDep(o, t);
    23.7 -                if (!requires.contains(targetArchive)) {
    23.8 +                if (archive != targetArchive && !requires.contains(targetArchive)) {
    23.9                      requires.add(targetArchive);
   23.10                  }
   23.11              }
    24.1 --- a/src/share/classes/com/sun/tools/jdeps/JdepsTask.java	Thu May 07 18:15:48 2015 -0700
    24.2 +++ b/src/share/classes/com/sun/tools/jdeps/JdepsTask.java	Thu Jun 04 15:32:38 2015 -0700
    24.3 @@ -489,9 +489,11 @@
    24.4  
    24.5          List<Archive> archives = new ArrayList<>();
    24.6          Deque<String> roots = new LinkedList<>();
    24.7 +        List<Path> paths = new ArrayList<>();
    24.8          for (String s : classes) {
    24.9              Path p = Paths.get(s);
   24.10              if (Files.exists(p)) {
   24.11 +                paths.add(p);
   24.12                  archives.add(Archive.getInstance(p));
   24.13              } else {
   24.14                  if (isValidClassName(s)) {
   24.15 @@ -504,7 +506,7 @@
   24.16          sourceLocations.addAll(archives);
   24.17  
   24.18          List<Archive> classpaths = new ArrayList<>(); // for class file lookup
   24.19 -        classpaths.addAll(getClassPathArchives(options.classpath));
   24.20 +        classpaths.addAll(getClassPathArchives(options.classpath, paths));
   24.21          if (options.includePattern != null) {
   24.22              archives.addAll(classpaths);
   24.23          }
   24.24 @@ -545,6 +547,9 @@
   24.25                              deque.add(cn);
   24.26                          }
   24.27                          a.addClass(d.getOrigin(), d.getTarget());
   24.28 +                    } else {
   24.29 +                        // ensure that the parsed class is added the archive
   24.30 +                        a.addClass(d.getOrigin());
   24.31                      }
   24.32                  }
   24.33                  for (String name : a.reader().skippedEntries()) {
   24.34 @@ -592,6 +597,9 @@
   24.35                                      if (!doneClasses.contains(cn) && !deque.contains(cn)) {
   24.36                                          deque.add(cn);
   24.37                                      }
   24.38 +                                } else {
   24.39 +                                    // ensure that the parsed class is added the archive
   24.40 +                                    a.addClass(d.getOrigin());
   24.41                                  }
   24.42                              }
   24.43                          }
   24.44 @@ -743,36 +751,52 @@
   24.45          }
   24.46      }
   24.47  
   24.48 -    private List<Archive> getClassPathArchives(String paths) throws IOException {
   24.49 +    /*
   24.50 +     * Returns the list of Archive specified in cpaths and not included
   24.51 +     * initialArchives
   24.52 +     */
   24.53 +    private List<Archive> getClassPathArchives(String cpaths, List<Path> initialArchives)
   24.54 +            throws IOException
   24.55 +    {
   24.56          List<Archive> result = new ArrayList<>();
   24.57 -        if (paths.isEmpty()) {
   24.58 +        if (cpaths.isEmpty()) {
   24.59              return result;
   24.60          }
   24.61 -        for (String p : paths.split(File.pathSeparator)) {
   24.62 +
   24.63 +        List<Path> paths = new ArrayList<>();
   24.64 +        for (String p : cpaths.split(File.pathSeparator)) {
   24.65              if (p.length() > 0) {
   24.66 -                List<Path> files = new ArrayList<>();
   24.67                  // wildcard to parse all JAR files e.g. -classpath dir/*
   24.68                  int i = p.lastIndexOf(".*");
   24.69                  if (i > 0) {
   24.70                      Path dir = Paths.get(p.substring(0, i));
   24.71                      try (DirectoryStream<Path> stream = Files.newDirectoryStream(dir, "*.jar")) {
   24.72                          for (Path entry : stream) {
   24.73 -                            files.add(entry);
   24.74 +                            paths.add(entry);
   24.75                          }
   24.76                      }
   24.77                  } else {
   24.78 -                    files.add(Paths.get(p));
   24.79 -                }
   24.80 -                for (Path f : files) {
   24.81 -                    if (Files.exists(f)) {
   24.82 -                        result.add(Archive.getInstance(f));
   24.83 -                    }
   24.84 +                    paths.add(Paths.get(p));
   24.85                  }
   24.86              }
   24.87          }
   24.88 +        for (Path p : paths) {
   24.89 +            if (Files.exists(p) && !hasSameFile(initialArchives, p)) {
   24.90 +                result.add(Archive.getInstance(p));
   24.91 +            }
   24.92 +        }
   24.93          return result;
   24.94      }
   24.95  
   24.96 +    private boolean hasSameFile(List<Path> paths, Path p2) throws IOException {
   24.97 +        for (Path p1 : paths) {
   24.98 +            if (Files.isSameFile(p1, p2)) {
   24.99 +                return true;
  24.100 +            }
  24.101 +        }
  24.102 +        return false;
  24.103 +    }
  24.104 +
  24.105      class RawOutputFormatter implements Analyzer.Visitor {
  24.106          private final PrintWriter writer;
  24.107          private String pkg = "";
    25.1 --- a/src/share/classes/com/sun/tools/jdeps/PlatformClassPath.java	Thu May 07 18:15:48 2015 -0700
    25.2 +++ b/src/share/classes/com/sun/tools/jdeps/PlatformClassPath.java	Thu Jun 04 15:32:38 2015 -0700
    25.3 @@ -46,7 +46,7 @@
    25.4   */
    25.5  class PlatformClassPath {
    25.6      private static final List<String> NON_PLATFORM_JARFILES =
    25.7 -        Arrays.asList("alt-rt.jar", "jfxrt.jar", "ant-javafx.jar", "javafx-mx.jar");
    25.8 +        Arrays.asList("alt-rt.jar", "ant-javafx.jar", "javafx-mx.jar");
    25.9      private static final List<Archive> javaHomeArchives = init();
   25.10  
   25.11      static List<Archive> getArchives() {
   25.12 @@ -124,6 +124,14 @@
   25.13       */
   25.14      static class JDKArchive extends Archive {
   25.15          private static List<String> PROFILE_JARS = Arrays.asList("rt.jar", "jce.jar");
   25.16 +        // Workaround: The following packages are not annotated as jdk.Exported
   25.17 +        private static List<String> EXPORTED_PACKAGES = Arrays.asList(
   25.18 +                "javax.jnlp",
   25.19 +                "org.w3c.dom.css",
   25.20 +                "org.w3c.dom.html",
   25.21 +                "org.w3c.dom.stylesheets",
   25.22 +                "org.w3c.dom.xpath"
   25.23 +        );
   25.24          public static boolean isProfileArchive(Archive archive) {
   25.25              if (archive instanceof JDKArchive) {
   25.26                  return PROFILE_JARS.contains(archive.getName());
   25.27 @@ -155,7 +163,11 @@
   25.28           * Tests if a given package name is exported.
   25.29           */
   25.30          public boolean isExportedPackage(String pn) {
   25.31 -            if (Profile.getProfile(pn) != null || "javax.jnlp".equals(pn)) {
   25.32 +            if (Profile.getProfile(pn) != null) {
   25.33 +                return true;
   25.34 +            }
   25.35 +            // special case for JavaFX and APIs that are not annotated with @jdk.Exported)
   25.36 +            if (EXPORTED_PACKAGES.contains(pn) || pn.startsWith("javafx.")) {
   25.37                  return true;
   25.38              }
   25.39              return exportedPackages.containsKey(pn) ? exportedPackages.get(pn) : false;
    26.1 --- a/test/Makefile	Thu May 07 18:15:48 2015 -0700
    26.2 +++ b/test/Makefile	Thu Jun 04 15:32:38 2015 -0700
    26.3 @@ -21,7 +21,6 @@
    26.4  ifeq ($(OSNAME), SunOS)
    26.5    SLASH_JAVA = /java
    26.6    PLATFORM = solaris
    26.7 -  JT_PLATFORM = solaris
    26.8    ARCH = $(shell uname -p)
    26.9    ifeq ($(ARCH), i386)
   26.10      ARCH=i586
   26.11 @@ -30,7 +29,6 @@
   26.12  ifeq ($(OSNAME), Linux)
   26.13    SLASH_JAVA = /java
   26.14    PLATFORM = linux
   26.15 -  JT_PLATFORM = linux
   26.16    ARCH = $(shell uname -m)
   26.17    ifeq ($(ARCH), i386)
   26.18      ARCH=i586
   26.19 @@ -38,7 +36,6 @@
   26.20  endif
   26.21  ifeq ($(OSNAME), Darwin)
   26.22    PLATFORM = bsd
   26.23 -  JT_PLATFORM = linux
   26.24    ARCH = $(shell uname -m)
   26.25    ifeq ($(ARCH), i386)
   26.26      ARCH=i586
   26.27 @@ -55,7 +52,6 @@
   26.28  
   26.29  ifeq ($(PLATFORM), windows)
   26.30    SLASH_JAVA = J:
   26.31 -  JT_PLATFORM = win32
   26.32    ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),ia64)
   26.33      ARCH=ia64
   26.34    else
   26.35 @@ -93,8 +89,8 @@
   26.36  else
   26.37    JTREG_HOME = $(SLASH_JAVA)/re/jtreg/4.1/promoted/latest/binaries/jtreg
   26.38  endif
   26.39 -JTREG = $(JTREG_HOME)/$(JT_PLATFORM)/bin/jtreg
   26.40 -JTDIFF = $(JTREG_HOME)/$(JT_PLATFORM)/bin/jtdiff
   26.41 +JTREG = $(JTREG_HOME)/bin/jtreg
   26.42 +JTDIFF = $(JTREG_HOME)/bin/jtdiff
   26.43  
   26.44  # Default JCK to run
   26.45  ifdef JPRT_JCK_HOME
    27.1 --- a/test/com/sun/javadoc/testStylesheet/TestStylesheet.java	Thu May 07 18:15:48 2015 -0700
    27.2 +++ b/test/com/sun/javadoc/testStylesheet/TestStylesheet.java	Thu Jun 04 15:32:38 2015 -0700
    27.3 @@ -1,5 +1,5 @@
    27.4  /*
    27.5 - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
    27.6 + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
    27.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    27.8   *
    27.9   * This code is free software; you can redistribute it and/or modify it
   27.10 @@ -23,7 +23,7 @@
   27.11  
   27.12  /*
   27.13   * @test
   27.14 - * @bug      4494033 7028815 7052425 8007338 8023608 8008164 8016549
   27.15 + * @bug      4494033 7028815 7052425 8007338 8023608 8008164 8016549 8072461
   27.16   * @summary  Run tests on doclet stylesheet.
   27.17   * @author   jamieh
   27.18   * @library  ../lib/
   27.19 @@ -34,7 +34,7 @@
   27.20  public class TestStylesheet extends JavadocTester {
   27.21  
   27.22      //Test information.
   27.23 -    private static final String BUG_ID = "4494033-7028815-7052425-8007338";
   27.24 +    private static final String BUG_ID = "4494033-7028815-7052425-8007338-8072461";
   27.25  
   27.26      //Javadoc arguments.
   27.27      private static final String[] ARGS = new String[] {
   27.28 @@ -123,6 +123,23 @@
   27.29              "}"},
   27.30          {BUG_ID + FS + "stylesheet.css",
   27.31              "@import url('resources/fonts/dejavu.css');"},
   27.32 +        // Test the formatting styles for proper content display in use and constant values pages.
   27.33 +        {BUG_ID + FS + "stylesheet.css",
   27.34 +            ".overviewSummary td.colFirst, .overviewSummary th.colFirst," + NL +
   27.35 +            ".useSummary td.colFirst, .useSummary th.colFirst," + NL +
   27.36 +            ".overviewSummary td.colOne, .overviewSummary th.colOne," + NL +
   27.37 +            ".memberSummary td.colFirst, .memberSummary th.colFirst," + NL +
   27.38 +            ".memberSummary td.colOne, .memberSummary th.colOne," + NL +
   27.39 +            ".typeSummary td.colFirst{" + NL +
   27.40 +            "    width:25%;" + NL +
   27.41 +            "    vertical-align:top;" + NL +
   27.42 +            "}"},
   27.43 +        {BUG_ID + FS + "stylesheet.css",
   27.44 +            ".overviewSummary td, .memberSummary td, .typeSummary td," + NL +
   27.45 +            ".useSummary td, .constantsSummary td, .deprecatedSummary td {" + NL +
   27.46 +            "    text-align:left;" + NL +
   27.47 +            "    padding:0px 0px 12px 10px;" + NL +
   27.48 +            "}"},
   27.49          // Test whether a link to the stylesheet file is inserted properly
   27.50          // in the class documentation.
   27.51          {BUG_ID + FS + "pkg" + FS + "A.html",
    28.1 --- a/test/tools/javac/MethodParameters/ClassFileVisitor.java	Thu May 07 18:15:48 2015 -0700
    28.2 +++ b/test/tools/javac/MethodParameters/ClassFileVisitor.java	Thu Jun 04 15:32:38 2015 -0700
    28.3 @@ -147,6 +147,7 @@
    28.4          public int mAttrs;
    28.5          public int mNumParams;
    28.6          public boolean mSynthetic;
    28.7 +        public boolean mIsLambda;
    28.8          public boolean mIsConstructor;
    28.9          public boolean mIsClinit;
   28.10          public boolean mIsBridge;
   28.11 @@ -165,6 +166,7 @@
   28.12              mIsClinit = mName.equals("<clinit>");
   28.13              prefix = cname + "." + mName + "() - ";
   28.14              mIsBridge = method.access_flags.is(AccessFlags.ACC_BRIDGE);
   28.15 +            mIsLambda = mSynthetic && mName.startsWith("lambda$");
   28.16  
   28.17              if (mIsClinit) {
   28.18                  sb = new StringBuilder(); // Discard output
   28.19 @@ -225,7 +227,7 @@
   28.20  
   28.21              // IMPL: Whether MethodParameters attributes will be generated
   28.22              // for some synthetics is unresolved. For now, assume no.
   28.23 -            if (mSynthetic) {
   28.24 +            if (mSynthetic && !mIsLambda) {
   28.25                  warn(prefix + "synthetic has MethodParameter attribute");
   28.26              }
   28.27  
   28.28 @@ -349,10 +351,12 @@
   28.29              } else if (isEnum && mNumParams == 1 && index == 0 && mName.equals("valueOf")) {
   28.30                  expect = "name";
   28.31                  allowMandated = true;
   28.32 -            } else if (mIsBridge) {
   28.33 +            } else if (mIsBridge || mIsLambda) {
   28.34                  allowSynthetic = true;
   28.35                  /*  you can't expect an special name for bridges' parameters.
   28.36 -                 *  The name of the original parameters are now copied.
   28.37 +                 *  The name of the original parameters are now copied. Likewise
   28.38 +                 *  for a method encoding the lambda expression, names are derived
   28.39 +                 *  from source lambda's parameters and captured enclosing locals.
   28.40                   */
   28.41                  expect = null;
   28.42              }
    29.1 --- a/test/tools/javac/MethodParameters/LambdaTest.java	Thu May 07 18:15:48 2015 -0700
    29.2 +++ b/test/tools/javac/MethodParameters/LambdaTest.java	Thu Jun 04 15:32:38 2015 -0700
    29.3 @@ -1,5 +1,5 @@
    29.4  /*
    29.5 - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
    29.6 + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
    29.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    29.8   *
    29.9   * This code is free software; you can redistribute it and/or modify it
   29.10 @@ -23,7 +23,7 @@
   29.11  
   29.12  /*
   29.13   * @test
   29.14 - * @bug 8006582
   29.15 + * @bug 8006582 8037546
   29.16   * @summary javac should generate method parameters correctly.
   29.17   * @build Tester
   29.18   * @compile -parameters LambdaTest.java
   29.19 @@ -31,8 +31,8 @@
   29.20   */
   29.21  
   29.22  /**
   29.23 - * Parameter names are not recorded for lambdas. This test verifies
   29.24 - * that there are no MethodParameters attribute for lambdas.
   29.25 + * Post https://bugs.openjdk.java.net/browse/JDK-8037546, this test verifies
   29.26 + * that MethodParameters attribute for lambdas are emitted properly.
   29.27   */
   29.28  class LambdaTest {
   29.29  
    30.1 --- a/test/tools/javac/MethodParameters/LambdaTest.out	Thu May 07 18:15:48 2015 -0700
    30.2 +++ b/test/tools/javac/MethodParameters/LambdaTest.out	Thu Jun 04 15:32:38 2015 -0700
    30.3 @@ -1,7 +1,7 @@
    30.4  class LambdaTest -- 
    30.5  LambdaTest.<init>()
    30.6  LambdaTest.foo(i)
    30.7 -LambdaTest.lambda$static$1(arg0)/*synthetic*/
    30.8 -LambdaTest.lambda$null$0(arg0, arg1)/*synthetic*/
    30.9 +LambdaTest.lambda$static$1(x1/*synthetic*/)/*synthetic*/
   30.10 +LambdaTest.lambda$null$0(final x1/*synthetic*/, x2/*synthetic*/)/*synthetic*/
   30.11  static interface LambdaTest$I -- inner
   30.12  LambdaTest$I.m(x)
    31.1 --- a/test/tools/javac/MethodParameters/ReflectionVisitor.java	Thu May 07 18:15:48 2015 -0700
    31.2 +++ b/test/tools/javac/MethodParameters/ReflectionVisitor.java	Thu Jun 04 15:32:38 2015 -0700
    31.3 @@ -277,7 +277,7 @@
    31.4                      param = "final " + param;
    31.5                  }
    31.6                  sb.append(sep).append(param);
    31.7 -                if (!m.isBridge() && !expect.equals(param)) {
    31.8 +                if (!m.isBridge() && !m.getName().startsWith("lambda$") && !expect.equals(param)) {
    31.9                      error(prefix + "param[" + i + "]='"
   31.10                            + param + "' expected '" + expect + "'");
   31.11                      break;
    32.1 --- a/test/tools/javac/annotations/6214965/T6214965.java	Thu May 07 18:15:48 2015 -0700
    32.2 +++ b/test/tools/javac/annotations/6214965/T6214965.java	Thu Jun 04 15:32:38 2015 -0700
    32.3 @@ -1,5 +1,5 @@
    32.4  /*
    32.5 - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
    32.6 + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
    32.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    32.8   *
    32.9   * This code is free software; you can redistribute it and/or modify it
   32.10 @@ -23,9 +23,10 @@
   32.11  
   32.12  /**
   32.13   * @test
   32.14 - * @bug     6214965 6365854
   32.15 + * @bug     6214965 6365854 8068639
   32.16   * @summary Compiler crash on redefing nested annotation types
   32.17   * @compile CompilerAnnotationTest.java CompilerAnnotationTest2.java
   32.18   * @compile CompilerAnnotationTest2bad.java
   32.19 - * @compile/ref=T6214965.out -XDrawDiagnostics CompilerAnnotationTest2bad.java
   32.20 + * @compile/ref=T6214965.out -XDrawDiagnostics -Xlint:classfile CompilerAnnotationTest2bad.java
   32.21 + * @compile -Werror CompilerAnnotationTest2bad.java
   32.22   */
    33.1 --- a/test/tools/javac/annotations/6365854/T6365854.java	Thu May 07 18:15:48 2015 -0700
    33.2 +++ b/test/tools/javac/annotations/6365854/T6365854.java	Thu Jun 04 15:32:38 2015 -0700
    33.3 @@ -1,5 +1,5 @@
    33.4  /*
    33.5 - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
    33.6 + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
    33.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    33.8   *
    33.9   * This code is free software; you can redistribute it and/or modify it
   33.10 @@ -23,7 +23,7 @@
   33.11  
   33.12  /**
   33.13   * @test
   33.14 - * @bug     6365854
   33.15 + * @bug     6365854 8068639
   33.16   * @summary javac crashes when compiling against an annotated class
   33.17   * @compile TestAnnotation.java TestCore.java
   33.18   * @clean test.annotation.TestAnnotation
   33.19 @@ -33,11 +33,11 @@
   33.20   *
   33.21   * @compile TestAnnotation.java TestCore.java
   33.22   * @clean test.annotation.TestAnnotation
   33.23 - * @compile/ref=test1.out -XDrawDiagnostics T6365854.java
   33.24 + * @compile/ref=test1.out -XDrawDiagnostics -Xlint:classfile T6365854.java
   33.25   * @run main T6365854
   33.26 - * @compile/ref=test2.out -XDrawDiagnostics evolve/TestAnnotation.java T6365854.java
   33.27 + * @compile/ref=test2.out -XDrawDiagnostics -Xlint:classfile evolve/TestAnnotation.java T6365854.java
   33.28   * @run main T6365854
   33.29 - * @compile/ref=test2.out -XDrawDiagnostics T6365854.java
   33.30 + * @compile/ref=test2.out -XDrawDiagnostics -Xlint:classfile T6365854.java
   33.31   * @run main T6365854
   33.32   */
   33.33  
    34.1 --- a/test/tools/javac/annotations/typeAnnotations/classfile/TestAnonInnerClasses.java	Thu May 07 18:15:48 2015 -0700
    34.2 +++ b/test/tools/javac/annotations/typeAnnotations/classfile/TestAnonInnerClasses.java	Thu Jun 04 15:32:38 2015 -0700
    34.3 @@ -1,5 +1,5 @@
    34.4  /*
    34.5 - * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
    34.6 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
    34.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    34.8   *
    34.9   * This code is free software; you can redistribute it and/or modify it
    35.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    35.2 +++ b/test/tools/javac/classfiles/InnerClasses/T8068517.java	Thu Jun 04 15:32:38 2015 -0700
    35.3 @@ -0,0 +1,126 @@
    35.4 +/*
    35.5 + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
    35.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    35.7 + *
    35.8 + * This code is free software; you can redistribute it and/or modify it
    35.9 + * under the terms of the GNU General Public License version 2 only, as
   35.10 + * published by the Free Software Foundation.
   35.11 + *
   35.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   35.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   35.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   35.15 + * version 2 for more details (a copy is included in the LICENSE file that
   35.16 + * accompanied this code).
   35.17 + *
   35.18 + * You should have received a copy of the GNU General Public License version
   35.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   35.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   35.21 + *
   35.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   35.23 + * or visit www.oracle.com if you need additional information or have any
   35.24 + * questions.
   35.25 + */
   35.26 +
   35.27 +/** @test
   35.28 + *  @bug 8068517
   35.29 + *  @summary Verify that nested enums have correct abstract flag in the InnerClasses attribute.
   35.30 + *  @library /tools/javac/lib
   35.31 + *  @build ToolBox T8068517
   35.32 + *  @run main T8068517
   35.33 + */
   35.34 +
   35.35 +import com.sun.tools.javac.util.Assert;
   35.36 +import java.io.File;
   35.37 +import java.nio.file.Files;
   35.38 +import java.util.Arrays;
   35.39 +import java.util.List;
   35.40 +import java.util.stream.Collectors;
   35.41 +import java.util.stream.Stream;
   35.42 +import javax.tools.JavaCompiler;
   35.43 +import javax.tools.ToolProvider;
   35.44 +
   35.45 +public class T8068517 {
   35.46 +
   35.47 +    public static void main(String[] args) throws Exception {
   35.48 +        new T8068517().run();
   35.49 +    }
   35.50 +
   35.51 +    void run() throws Exception {
   35.52 +        runTest("class A {\n" +
   35.53 +                "    enum AInner implements Runnable {\n" +
   35.54 +                "        A {\n" +
   35.55 +                "            public void run() {}\n" +
   35.56 +                "        };\n" +
   35.57 +                "    }\n" +
   35.58 +                "}\n",
   35.59 +                "class B {\n" +
   35.60 +                "    A.AInner a;\n" +
   35.61 +                "}");
   35.62 +        runTest("class A {\n" +
   35.63 +                "    enum AInner implements Runnable {\n" +
   35.64 +                "        A {\n" +
   35.65 +                "            public void run() {}\n" +
   35.66 +                "        };\n" +
   35.67 +                "    }\n" +
   35.68 +                "    AInner aInner;\n" +
   35.69 +                "}\n",
   35.70 +                "class B {\n" +
   35.71 +                "    void test(A a) {;\n" +
   35.72 +                "        switch (a.aInner) {\n" +
   35.73 +                "            case A: break;\n" +
   35.74 +                "        }\n" +
   35.75 +                "    };\n" +
   35.76 +                "}");
   35.77 +        runTest("class A {\n" +
   35.78 +                "    enum AInner implements Runnable {\n" +
   35.79 +                "        A {\n" +
   35.80 +                "            public void run() {}\n" +
   35.81 +                "        };\n" +
   35.82 +                "    }\n" +
   35.83 +                "    AInner aInner;\n" +
   35.84 +                "}\n",
   35.85 +                "class B {\n" +
   35.86 +                "    void test(A a) {;\n" +
   35.87 +                "        System.err.println(a.aInner.toString());\n" +
   35.88 +                "    };\n" +
   35.89 +                "}");
   35.90 +        runTest("class A {\n" +
   35.91 +                "    enum AInner implements Runnable {\n" +
   35.92 +                "        A {\n" +
   35.93 +                "            public void run() {}\n" +
   35.94 +                "        };\n" +
   35.95 +                "    }\n" +
   35.96 +                "    AInner aInner() {\n" +
   35.97 +                "        return null;\n" +
   35.98 +                "    }\n" +
   35.99 +                "}\n",
  35.100 +                "class B {\n" +
  35.101 +                "    void test(A a) {;\n" +
  35.102 +                "        System.err.println(a.aInner().toString());\n" +
  35.103 +                "    };\n" +
  35.104 +                "}");
  35.105 +    }
  35.106 +
  35.107 +    JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
  35.108 +    int testN = 0;
  35.109 +
  35.110 +    void runTest(String aJava, String bJava) throws Exception {
  35.111 +        File testClasses = new File(System.getProperty("test.classes"));
  35.112 +        File target1 = new File(testClasses, "T8068517s" + testN++);
  35.113 +        doCompile(target1, aJava, bJava);
  35.114 +        File target2 = new File(testClasses, "T8068517s" + testN++);
  35.115 +        doCompile(target2, bJava, aJava);
  35.116 +
  35.117 +        Assert.check(Arrays.equals(Files.readAllBytes(new File(target1, "B.class").toPath()),
  35.118 +                                   Files.readAllBytes(new File(target2, "B.class").toPath())));
  35.119 +    }
  35.120 +
  35.121 +    void doCompile(File target, String... sources) throws Exception {
  35.122 +        target.mkdirs();
  35.123 +        List<String> options = Arrays.asList("-d", target.getAbsolutePath());
  35.124 +        List<ToolBox.JavaSource> files = Stream.of(sources)
  35.125 +                                               .map(ToolBox.JavaSource::new)
  35.126 +                                               .collect(Collectors.toList());
  35.127 +        compiler.getTask(null, null, null, options, null, files).call();
  35.128 +    }
  35.129 +}
    36.1 --- a/test/tools/javac/diags/examples/MrefInferAndExplicitParams.java	Thu May 07 18:15:48 2015 -0700
    36.2 +++ b/test/tools/javac/diags/examples/MrefInferAndExplicitParams.java	Thu Jun 04 15:32:38 2015 -0700
    36.3 @@ -8,7 +8,7 @@
    36.4   *
    36.5   * This code is distributed in the hope that it will be useful, but WITHOUT
    36.6   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    36.7 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
    36.8 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    36.9   * version 2 for more details (a copy is included in the LICENSE file that
   36.10   * accompanied this code).
   36.11   *
    37.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    37.2 +++ b/test/tools/javac/enum/8069181/T8069181.java	Thu Jun 04 15:32:38 2015 -0700
    37.3 @@ -0,0 +1,45 @@
    37.4 +/*
    37.5 + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
    37.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    37.7 + *
    37.8 + * This code is free software; you can redistribute it and/or modify it
    37.9 + * under the terms of the GNU General Public License version 2 only, as
   37.10 + * published by the Free Software Foundation.  Oracle designates this
   37.11 + * particular file as subject to the "Classpath" exception as provided
   37.12 + * by Oracle in the LICENSE file that accompanied this code.
   37.13 + *
   37.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
   37.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   37.16 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   37.17 + * version 2 for more details (a copy is included in the LICENSE file that
   37.18 + * accompanied this code).
   37.19 + *
   37.20 + * You should have received a copy of the GNU General Public License version
   37.21 + * 2 along with this work; if not, write to the Free Software Foundation,
   37.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   37.23 + *
   37.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   37.25 + * or visit www.oracle.com if you need additional information or have any
   37.26 + * questions.
   37.27 + */
   37.28 +
   37.29 +/*
   37.30 + * @test
   37.31 + * @bug 8069181
   37.32 + * @summary java.lang.AssertionError when compiling JDK 1.4 code in JDK 8
   37.33 + *
   37.34 + * @compile -source 1.4 T8069181.java
   37.35 + */
   37.36 +import java.util.Enumeration;
   37.37 +import java.util.Hashtable;
   37.38 +class T8069181 {
   37.39 +    void test() {
   37.40 +        Hashtable hTable = new Hashtable();
   37.41 +        hTable.put("hello", "value");
   37.42 +        for (Enumeration enum = hTable.keys();;){
   37.43 +            if(!enum.hasMoreElements())
   37.44 +                break;
   37.45 +            enum.nextElement();
   37.46 +        }
   37.47 +    }
   37.48 +}
    38.1 --- a/test/tools/javac/flow/LVTHarness.java	Thu May 07 18:15:48 2015 -0700
    38.2 +++ b/test/tools/javac/flow/LVTHarness.java	Thu Jun 04 15:32:38 2015 -0700
    38.3 @@ -1,5 +1,5 @@
    38.4  /*
    38.5 - * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
    38.6 + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
    38.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    38.8   *
    38.9   * This code is free software; you can redistribute it and/or modify it
   38.10 @@ -23,7 +23,7 @@
   38.11  
   38.12  /*
   38.13   * @test
   38.14 - * @bug 7047734 8027660 8037937 8047719 8058708
   38.15 + * @bug 7047734 8027660 8037937 8047719 8058708 8064857
   38.16   * @summary The LVT is not generated correctly during some try/catch scenarios
   38.17   *          javac crash while creating LVT entry for a local variable defined in
   38.18   *          an inner block
   38.19 @@ -144,7 +144,7 @@
   38.20      }
   38.21  
   38.22      void checkMethod(ConstantPool constantPool, Method method, AliveRanges ranges)
   38.23 -            throws InvalidIndex, UnexpectedEntry {
   38.24 +            throws InvalidIndex, UnexpectedEntry, ConstantPoolException {
   38.25          Code_attribute code = (Code_attribute) method.attributes.get(Attribute.Code);
   38.26          LocalVariableTable_attribute lvt =
   38.27              (LocalVariableTable_attribute) (code.attributes.get(Attribute.LocalVariableTable));
   38.28 @@ -166,7 +166,7 @@
   38.29          }
   38.30  
   38.31          if (i < infoFromRanges.size()) {
   38.32 -            error(infoFromLVT, infoFromRanges);
   38.33 +            error(infoFromLVT, infoFromRanges, method.getName(constantPool).toString());
   38.34          }
   38.35      }
   38.36  
   38.37 @@ -202,9 +202,10 @@
   38.38          return sb.toString();
   38.39      }
   38.40  
   38.41 -    protected void error(List<String> infoFromLVT, List<String> infoFromRanges) {
   38.42 +    protected void error(List<String> infoFromLVT, List<String> infoFromRanges, String methodName) {
   38.43          nerrors++;
   38.44          System.err.printf("Error occurred while checking file: %s\n", jfo.getName());
   38.45 +        System.err.printf("at method: %s\n", methodName);
   38.46          System.err.println("The range info from the annotations is");
   38.47          printStringListToErrOutput(infoFromRanges);
   38.48          System.err.println();
    39.1 --- a/test/tools/javac/flow/tests/TestCaseFor.java	Thu May 07 18:15:48 2015 -0700
    39.2 +++ b/test/tools/javac/flow/tests/TestCaseFor.java	Thu Jun 04 15:32:38 2015 -0700
    39.3 @@ -2,7 +2,7 @@
    39.4  
    39.5  public class TestCaseFor {
    39.6  
    39.7 -    @AliveRange(varName="o", bytecodeStart=10, bytecodeLength=8)
    39.8 +    @AliveRange(varName="o", bytecodeStart=10, bytecodeLength=11)
    39.9      @AliveRange(varName="o", bytecodeStart=24, bytecodeLength=1)
   39.10      void m1(String[] args) {
   39.11          Object o;
   39.12 @@ -13,7 +13,7 @@
   39.13          o = "";
   39.14      }
   39.15  
   39.16 -    @AliveRange(varName="o", bytecodeStart=10, bytecodeLength=8)
   39.17 +    @AliveRange(varName="o", bytecodeStart=10, bytecodeLength=11)
   39.18      @AliveRange(varName="o", bytecodeStart=24, bytecodeLength=1)
   39.19      void m2(String[] args) {
   39.20          Object o;
    40.1 --- a/test/tools/javac/flow/tests/TestCaseForEach.java	Thu May 07 18:15:48 2015 -0700
    40.2 +++ b/test/tools/javac/flow/tests/TestCaseForEach.java	Thu Jun 04 15:32:38 2015 -0700
    40.3 @@ -2,7 +2,7 @@
    40.4  
    40.5  public class TestCaseForEach {
    40.6  
    40.7 -    @AliveRange(varName="o", bytecodeStart=25, bytecodeLength=8)
    40.8 +    @AliveRange(varName="o", bytecodeStart=25, bytecodeLength=11)
    40.9      @AliveRange(varName="o", bytecodeStart=39, bytecodeLength=1)
   40.10      void m(String[] args) {
   40.11          Object o;
    41.1 --- a/test/tools/javac/flow/tests/TestCaseIfElse.java	Thu May 07 18:15:48 2015 -0700
    41.2 +++ b/test/tools/javac/flow/tests/TestCaseIfElse.java	Thu Jun 04 15:32:38 2015 -0700
    41.3 @@ -60,4 +60,19 @@
    41.4          }
    41.5          return null;
    41.6      }
    41.7 +
    41.8 +    @AliveRange(varName="i", bytecodeStart=6, bytecodeLength=2)
    41.9 +    int m4(boolean flag) {
   41.10 +        int i;
   41.11 +        label:
   41.12 +        {
   41.13 +            if (flag) {
   41.14 +                i = 1;
   41.15 +            } else {
   41.16 +                break label;
   41.17 +            }
   41.18 +            return i;
   41.19 +        }
   41.20 +        return -1;
   41.21 +    }
   41.22  }
    42.1 --- a/test/tools/javac/flow/tests/TestCaseSwitch.java	Thu May 07 18:15:48 2015 -0700
    42.2 +++ b/test/tools/javac/flow/tests/TestCaseSwitch.java	Thu Jun 04 15:32:38 2015 -0700
    42.3 @@ -81,4 +81,26 @@
    42.4          o = "finish";
    42.5      }
    42.6  
    42.7 +    @AliveRange(varName="oCache", bytecodeStart=30, bytecodeLength=6)
    42.8 +    @AliveRange(varName="cache", bytecodeStart=41, bytecodeLength=3)
    42.9 +    @AliveRange(varName="cache", bytecodeStart=54, bytecodeLength=2)
   42.10 +    @AliveRange(varName="service", bytecodeStart=39, bytecodeLength=5)
   42.11 +    Object m4(int i) {
   42.12 +        Object cache;
   42.13 +        switch (i) {
   42.14 +            case 0:
   42.15 +                Object oCache = null;
   42.16 +                if (oCache != null) {
   42.17 +                    return oCache;
   42.18 +                }
   42.19 +            case 1:
   42.20 +                Object service = null;
   42.21 +                cache = null;
   42.22 +                break;
   42.23 +            default:
   42.24 +                throw new AssertionError("");
   42.25 +            }
   42.26 +        return cache;
   42.27 +    }
   42.28 +
   42.29  }
    43.1 --- a/test/tools/javac/flow/tests/TestCaseTry.java	Thu May 07 18:15:48 2015 -0700
    43.2 +++ b/test/tools/javac/flow/tests/TestCaseTry.java	Thu Jun 04 15:32:38 2015 -0700
    43.3 @@ -17,7 +17,8 @@
    43.4      }
    43.5  
    43.6      @AliveRange(varName="o", bytecodeStart=3, bytecodeLength=16)
    43.7 -    @AliveRange(varName="o", bytecodeStart=23, bytecodeLength=23)
    43.8 +    @AliveRange(varName="o", bytecodeStart=23, bytecodeLength=8)
    43.9 +    @AliveRange(varName="o", bytecodeStart=35, bytecodeLength=11)
   43.10      void m1() {
   43.11          Object o;
   43.12          try {
   43.13 @@ -33,7 +34,8 @@
   43.14      }
   43.15  
   43.16      @AliveRange(varName="o", bytecodeStart=3, bytecodeLength=16)
   43.17 -    @AliveRange(varName="o", bytecodeStart=23, bytecodeLength=31)
   43.18 +    @AliveRange(varName="o", bytecodeStart=23, bytecodeLength=16)
   43.19 +    @AliveRange(varName="o", bytecodeStart=43, bytecodeLength=11)
   43.20      void m2() {
   43.21          Object o;
   43.22          try {
   43.23 @@ -51,7 +53,8 @@
   43.24      }
   43.25  
   43.26      @AliveRange(varName="o", bytecodeStart=22, bytecodeLength=38)
   43.27 -    @AliveRange(varName="o", bytecodeStart=103, bytecodeLength=8)
   43.28 +    @AliveRange(varName="o", bytecodeStart=103, bytecodeLength=3)
   43.29 +    @AliveRange(varName="o", bytecodeStart=110, bytecodeLength=1)
   43.30      void m3() {
   43.31          Object o;
   43.32          try (BufferedReader br =
    44.1 --- a/test/tools/javac/flow/tests/TestCaseWhile.java	Thu May 07 18:15:48 2015 -0700
    44.2 +++ b/test/tools/javac/flow/tests/TestCaseWhile.java	Thu Jun 04 15:32:38 2015 -0700
    44.3 @@ -2,7 +2,7 @@
    44.4  
    44.5  public class TestCaseWhile {
    44.6  
    44.7 -    @AliveRange(varName="o", bytecodeStart=9, bytecodeLength=5)
    44.8 +    @AliveRange(varName="o", bytecodeStart=9, bytecodeLength=8)
    44.9      @AliveRange(varName="o", bytecodeStart=20, bytecodeLength=1)
   44.10      void m(String[] args) {
   44.11          Object o;
    45.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    45.2 +++ b/test/tools/javac/generics/8064803/T8064803.java	Thu Jun 04 15:32:38 2015 -0700
    45.3 @@ -0,0 +1,53 @@
    45.4 +/*
    45.5 + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
    45.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    45.7 + *
    45.8 + * This code is free software; you can redistribute it and/or modify it
    45.9 + * under the terms of the GNU General Public License version 2 only, as
   45.10 + * published by the Free Software Foundation.  Oracle designates this
   45.11 + * particular file as subject to the "Classpath" exception as provided
   45.12 + * by Oracle in the LICENSE file that accompanied this code.
   45.13 + *
   45.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
   45.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   45.16 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   45.17 + * version 2 for more details (a copy is included in the LICENSE file that
   45.18 + * accompanied this code).
   45.19 + *
   45.20 + * You should have received a copy of the GNU General Public License version
   45.21 + * 2 along with this work; if not, write to the Free Software Foundation,
   45.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   45.23 + *
   45.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   45.25 + * or visit www.oracle.com if you need additional information or have any
   45.26 + * questions.
   45.27 + */
   45.28 +
   45.29 +/*
   45.30 + * @test
   45.31 + * @bug 8064803
   45.32 + * @summary Javac erroneously uses instantiated signatures when merging abstract most-specific methods
   45.33 + */
   45.34 +public class T8064803 {
   45.35 +    interface ParentA<T> {
   45.36 +        T process() throws Exception;
   45.37 +    }
   45.38 +
   45.39 +    interface ParentB<T> {
   45.40 +        T process() throws Exception;
   45.41 +    }
   45.42 +
   45.43 +    interface Child<T> extends ParentA<T>, ParentB<T> { }
   45.44 +
   45.45 +    static class ChildImpl<T> implements Child<T> {
   45.46 +        @Override
   45.47 +        public T process() {
   45.48 +            return null;
   45.49 +        }
   45.50 +    }
   45.51 +
   45.52 +    public static void main(String[] args) throws Exception {
   45.53 +        Child<String> child = new ChildImpl<String>();
   45.54 +        child.process();
   45.55 +    }
   45.56 +}
    46.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    46.2 +++ b/test/tools/javac/generics/inference/8055963/T8055963.java	Thu Jun 04 15:32:38 2015 -0700
    46.3 @@ -0,0 +1,41 @@
    46.4 +/*
    46.5 + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
    46.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    46.7 + *
    46.8 + * This code is free software; you can redistribute it and/or modify it
    46.9 + * under the terms of the GNU General Public License version 2 only, as
   46.10 + * published by the Free Software Foundation.  Oracle designates this
   46.11 + * particular file as subject to the "Classpath" exception as provided
   46.12 + * by Oracle in the LICENSE file that accompanied this code.
   46.13 + *
   46.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
   46.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   46.16 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   46.17 + * version 2 for more details (a copy is included in the LICENSE file that
   46.18 + * accompanied this code).
   46.19 + *
   46.20 + * You should have received a copy of the GNU General Public License version
   46.21 + * 2 along with this work; if not, write to the Free Software Foundation,
   46.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   46.23 + *
   46.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   46.25 + * or visit www.oracle.com if you need additional information or have any
   46.26 + * questions.
   46.27 + */
   46.28 +
   46.29 +/**
   46.30 + * @test
   46.31 + * @bug 8055963
   46.32 + * @summary Inference failure with nested invocation
   46.33 + * @compile T8055963.java
   46.34 + */
   46.35 +class T8055963 {
   46.36 +
   46.37 +    static class C<T> {}
   46.38 +
   46.39 +    <T> T choose(T first, T second) { return null; }
   46.40 +
   46.41 +    void test() {
   46.42 +        C<String> cs = choose(new C<String>(), new C<>());
   46.43 +    }
   46.44 +}
    47.1 --- a/test/tools/javac/lambda/8016177/T8016177g.java	Thu May 07 18:15:48 2015 -0700
    47.2 +++ b/test/tools/javac/lambda/8016177/T8016177g.java	Thu Jun 04 15:32:38 2015 -0700
    47.3 @@ -1,6 +1,6 @@
    47.4  /*
    47.5   * @test /nodynamiccopyright/
    47.6 - * @bug 8016081 8016178
    47.7 + * @bug 8016081 8016178 8069545
    47.8   * @summary structural most specific and stuckness
    47.9   * @compile/fail/ref=T8016177g.out -XDrawDiagnostics T8016177g.java
   47.10   */
    48.1 --- a/test/tools/javac/lambda/8016177/T8016177g.out	Thu May 07 18:15:48 2015 -0700
    48.2 +++ b/test/tools/javac/lambda/8016177/T8016177g.out	Thu Jun 04 15:32:38 2015 -0700
    48.3 @@ -1,2 +1,3 @@
    48.4 -T8016177g.java:35:20: compiler.err.prob.found.req: (compiler.misc.possible.loss.of.precision: double, int)
    48.5 -1 error
    48.6 +T8016177g.java:34:14: compiler.err.cant.apply.symbol: kindname.method, print, java.lang.String, Test.Person, kindname.class, Test, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inferred.do.not.conform.to.upper.bounds: Test.Person, java.lang.String,java.lang.Object))
    48.7 +T8016177g.java:35:20: compiler.err.cant.apply.symbol: kindname.method, abs, int, java.lang.Double, kindname.class, Test, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.infer.no.conforming.instance.exists: , R, int))
    48.8 +2 errors
    49.1 --- a/test/tools/javac/lambda/8023389/T8023389.java	Thu May 07 18:15:48 2015 -0700
    49.2 +++ b/test/tools/javac/lambda/8023389/T8023389.java	Thu Jun 04 15:32:38 2015 -0700
    49.3 @@ -8,7 +8,7 @@
    49.4   *
    49.5   * This code is distributed in the hope that it will be useful, but WITHOUT
    49.6   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    49.7 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
    49.8 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    49.9   * version 2 for more details (a copy is included in the LICENSE file that
   49.10   * accompanied this code).
   49.11   *
    50.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    50.2 +++ b/test/tools/javac/lambda/8068399/T8068399.java	Thu Jun 04 15:32:38 2015 -0700
    50.3 @@ -0,0 +1,119 @@
    50.4 +/*
    50.5 + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
    50.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    50.7 + *
    50.8 + * This code is free software; you can redistribute it and/or modify it
    50.9 + * under the terms of the GNU General Public License version 2 only, as
   50.10 + * published by the Free Software Foundation.  Oracle designates this
   50.11 + * particular file as subject to the "Classpath" exception as provided
   50.12 + * by Oracle in the LICENSE file that accompanied this code.
   50.13 + *
   50.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
   50.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   50.16 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   50.17 + * version 2 for more details (a copy is included in the LICENSE file that
   50.18 + * accompanied this code).
   50.19 + *
   50.20 + * You should have received a copy of the GNU General Public License version
   50.21 + * 2 along with this work; if not, write to the Free Software Foundation,
   50.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   50.23 + *
   50.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   50.25 + * or visit www.oracle.com if you need additional information or have any
   50.26 + * questions.
   50.27 + */
   50.28 +/*
   50.29 + * @test
   50.30 + * @bug 8068399
   50.31 + * @summary structural most specific and stuckness
   50.32 + */
   50.33 +
   50.34 +import java.util.function.Function;
   50.35 +import java.util.stream.IntStream;
   50.36 +import java.util.stream.Stream;
   50.37 +
   50.38 +public class T8068399 {
   50.39 +
   50.40 +    public static class Spectrum {
   50.41 +        public double[] getEnergy() {
   50.42 +            return new double[0];
   50.43 +        }
   50.44 +    }
   50.45 +
   50.46 +    protected Spectrum spectrum;
   50.47 +
   50.48 +    public static class Ref<T> {
   50.49 +
   50.50 +        T value;
   50.51 +
   50.52 +        public Ref() {
   50.53 +        }
   50.54 +
   50.55 +        public Ref(T value) {
   50.56 +            this.value = value;
   50.57 +        }
   50.58 +
   50.59 +        public boolean isNull() {
   50.60 +            return value == null;
   50.61 +        }
   50.62 +
   50.63 +        public T get() {
   50.64 +            return value;
   50.65 +        }
   50.66 +
   50.67 +        public void set(T value) {
   50.68 +            this.value = value;
   50.69 +        }
   50.70 +    }
   50.71 +
   50.72 +    public static <T>T maxKey(Stream<T> stream, Function<T, Double> function) {
   50.73 +        Ref<Double> max = new Ref<>();
   50.74 +        Ref<T> index = new Ref<>();
   50.75 +        stream.forEach(v -> {
   50.76 +            Double value = function.apply(v);
   50.77 +
   50.78 +            if (max.isNull() || value > max.get()) {
   50.79 +                max.set(value);
   50.80 +                index.set(v);
   50.81 +            }
   50.82 +        });
   50.83 +
   50.84 +        return index.get();
   50.85 +    }
   50.86 +
   50.87 +    public static int interpolate(int x, int x0, int x1, int y0, int y1) {
   50.88 +        return y0 + (x - x0) * (y1 - y0) / (x1 - x0);
   50.89 +    }
   50.90 +
   50.91 +    public static double interpolate(double x, double x0, double x1, double y0, double y1) {
   50.92 +        return y0 + (x - x0) * (y1 - y0) / (x1 - x0);
   50.93 +    }
   50.94 +
   50.95 +    protected int getXByFrequency(double frequency) {
   50.96 +        return (int) Math.round(interpolate(frequency,
   50.97 +                                            getMinSpectrumCoord(),
   50.98 +                                            getMaxSpectrumCoord(),
   50.99 +                                            0, getWidth()));
  50.100 +    }
  50.101 +
  50.102 +    private int getWidth() {
  50.103 +        return 0;
  50.104 +    }
  50.105 +
  50.106 +    private double getMaxSpectrumCoord() {
  50.107 +        return 0;
  50.108 +    }
  50.109 +
  50.110 +    private double getMinSpectrumCoord() {
  50.111 +        return 0;
  50.112 +    }
  50.113 +
  50.114 +    void foo() {
  50.115 +        int maxBpmIndex = 0;
  50.116 +        int xcur = getXByFrequency(maxKey(IntStream.range(0, maxBpmIndex).boxed(),
  50.117 +                                          i -> Math.abs(spectrum.getEnergy()[i])));
  50.118 +    }
  50.119 +
  50.120 +    public static void main(String [] args) {
  50.121 +    }
  50.122 +}
    51.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    51.2 +++ b/test/tools/javac/lambda/8068430/T8068430.java	Thu Jun 04 15:32:38 2015 -0700
    51.3 @@ -0,0 +1,46 @@
    51.4 +/*
    51.5 + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
    51.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    51.7 + *
    51.8 + * This code is free software; you can redistribute it and/or modify it
    51.9 + * under the terms of the GNU General Public License version 2 only, as
   51.10 + * published by the Free Software Foundation.  Oracle designates this
   51.11 + * particular file as subject to the "Classpath" exception as provided
   51.12 + * by Oracle in the LICENSE file that accompanied this code.
   51.13 + *
   51.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
   51.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   51.16 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   51.17 + * version 2 for more details (a copy is included in the LICENSE file that
   51.18 + * accompanied this code).
   51.19 + *
   51.20 + * You should have received a copy of the GNU General Public License version
   51.21 + * 2 along with this work; if not, write to the Free Software Foundation,
   51.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   51.23 + *
   51.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   51.25 + * or visit www.oracle.com if you need additional information or have any
   51.26 + * questions.
   51.27 + */
   51.28 +
   51.29 +/*
   51.30 + * @test
   51.31 + * @bug 8068430
   51.32 + * @summary structural most specific and stuckness
   51.33 + */
   51.34 +
   51.35 +import java.util.HashMap;
   51.36 +import java.util.Map;
   51.37 +
   51.38 +public class T8068430 {
   51.39 +    public static void main(String[] args) {
   51.40 +        Map<Integer, String> mp = new HashMap<>();
   51.41 +        mp.put(1, "a");
   51.42 +        mp.put(2, "b");
   51.43 +        mp.put(3, "c");
   51.44 +        mp.put(4, "d");
   51.45 +        System.out.println(mp.entrySet().stream().reduce(0,
   51.46 +                (i, e) -> i + e.getKey(),
   51.47 +                (i1, i2) -> i1 + i2));
   51.48 +    }
   51.49 +}
   51.50 \ No newline at end of file
    52.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    52.2 +++ b/test/tools/javac/lambda/8071432/T8071432.java	Thu Jun 04 15:32:38 2015 -0700
    52.3 @@ -0,0 +1,50 @@
    52.4 +/*
    52.5 + * @test /nodynamiccopyright/
    52.6 + * @bug 8071432
    52.7 + * @summary structural most specific and stuckness
    52.8 + * @compile/fail/ref=T8071432.out -XDrawDiagnostics T8071432.java
    52.9 + */
   52.10 +
   52.11 +import java.util.Arrays;
   52.12 +import java.util.Collection;
   52.13 +
   52.14 +class T8071432 {
   52.15 +
   52.16 +    static class Point {
   52.17 +
   52.18 +        private double x, y;
   52.19 +
   52.20 +        public Point(double x, double y) {
   52.21 +            this.x = x;
   52.22 +            this.y = y;
   52.23 +        }
   52.24 +
   52.25 +        public double getX() {
   52.26 +            return x;
   52.27 +        }
   52.28 +
   52.29 +        public double getY() {
   52.30 +            return y;
   52.31 +        }
   52.32 +
   52.33 +        public double distance(Point p) {
   52.34 +            return Math.sqrt((this.x - p.x) * (this.x - p.x) +
   52.35 +                             (this.y - p.y) * (this.y - p.y));
   52.36 +        }
   52.37 +
   52.38 +        public double distance() {
   52.39 +            return Math.sqrt(this.x * this.x + this.y * this.y);
   52.40 +        }
   52.41 +
   52.42 +        public String toString() {
   52.43 +            return "(" + x + ":" + y + ")";
   52.44 +        }
   52.45 +    }
   52.46 +
   52.47 +    public static void main(String[] args) {
   52.48 +        Collection<Point> c = Arrays.asList(new Point(1.0, 0.1));
   52.49 +        System.out.println("------- 1 ---------------");
   52.50 +        System.out.println(c.stream().reduce(0.0,
   52.51 +                                            (s, p) -> s += p.distance(), (d1, d2) -> 0));
   52.52 +    }
   52.53 +}
    53.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    53.2 +++ b/test/tools/javac/lambda/8071432/T8071432.out	Thu Jun 04 15:32:38 2015 -0700
    53.3 @@ -0,0 +1,3 @@
    53.4 +T8071432.java:47:45: compiler.err.prob.found.req: (compiler.misc.infer.no.conforming.assignment.exists: U, (compiler.misc.incompatible.ret.type.in.lambda: (compiler.misc.inconvertible.types: int, java.lang.Double)))
    53.5 +T8071432.java:47:27: compiler.err.cant.apply.symbol: kindname.method, println, java.lang.Object, <any>, kindname.class, java.io.PrintStream, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.infer.no.conforming.assignment.exists: U, (compiler.misc.incompatible.ret.type.in.lambda: (compiler.misc.inconvertible.types: int, java.lang.Double))))
    53.6 +2 errors
    54.1 --- a/test/tools/javac/lambda/LambdaExprLeadsToMissingClassFilesTest.java	Thu May 07 18:15:48 2015 -0700
    54.2 +++ b/test/tools/javac/lambda/LambdaExprLeadsToMissingClassFilesTest.java	Thu Jun 04 15:32:38 2015 -0700
    54.3 @@ -1,5 +1,5 @@
    54.4  /*
    54.5 - * Copyright (c) 2012, 2014 Oracle and/or its affiliates. All rights reserved.
    54.6 + * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
    54.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    54.8   *
    54.9   * This code is free software; you can redistribute it and/or modify it
    55.1 --- a/test/tools/javac/lambda/LocalVariableTable.java	Thu May 07 18:15:48 2015 -0700
    55.2 +++ b/test/tools/javac/lambda/LocalVariableTable.java	Thu Jun 04 15:32:38 2015 -0700
    55.3 @@ -23,7 +23,7 @@
    55.4  
    55.5  /*
    55.6   * @test
    55.7 - * @bug 8025998 8026749
    55.8 + * @bug 8025998 8026749 8054220 8058227
    55.9   * @summary Missing LV table in lambda bodies
   55.10   * @compile -g LocalVariableTable.java
   55.11   * @run main LocalVariableTable
   55.12 @@ -183,7 +183,7 @@
   55.13          Run1 r = (a) -> { int x = a; };
   55.14      }
   55.15  
   55.16 -    @Expect({ "a", "x" })
   55.17 +    @Expect({ "a", "x", "v" })
   55.18      static class Lambda_Args1_Local1_Captured1 {
   55.19          void m() {
   55.20              int v = 0;
   55.21 @@ -191,7 +191,7 @@
   55.22          }
   55.23      }
   55.24  
   55.25 -    @Expect({ "a1", "a2", "x1", "x2", "this" })
   55.26 +    @Expect({ "a1", "a2", "x1", "x2", "this", "v1", "v2" })
   55.27      static class Lambda_Args2_Local2_Captured2_this {
   55.28          int v;
   55.29          void m() {
   55.30 @@ -204,7 +204,7 @@
   55.31          }
   55.32      }
   55.33  
   55.34 -    @Expect({ "e" })
   55.35 +    @Expect({ "e", "c" })
   55.36      static class Lambda_Try_Catch {
   55.37          private static Runnable asUncheckedRunnable(Closeable c) {
   55.38              return () -> {
    56.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    56.2 +++ b/test/tools/javac/linenumbers/NestedLineNumberTest.java	Thu Jun 04 15:32:38 2015 -0700
    56.3 @@ -0,0 +1,81 @@
    56.4 +/*
    56.5 + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
    56.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    56.7 + *
    56.8 + * This code is free software; you can redistribute it and/or modify it
    56.9 + * under the terms of the GNU General Public License version 2 only, as
   56.10 + * published by the Free Software Foundation.  Oracle designates this
   56.11 + * particular file as subject to the "Classpath" exception as provided
   56.12 + * by Oracle in the LICENSE file that accompanied this code.
   56.13 + *
   56.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
   56.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   56.16 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   56.17 + * version 2 for more details (a copy is included in the LICENSE file that
   56.18 + * accompanied this code).
   56.19 + *
   56.20 + * You should have received a copy of the GNU General Public License version
   56.21 + * 2 along with this work; if not, write to the Free Software Foundation,
   56.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   56.23 + *
   56.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   56.25 + * or visit www.oracle.com if you need additional information or have any
   56.26 + * questions.
   56.27 + */
   56.28 +
   56.29 +/*
   56.30 + * @test
   56.31 + * @bug 8061778
   56.32 + * @summary  Wrong LineNumberTable for default constructors
   56.33 + */
   56.34 +
   56.35 +import com.sun.tools.classfile.ClassFile;
   56.36 +import com.sun.tools.classfile.ConstantPoolException;
   56.37 +import com.sun.tools.classfile.Method;
   56.38 +import com.sun.tools.classfile.Attribute;
   56.39 +import com.sun.tools.classfile.Code_attribute;
   56.40 +import com.sun.tools.classfile.LineNumberTable_attribute;
   56.41 +import com.sun.tools.classfile.LineNumberTable_attribute.Entry;
   56.42 +
   56.43 +import java.io.IOException;
   56.44 +
   56.45 +public class NestedLineNumberTest {
   56.46 +
   56.47 +    public static void main(String[] args) throws Exception {
   56.48 +        Entry[] lines = findEntries();
   56.49 +        if (lines == null || lines.length != 1) {
   56.50 +            int found = lines == null ? 0 : lines.length;
   56.51 +            error(String.format("LineNumberTable contains wrong number of entries - expected %d, found %d", 1, found));
   56.52 +        }
   56.53 +
   56.54 +        int line = lines[0].line_number;
   56.55 +        if (line != 78) {
   56.56 +            error(String.format("LineNumberTable contains wrong line number - expected %d, found %d", 78, line));
   56.57 +        }
   56.58 +    }
   56.59 +
   56.60 +    static Entry[] findEntries() throws IOException, ConstantPoolException {
   56.61 +        ClassFile self = ClassFile.read(NestedLineNumberTest.Test.class.getResourceAsStream("NestedLineNumberTest$Test.class"));
   56.62 +        for (Method m : self.methods) {
   56.63 +            if ("<init>".equals(m.getName(self.constant_pool))) {
   56.64 +                Code_attribute code_attribute = (Code_attribute)m.attributes.get(Attribute.Code);
   56.65 +                for (Attribute at : code_attribute.attributes) {
   56.66 +                    if (Attribute.LineNumberTable.equals(at.getName(self.constant_pool))) {
   56.67 +                        return ((LineNumberTable_attribute)at).line_number_table;
   56.68 +                    }
   56.69 +                }
   56.70 +            }
   56.71 +        }
   56.72 +        return null;
   56.73 +    }
   56.74 +
   56.75 +    static void error(String msg) {
   56.76 +        throw new AssertionError(msg);
   56.77 +    }
   56.78 +
   56.79 +    // The default constructor in this class should get only one LineNumberTable entry,
   56.80 +    // pointing to the first line of the declaration of class Test.
   56.81 +    static class Test {
   56.82 +        static class Empty { }
   56.83 +    }
   56.84 +}
    57.1 --- a/test/tools/javac/resolve/tests/PrimitiveVsReferenceSamePhase.java	Thu May 07 18:15:48 2015 -0700
    57.2 +++ b/test/tools/javac/resolve/tests/PrimitiveVsReferenceSamePhase.java	Thu Jun 04 15:32:38 2015 -0700
    57.3 @@ -1,5 +1,5 @@
    57.4  /*
    57.5 - * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
    57.6 + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
    57.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    57.8   *
    57.9   * This code is free software; you can redistribute it and/or modify it
    58.1 --- a/test/tools/javac/varargs/T8049075/VarargsAndWildcardParameterizedTypeTest.java	Thu May 07 18:15:48 2015 -0700
    58.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    58.3 @@ -1,40 +0,0 @@
    58.4 -/*
    58.5 - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
    58.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    58.7 - *
    58.8 - * This code is free software; you can redistribute it and/or modify it
    58.9 - * under the terms of the GNU General Public License version 2 only, as
   58.10 - * published by the Free Software Foundation.
   58.11 - *
   58.12 - * This code is distributed in the hope that it will be useful, but WITHOUT
   58.13 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   58.14 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   58.15 - * version 2 for more details (a copy is included in the LICENSE file that
   58.16 - * accompanied this code).
   58.17 - *
   58.18 - * You should have received a copy of the GNU General Public License version
   58.19 - * 2 along with this work; if not, write to the Free Software Foundation,
   58.20 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   58.21 - *
   58.22 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   58.23 - * or visit www.oracle.com if you need additional information or have any
   58.24 - * questions.
   58.25 - */
   58.26 -
   58.27 -/*
   58.28 - * @test
   58.29 - * @bug 8049075
   58.30 - * @summary javac, wildcards and generic vararg method invocation not accepted
   58.31 - * @compile VarargsAndWildcardParameterizedTypeTest.java
   58.32 - */
   58.33 -
   58.34 -class VarargsAndWildcardParameterizedTypeTest {
   58.35 -    interface I<T> {
   58.36 -        String m(T... t);
   58.37 -    }
   58.38 -
   58.39 -    void m() {
   58.40 -        I<? super Integer> i = null;
   58.41 -        i.m(Integer.valueOf(1), Integer.valueOf(1));
   58.42 -    }
   58.43 -}
    59.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    59.2 +++ b/test/tools/javac/varargs/access/OtherPackage.java	Thu Jun 04 15:32:38 2015 -0700
    59.3 @@ -0,0 +1,36 @@
    59.4 +/*
    59.5 + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
    59.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    59.7 + *
    59.8 + * This code is free software; you can redistribute it and/or modify it
    59.9 + * under the terms of the GNU General Public License version 2 only, as
   59.10 + * published by the Free Software Foundation.
   59.11 + *
   59.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   59.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   59.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   59.15 + * version 2 for more details (a copy is included in the LICENSE file that
   59.16 + * accompanied this code).
   59.17 + *
   59.18 + * You should have received a copy of the GNU General Public License version
   59.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   59.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   59.21 + *
   59.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   59.23 + * or visit www.oracle.com if you need additional information or have any
   59.24 + * questions.
   59.25 + */
   59.26 +
   59.27 +/*
   59.28 + * Auxiliary file for VarargsInferredPrivateType
   59.29 + */
   59.30 +
   59.31 +package otherpackage;
   59.32 +
   59.33 +public class OtherPackage {
   59.34 +    public static Private getPrivate() {
   59.35 +        return new Private();
   59.36 +    }
   59.37 +
   59.38 +    private static class Private {}
   59.39 +}
   59.40 \ No newline at end of file
    60.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    60.2 +++ b/test/tools/javac/varargs/access/VarargsAndWildcardParameterizedTypeTest.java	Thu Jun 04 15:32:38 2015 -0700
    60.3 @@ -0,0 +1,42 @@
    60.4 +/*
    60.5 + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
    60.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    60.7 + *
    60.8 + * This code is free software; you can redistribute it and/or modify it
    60.9 + * under the terms of the GNU General Public License version 2 only, as
   60.10 + * published by the Free Software Foundation.
   60.11 + *
   60.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   60.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   60.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   60.15 + * version 2 for more details (a copy is included in the LICENSE file that
   60.16 + * accompanied this code).
   60.17 + *
   60.18 + * You should have received a copy of the GNU General Public License version
   60.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   60.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   60.21 + *
   60.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   60.23 + * or visit www.oracle.com if you need additional information or have any
   60.24 + * questions.
   60.25 + */
   60.26 +
   60.27 +/*
   60.28 + * @test
   60.29 + * @bug 8049075
   60.30 + * @summary javac, wildcards and generic vararg method invocation not accepted
   60.31 + * @compile VarargsAndWildcardParameterizedTypeTest.java
   60.32 + * @compile -source 8 VarargsAndWildcardParameterizedTypeTest.java
   60.33 + * @compile -source 7 VarargsAndWildcardParameterizedTypeTest.java
   60.34 + */
   60.35 +
   60.36 +class VarargsAndWildcardParameterizedTypeTest {
   60.37 +    interface I<T> {
   60.38 +        String m(T... t);
   60.39 +    }
   60.40 +
   60.41 +    void m() {
   60.42 +        I<? super Integer> i = null;
   60.43 +        i.m(Integer.valueOf(1), Integer.valueOf(1));
   60.44 +    }
   60.45 +}
    61.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    61.2 +++ b/test/tools/javac/varargs/access/VarargsAndWildcardParameterizedTypeTest2.java	Thu Jun 04 15:32:38 2015 -0700
    61.3 @@ -0,0 +1,45 @@
    61.4 +/*
    61.5 + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
    61.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    61.7 + *
    61.8 + * This code is free software; you can redistribute it and/or modify it
    61.9 + * under the terms of the GNU General Public License version 2 only, as
   61.10 + * published by the Free Software Foundation.
   61.11 + *
   61.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   61.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   61.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   61.15 + * version 2 for more details (a copy is included in the LICENSE file that
   61.16 + * accompanied this code).
   61.17 + *
   61.18 + * You should have received a copy of the GNU General Public License version
   61.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   61.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   61.21 + *
   61.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   61.23 + * or visit www.oracle.com if you need additional information or have any
   61.24 + * questions.
   61.25 + */
   61.26 +
   61.27 +/*
   61.28 + * @test
   61.29 + * @bug 8075520
   61.30 + * @summary Varargs access check mishandles capture variables
   61.31 + * @compile VarargsAndWildcardParameterizedTypeTest2.java
   61.32 + * @compile -source 8 VarargsAndWildcardParameterizedTypeTest2.java
   61.33 + * @compile -source 7 VarargsAndWildcardParameterizedTypeTest2.java
   61.34 + */
   61.35 +
   61.36 +class VarargsAndWildcardParameterizedTypeTest2 {
   61.37 +    interface I {
   61.38 +        <T> void m(T... t);
   61.39 +    }
   61.40 +
   61.41 +    interface Box<T> {
   61.42 +        T get();
   61.43 +    }
   61.44 +
   61.45 +    void m(I i, Box<? extends Number> b) {
   61.46 +        i.m(b.get());
   61.47 +    }
   61.48 +}
    62.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    62.2 +++ b/test/tools/javac/varargs/access/VarargsAndWildcardParameterizedTypeTest3.java	Thu Jun 04 15:32:38 2015 -0700
    62.3 @@ -0,0 +1,43 @@
    62.4 +/*
    62.5 + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
    62.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    62.7 + *
    62.8 + * This code is free software; you can redistribute it and/or modify it
    62.9 + * under the terms of the GNU General Public License version 2 only, as
   62.10 + * published by the Free Software Foundation.
   62.11 + *
   62.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   62.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   62.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   62.15 + * version 2 for more details (a copy is included in the LICENSE file that
   62.16 + * accompanied this code).
   62.17 + *
   62.18 + * You should have received a copy of the GNU General Public License version
   62.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   62.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   62.21 + *
   62.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   62.23 + * or visit www.oracle.com if you need additional information or have any
   62.24 + * questions.
   62.25 + */
   62.26 +
   62.27 +/*
   62.28 + * @test
   62.29 + * @bug 8075520
   62.30 + * @summary Varargs access check mishandles capture variables
   62.31 + * @compile VarargsAndWildcardParameterizedTypeTest3.java
   62.32 + * @compile -source 8 VarargsAndWildcardParameterizedTypeTest3.java
   62.33 + * @compile -source 7 VarargsAndWildcardParameterizedTypeTest3.java
   62.34 + */
   62.35 +
   62.36 +class VarargsAndWildcardParameterizedTypeTest2 {
   62.37 +    interface I {
   62.38 +        <T> void m(Box<? extends T> iter, T... t);
   62.39 +    }
   62.40 +
   62.41 +    interface Box<T> {}
   62.42 +
   62.43 +    void m(I i, Box<? extends Number> b) {
   62.44 +        i.m(b);
   62.45 +    }
   62.46 +}
    63.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    63.2 +++ b/test/tools/javac/varargs/access/VarargsAndWildcardParameterizedTypeTest4.java	Thu Jun 04 15:32:38 2015 -0700
    63.3 @@ -0,0 +1,43 @@
    63.4 +/*
    63.5 + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
    63.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    63.7 + *
    63.8 + * This code is free software; you can redistribute it and/or modify it
    63.9 + * under the terms of the GNU General Public License version 2 only, as
   63.10 + * published by the Free Software Foundation.
   63.11 + *
   63.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   63.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   63.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   63.15 + * version 2 for more details (a copy is included in the LICENSE file that
   63.16 + * accompanied this code).
   63.17 + *
   63.18 + * You should have received a copy of the GNU General Public License version
   63.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   63.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   63.21 + *
   63.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   63.23 + * or visit www.oracle.com if you need additional information or have any
   63.24 + * questions.
   63.25 + */
   63.26 +
   63.27 +/*
   63.28 + * @test
   63.29 + * @bug 8075520
   63.30 + * @summary Varargs access check mishandles capture variables
   63.31 + * @compile VarargsAndWildcardParameterizedTypeTest4.java
   63.32 + * @compile -source 8 VarargsAndWildcardParameterizedTypeTest4.java
   63.33 + * @compile -source 7 VarargsAndWildcardParameterizedTypeTest4.java
   63.34 + */
   63.35 +
   63.36 +class VarargsAndWildcardParameterizedTypeTest2 {
   63.37 +    interface I {
   63.38 +        <T> void m(Box<T> iter, T... t);
   63.39 +    }
   63.40 +
   63.41 +    interface Box<T> {}
   63.42 +
   63.43 +    void m(I i, Box<? extends Number> b) {
   63.44 +        i.m(b);
   63.45 +    }
   63.46 +}
    64.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    64.2 +++ b/test/tools/javac/varargs/access/VarargsInferredPrivateType-source7.out	Thu Jun 04 15:32:38 2015 -0700
    64.3 @@ -0,0 +1,4 @@
    64.4 +VarargsInferredPrivateType.java:16:10: compiler.err.cant.apply.symbol: kindname.method, m, T[], otherpackage.OtherPackage.Private, kindname.interface, VarargsInferredPrivateType.I, (compiler.misc.inaccessible.varargs.type: otherpackage.OtherPackage.Private, kindname.class, VarargsInferredPrivateType)
    64.5 +- compiler.note.unchecked.filename: VarargsInferredPrivateType.java
    64.6 +- compiler.note.unchecked.recompile
    64.7 +1 error
    65.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    65.2 +++ b/test/tools/javac/varargs/access/VarargsInferredPrivateType.java	Thu Jun 04 15:32:38 2015 -0700
    65.3 @@ -0,0 +1,18 @@
    65.4 +/*
    65.5 + * @test /nodynamiccopyright/
    65.6 + * @bug 8077786
    65.7 + * @summary Check varargs access against inferred signature
    65.8 + * @compile/fail/ref=VarargsInferredPrivateType.out -nowarn -XDrawDiagnostics VarargsInferredPrivateType.java OtherPackage.java
    65.9 + * @compile/fail/ref=VarargsInferredPrivateType.out -source 8 -nowarn -XDrawDiagnostics VarargsInferredPrivateType.java OtherPackage.java
   65.10 + * @compile/fail/ref=VarargsInferredPrivateType-source7.out -source 7 -nowarn -XDrawDiagnostics VarargsInferredPrivateType.java OtherPackage.java
   65.11 + */
   65.12 +
   65.13 +class VarargsInferredPrivateType {
   65.14 +    interface I {
   65.15 +        <T> void m(T... t);
   65.16 +    }
   65.17 +
   65.18 +    void m(I i) {
   65.19 +        i.m(otherpackage.OtherPackage.getPrivate());
   65.20 +    }
   65.21 +}
    66.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    66.2 +++ b/test/tools/javac/varargs/access/VarargsInferredPrivateType.out	Thu Jun 04 15:32:38 2015 -0700
    66.3 @@ -0,0 +1,4 @@
    66.4 +VarargsInferredPrivateType.java:16:12: compiler.err.prob.found.req: (compiler.misc.inaccessible.varargs.type: otherpackage.OtherPackage.Private, kindname.class, VarargsInferredPrivateType)
    66.5 +- compiler.note.unchecked.filename: VarargsInferredPrivateType.java
    66.6 +- compiler.note.unchecked.recompile
    66.7 +1 error
    67.1 --- a/test/tools/jdeps/APIDeps.java	Thu May 07 18:15:48 2015 -0700
    67.2 +++ b/test/tools/jdeps/APIDeps.java	Thu Jun 04 15:32:38 2015 -0700
    67.3 @@ -90,8 +90,9 @@
    67.4               new String[] {"-classpath", testDir.getPath(), "-verbose:class", "-filter:none", "-P"});
    67.5          test(new File(mDir, "Gee.class"),
    67.6               new String[] {"g.G", "sun.misc.Lock", "com.sun.tools.classfile.ClassFile",
    67.7 -                           "com.sun.management.ThreadMXBean", "com.sun.source.tree.BinaryTree"},
    67.8 -             new String[] {testDirBasename, "JDK internal API", "compact3", ""},
    67.9 +                           "com.sun.management.ThreadMXBean", "com.sun.source.tree.BinaryTree",
   67.10 +                           "org.w3c.dom.css.CSSValue"},
   67.11 +             new String[] {testDirBasename, "JDK internal API", "compact2", "compact3", ""},
   67.12               new String[] {"-classpath", testDir.getPath(), "-verbose", "-P"});
   67.13  
   67.14          // -jdkinternals
    68.1 --- a/test/tools/jdeps/Basic.java	Thu May 07 18:15:48 2015 -0700
    68.2 +++ b/test/tools/jdeps/Basic.java	Thu Jun 04 15:32:38 2015 -0700
    68.3 @@ -23,9 +23,9 @@
    68.4  
    68.5  /*
    68.6   * @test
    68.7 - * @bug 8003562 8005428 8015912 8027481 8048063
    68.8 + * @bug 8003562 8005428 8015912 8027481 8048063 8068937
    68.9   * @summary Basic tests for jdeps tool
   68.10 - * @build Test p.Foo p.Bar javax.activity.NotCompactProfile
   68.11 + * @build Test p.Foo p.Bar p.C p.SubClass q.Gee javax.activity.NotCompactProfile
   68.12   * @run main Basic
   68.13   */
   68.14  
   68.15 @@ -111,6 +111,19 @@
   68.16               new String[] {"compact1"},
   68.17               new String[] {"-verbose:package", "-e", "java\\.lang\\..*"});
   68.18  
   68.19 +        // parse p.C, p.SubClass and q.*
   68.20 +        // p.SubClass have no dependency other than p.C
   68.21 +        // q.Gee depends on p.SubClass that should be found
   68.22 +        test(testDir,
   68.23 +             new String[] {"java.lang", "p"},
   68.24 +             new String[] {"compact1", testDir.getName()},
   68.25 +             new String[] {"-include", "p.C|p.SubClass|q\\..*"});
   68.26 +        test(testDir,
   68.27 +             new String[] {"java.lang", "p"},
   68.28 +             new String[] {"compact1", testDir.getName()},
   68.29 +             new String[] {"-classpath", testDir.getPath(), "-include", "p.C|p.SubClass|q\\..*"});
   68.30 +
   68.31 +
   68.32          // test -classpath and -include options
   68.33          test(null,
   68.34               new String[] {"java.lang", "java.util", "java.lang.management",
    69.1 --- a/test/tools/jdeps/m/Gee.java	Thu May 07 18:15:48 2015 -0700
    69.2 +++ b/test/tools/jdeps/m/Gee.java	Thu Jun 04 15:32:38 2015 -0700
    69.3 @@ -29,4 +29,5 @@
    69.4      public com.sun.tools.classfile.ClassFile cf;     // @jdk.Exported(false)
    69.5      public com.sun.source.tree.BinaryTree tree;      // @jdk.Exported
    69.6      public com.sun.management.ThreadMXBean mxbean;   // @jdk.Exported on package-info
    69.7 +    public org.w3c.dom.css.CSSValue value;           // special case
    69.8  }
    70.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    70.2 +++ b/test/tools/jdeps/p/C.java	Thu Jun 04 15:32:38 2015 -0700
    70.3 @@ -0,0 +1,30 @@
    70.4 +/*
    70.5 + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
    70.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    70.7 + *
    70.8 + * This code is free software; you can redistribute it and/or modify it
    70.9 + * under the terms of the GNU General Public License version 2 only, as
   70.10 + * published by the Free Software Foundation.
   70.11 + *
   70.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   70.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   70.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   70.15 + * version 2 for more details (a copy is included in the LICENSE file that
   70.16 + * accompanied this code).
   70.17 + *
   70.18 + * You should have received a copy of the GNU General Public License version
   70.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   70.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   70.21 + *
   70.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   70.23 + * or visit www.oracle.com if you need additional information or have any
   70.24 + * questions.
   70.25 + */
   70.26 +
   70.27 +package p;
   70.28 +
   70.29 +public class C {
   70.30 +    public String name() {
   70.31 +        return "C";
   70.32 +    }
   70.33 +}
    71.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    71.2 +++ b/test/tools/jdeps/p/SubClass.java	Thu Jun 04 15:32:38 2015 -0700
    71.3 @@ -0,0 +1,28 @@
    71.4 +/*
    71.5 + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
    71.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    71.7 + *
    71.8 + * This code is free software; you can redistribute it and/or modify it
    71.9 + * under the terms of the GNU General Public License version 2 only, as
   71.10 + * published by the Free Software Foundation.
   71.11 + *
   71.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   71.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   71.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   71.15 + * version 2 for more details (a copy is included in the LICENSE file that
   71.16 + * accompanied this code).
   71.17 + *
   71.18 + * You should have received a copy of the GNU General Public License version
   71.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   71.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   71.21 + *
   71.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   71.23 + * or visit www.oracle.com if you need additional information or have any
   71.24 + * questions.
   71.25 + */
   71.26 +
   71.27 +package p;
   71.28 +
   71.29 +// SubClass only references types in package p
   71.30 +public class SubClass extends C {
   71.31 +}
    72.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    72.2 +++ b/test/tools/jdeps/q/Gee.java	Thu Jun 04 15:32:38 2015 -0700
    72.3 @@ -0,0 +1,27 @@
    72.4 +/*
    72.5 + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
    72.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    72.7 + *
    72.8 + * This code is free software; you can redistribute it and/or modify it
    72.9 + * under the terms of the GNU General Public License version 2 only, as
   72.10 + * published by the Free Software Foundation.
   72.11 + *
   72.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   72.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   72.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   72.15 + * version 2 for more details (a copy is included in the LICENSE file that
   72.16 + * accompanied this code).
   72.17 + *
   72.18 + * You should have received a copy of the GNU General Public License version
   72.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   72.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   72.21 + *
   72.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   72.23 + * or visit www.oracle.com if you need additional information or have any
   72.24 + * questions.
   72.25 + */
   72.26 +
   72.27 +package q;
   72.28 +
   72.29 +public class Gee extends p.SubClass {
   72.30 +}

mercurial