MethodRedundantTypeargs.java revision 2758:3c1b5fcf6fad
1107120Sjulian/*
2107120Sjulian * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
3107120Sjulian * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4107120Sjulian *
5107120Sjulian * This code is free software; you can redistribute it and/or modify it
6107120Sjulian * under the terms of the GNU General Public License version 2 only, as
7107120Sjulian * published by the Free Software Foundation.  Oracle designates this
8107120Sjulian * particular file as subject to the "Classpath" exception as provided
9107120Sjulian * by Oracle in the LICENSE file that accompanied this code.
10107120Sjulian *
11107120Sjulian * This code is distributed in the hope that it will be useful, but WITHOUT
12107120Sjulian * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13107120Sjulian * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14107120Sjulian * version 2 for more details (a copy is included in the LICENSE file that
15107120Sjulian * accompanied this code).
16107120Sjulian *
17107120Sjulian * You should have received a copy of the GNU General Public License version
18107120Sjulian * 2 along with this work; if not, write to the Free Software Foundation,
19107120Sjulian * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20107120Sjulian *
21107120Sjulian * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22107120Sjulian * or visit www.oracle.com if you need additional information or have any
23107120Sjulian * questions.
24107120Sjulian */
25107120Sjulian
26107120Sjulian// key: compiler.warn.method.redundant.typeargs
27107120Sjulian// options: -XDfind=method
28121054Semax
29107120Sjulianclass MethodRedundantTypeargs {
30107120Sjulian    <Z> Z id(Z z) { return z; }
31107120Sjulian
32121054Semax    void test() {
33121054Semax        String s = this.<String>id("");
34121054Semax    }
35107120Sjulian}
36107120Sjulian