aboutsummaryrefslogtreecommitdiffstats
path: root/bundle-plugin/src/test/java/com/yahoo/container/plugin/classanalysis/sampleclasses/SwitchStatement.java
blob: f665d31150e7c565993993489fba491bf12d78d1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package com.yahoo.container.plugin.classanalysis.sampleclasses;

import java.util.Collection;
import java.util.List;
import java.util.Set;

/**
 * Input for class analysis test verifying Java 14 switch statement.
 *
 * @author gjoranv
 */
public class SwitchStatement {

    void switchStatement() throws Exception{
        String foo = "";
        Collection<?> c = switch (foo) {
            case "list" -> List.of();
            case "set" -> Set.of();
            default -> throw new IllegalArgumentException();
        };
    }
}