T4695847.java revision 0
3887N/A/*
3887N/A * Copyright 2002 Sun Microsystems, Inc. All Rights Reserved.
3887N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3887N/A *
3887N/A * This code is free software; you can redistribute it and/or modify it
3887N/A * under the terms of the GNU General Public License version 2 only, as
3887N/A * published by the Free Software Foundation.
3887N/A *
3887N/A * This code is distributed in the hope that it will be useful, but WITHOUT
3887N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3887N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
3887N/A * version 2 for more details (a copy is included in the LICENSE file that
3887N/A * accompanied this code).
3887N/A *
3887N/A * You should have received a copy of the GNU General Public License version
3887N/A * 2 along with this work; if not, write to the Free Software Foundation,
3887N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
3887N/A *
3887N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
3887N/A * CA 95054 USA or visit www.sun.com if you need additional information or
3887N/A * have any questions.
3887N/A */
3887N/A
3887N/A/*
3887N/A * @test
3887N/A * @bug 4695847
3887N/A * @summary generics: problem with inference of primitive return values
3887N/A * @author gafter
3887N/A *
3887N/A * @compile -source 1.5 T4695847.java
3887N/A */
3887N/A
3887N/Apublic class T4695847<T> {
3887N/A T4695847<T> next;
3887N/A static <T> int size(T4695847<T> bt) {
3887N/A if (bt==null)
3887N/A return 0;
3887N/A else
3887N/A return 1+size(bt.next);
3887N/A }
3887N/A static <T> int size2(T4695847<T> bt) {
3887N/A return (bt==null) ? 0 : 1+size(bt.next);
3887N/A }
3887N/A}
3887N/A