test/langtools/tools/doclint/LambdaTest.java
author jjg
Thu, 04 Jan 2018 12:55:06 -0800
changeset 48441 9c37fbceb579
permissions -rw-r--r--
8194069: doclint throws missing comment warnings on lines which can't even have javadoc Reviewed-by: ksrini
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
48441
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
     1
/*
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
     2
 * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
     4
 *
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
     7
 * published by the Free Software Foundation.
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
     8
 *
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
    13
 * accompanied this code).
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
    14
 *
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
    18
 *
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
    21
 * questions.
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
    22
 */
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
    23
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
    24
/*
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
    25
 * @test
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
    26
 * @bug 8194069
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
    27
 * @summary ignore declarations in lambda expressions
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
    28
 * @modules jdk.compiler/com.sun.tools.doclint
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
    29
 * @build DocLintTester
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
    30
 * @run main DocLintTester -Xmsgs:all SyntheticTest.java
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
    31
 */
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
    32
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
    33
package acme;
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
    34
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
    35
import java.util.Arrays;
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
    36
import java.util.Set;
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
    37
import java.util.function.Function;
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
    38
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
    39
/**
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
    40
 * The class has docs.
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
    41
 */
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
    42
public final class LambdaTest
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
    43
{
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
    44
    /**
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
    45
     * The field itself has docs.
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
    46
     */
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
    47
    // Ensure no warning for lambda parameter, at 'string ->'
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
    48
    static final Function<String, String> someFunction = string -> {
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
    49
        // Ensure no warning for 'localVariable'
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
    50
        int localVariable = 3;
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
    51
        return Integer.toString(localVariable);
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
    52
    };
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
    53
}
9c37fbceb579 8194069: doclint throws missing comment warnings on lines which can't even have javadoc
jjg
parents:
diff changeset
    54