InferStrict.java revision 3031:286fc9270404
162053Smarkm/*
2128059Smarkm * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
362053Smarkm * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
462053Smarkm *
562053Smarkm * This code is free software; you can redistribute it and/or modify it
662053Smarkm * under the terms of the GNU General Public License version 2 only, as
762053Smarkm * published by the Free Software Foundation.  Oracle designates this
862053Smarkm * particular file as subject to the "Classpath" exception as provided
962053Smarkm * by Oracle in the LICENSE file that accompanied this code.
1062053Smarkm *
1162053Smarkm * This code is distributed in the hope that it will be useful, but WITHOUT
1262053Smarkm * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1362053Smarkm * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1462053Smarkm * version 2 for more details (a copy is included in the LICENSE file that
1562053Smarkm * accompanied this code).
1662053Smarkm *
1762053Smarkm * You should have received a copy of the GNU General Public License version
1862053Smarkm * 2 along with this work; if not, write to the Free Software Foundation,
1962053Smarkm * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2062053Smarkm *
2162053Smarkm * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2262053Smarkm * or visit www.oracle.com if you need additional information or have any
2362053Smarkm * questions.
2462053Smarkm */
2562053Smarkm
2662053Smarkm /*
2762053Smarkm  * @test
28119418Sobrien  * @bug 8078093
29119418Sobrien  * @summary Exponential performance regression Java 8 compiler compared to Java 7 compiler
30119418Sobrien  * @compile InferStrict.java
3162053Smarkm  */
3262053Smarkmimport java.util.HashSet;
3376166Smarkmimport java.util.Set;
3462053Smarkm
3576166Smarkmclass InferStrict {
3674771Smarkm    public <T> Set<T> compute(Set<T> t) { return t; }
3762053Smarkm    public <T> T join(Set<T> t1, Set<T> t2) { return null; }
3874072Smarkm    public <T extends InferStrict> T compute() { return null; }
3976166Smarkm    public void test() {
4062053Smarkm        join(
4176166Smarkm            compute(compute(compute(compute(compute(compute(compute(compute(compute(compute(compute(compute(compute(compute(compute(compute(compute(new HashSet<>()))))))))))))))))),
4267112Smarkm            compute(compute(compute(compute(compute(compute(compute(compute(compute(compute(compute(compute(compute(compute(compute(compute(compute(new HashSet<String>())))))))))))))))))
4383366Sjulian        ).length();
4470834Swollman     }
4576166Smarkm}
4676166Smarkm