test/langtools/tools/javac/diags/examples/LambdaDeduplicate.java
author cushon
Tue, 27 Mar 2018 13:48:16 -0400
changeset 49429 752ecccb0b7f
child 49518 d0ff431a596e
permissions -rw-r--r--
8200301: deduplicate lambda methods Reviewed-by: vromero, mcimadamore
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
49429
752ecccb0b7f 8200301: deduplicate lambda methods
cushon
parents:
diff changeset
     1
/*
752ecccb0b7f 8200301: deduplicate lambda methods
cushon
parents:
diff changeset
     2
 * Copyright (c) 2018, Google LLC. All rights reserved.
752ecccb0b7f 8200301: deduplicate lambda methods
cushon
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
752ecccb0b7f 8200301: deduplicate lambda methods
cushon
parents:
diff changeset
     4
 *
752ecccb0b7f 8200301: deduplicate lambda methods
cushon
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
752ecccb0b7f 8200301: deduplicate lambda methods
cushon
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
752ecccb0b7f 8200301: deduplicate lambda methods
cushon
parents:
diff changeset
     7
 * published by the Free Software Foundation.
752ecccb0b7f 8200301: deduplicate lambda methods
cushon
parents:
diff changeset
     8
 *
752ecccb0b7f 8200301: deduplicate lambda methods
cushon
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
752ecccb0b7f 8200301: deduplicate lambda methods
cushon
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
752ecccb0b7f 8200301: deduplicate lambda methods
cushon
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
752ecccb0b7f 8200301: deduplicate lambda methods
cushon
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
752ecccb0b7f 8200301: deduplicate lambda methods
cushon
parents:
diff changeset
    13
 * accompanied this code).
752ecccb0b7f 8200301: deduplicate lambda methods
cushon
parents:
diff changeset
    14
 *
752ecccb0b7f 8200301: deduplicate lambda methods
cushon
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
752ecccb0b7f 8200301: deduplicate lambda methods
cushon
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
752ecccb0b7f 8200301: deduplicate lambda methods
cushon
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
752ecccb0b7f 8200301: deduplicate lambda methods
cushon
parents:
diff changeset
    18
 *
752ecccb0b7f 8200301: deduplicate lambda methods
cushon
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
752ecccb0b7f 8200301: deduplicate lambda methods
cushon
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
752ecccb0b7f 8200301: deduplicate lambda methods
cushon
parents:
diff changeset
    21
 * questions.
752ecccb0b7f 8200301: deduplicate lambda methods
cushon
parents:
diff changeset
    22
 */
752ecccb0b7f 8200301: deduplicate lambda methods
cushon
parents:
diff changeset
    23
752ecccb0b7f 8200301: deduplicate lambda methods
cushon
parents:
diff changeset
    24
752ecccb0b7f 8200301: deduplicate lambda methods
cushon
parents:
diff changeset
    25
// key: compiler.note.verbose.l2m.deduplicate
752ecccb0b7f 8200301: deduplicate lambda methods
cushon
parents:
diff changeset
    26
// options: --debug:dumpLambdaToMethodDeduplication
752ecccb0b7f 8200301: deduplicate lambda methods
cushon
parents:
diff changeset
    27
752ecccb0b7f 8200301: deduplicate lambda methods
cushon
parents:
diff changeset
    28
import java.util.function.Function;
752ecccb0b7f 8200301: deduplicate lambda methods
cushon
parents:
diff changeset
    29
752ecccb0b7f 8200301: deduplicate lambda methods
cushon
parents:
diff changeset
    30
public class LambdaDeduplicate {
752ecccb0b7f 8200301: deduplicate lambda methods
cushon
parents:
diff changeset
    31
  Function<Integer, Integer> f1 = x -> x;
752ecccb0b7f 8200301: deduplicate lambda methods
cushon
parents:
diff changeset
    32
  Function<Integer, Integer> f2 = x -> x;
752ecccb0b7f 8200301: deduplicate lambda methods
cushon
parents:
diff changeset
    33
}