Merge

Fri, 17 Jul 2009 09:14:45 -0700

author
tbell
date
Fri, 17 Jul 2009 09:14:45 -0700
changeset 327
86ad2753f3be
parent 321
634f519d6f9a
parent 326
90d40dd5cfc7
child 328
99b7a25185aa

Merge

     1.1 --- a/src/share/classes/com/sun/tools/javac/comp/Resolve.java	Thu Jul 16 10:53:31 2009 -0700
     1.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Resolve.java	Fri Jul 17 09:14:45 2009 -0700
     1.3 @@ -251,7 +251,8 @@
     1.4              return true;
     1.5          else {
     1.6              Symbol s2 = ((MethodSymbol)sym).implementation(site.tsym, types, true);
     1.7 -            return (s2 == null || s2 == sym);
     1.8 +            return (s2 == null || s2 == sym ||
     1.9 +                    !types.isSubSignature(types.memberType(site, s2), types.memberType(site, sym)));
    1.10          }
    1.11      }
    1.12      //where
     2.1 --- a/src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java	Thu Jul 16 10:53:31 2009 -0700
     2.2 +++ b/src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java	Fri Jul 17 09:14:45 2009 -0700
     2.3 @@ -569,7 +569,8 @@
     2.4          @Override
     2.5          public Void visitMethodSymbol(MethodSymbol s, Void ignored) {
     2.6              visit(s.owner, null);
     2.7 -            typePreprocessor.visit(s.type);
     2.8 +            if (s.type != null)
     2.9 +                typePreprocessor.visit(s.type);
    2.10              return null;
    2.11          }
    2.12      };
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/test/tools/javac/Diagnostics/6860795/T6860795.java	Fri Jul 17 09:14:45 2009 -0700
     3.3 @@ -0,0 +1,34 @@
     3.4 +/*
     3.5 + * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
     3.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3.7 + *
     3.8 + * This code is free software; you can redistribute it and/or modify it
     3.9 + * under the terms of the GNU General Public License version 2 only, as
    3.10 + * published by the Free Software Foundation.
    3.11 + *
    3.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
    3.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    3.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    3.15 + * version 2 for more details (a copy is included in the LICENSE file that
    3.16 + * accompanied this code).
    3.17 + *
    3.18 + * You should have received a copy of the GNU General Public License version
    3.19 + * 2 along with this work; if not, write to the Free Software Foundation,
    3.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    3.21 + *
    3.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    3.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
    3.24 + * have any questions.
    3.25 + */
    3.26 +
    3.27 +/**
    3.28 + * @test
    3.29 + * @bug     6860795
    3.30 + * @summary NullPointerException when compiling a negative java source
    3.31 + * @author  mcimadamore
    3.32 + * @compile/fail/ref=T6860795.out -XDrawDiagnostics  T6860795.java
    3.33 + */
    3.34 +
    3.35 +class Test {
    3.36 +    void foo(float x, int x) {}
    3.37 +}
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/test/tools/javac/Diagnostics/6860795/T6860795.out	Fri Jul 17 09:14:45 2009 -0700
     4.3 @@ -0,0 +1,2 @@
     4.4 +T6860795.java:33:27: compiler.err.already.defined: x, foo
     4.5 +1 error
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/test/tools/javac/generics/rawOverride/T6846972.java	Fri Jul 17 09:14:45 2009 -0700
     5.3 @@ -0,0 +1,49 @@
     5.4 +/*
     5.5 + * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
     5.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     5.7 + *
     5.8 + * This code is free software; you can redistribute it and/or modify it
     5.9 + * under the terms of the GNU General Public License version 2 only, as
    5.10 + * published by the Free Software Foundation.
    5.11 + *
    5.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
    5.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    5.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    5.15 + * version 2 for more details (a copy is included in the LICENSE file that
    5.16 + * accompanied this code).
    5.17 + *
    5.18 + * You should have received a copy of the GNU General Public License version
    5.19 + * 2 along with this work; if not, write to the Free Software Foundation,
    5.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    5.21 + *
    5.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    5.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
    5.24 + * have any questions.
    5.25 + */
    5.26 +
    5.27 +/*
    5.28 + * @test
    5.29 + * @bug 6846972
    5.30 + * @summary cannot access member of raw type when erasure change overriding into overloading
    5.31 + * @author mcimadamore
    5.32 + * @compile T6846972.java
    5.33 + */
    5.34 +
    5.35 +import java.util.EnumMap;
    5.36 +
    5.37 +public class T6846972 {
    5.38 +
    5.39 +    enum Suit {
    5.40 +        CLUBS, DIAMONDS;
    5.41 +    }
    5.42 +
    5.43 +    static Object [] array = {
    5.44 +        Suit.CLUBS, "value1",
    5.45 +        Suit.DIAMONDS, "value2"
    5.46 +    };
    5.47 +
    5.48 +    static void test() {
    5.49 +        EnumMap map = new EnumMap(Suit.class);
    5.50 +        map.put(array[0], array[1]);
    5.51 +    }
    5.52 +}

mercurial