aboutsummaryrefslogtreecommitdiffstats
path: root/bundle-plugin/src/test/java/com/yahoo/container/plugin/classanalysis/sampleclasses/Methods.java
blob: 63acfb776e0fab8847cb64a993cd64dad538b496 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.container.plugin.classanalysis.sampleclasses;

import java.util.List;
import java.util.Map;
import java.util.function.Supplier;

/**
 * Input for class analysis tests.
 * @author Tony Vaagenes
 */
@SuppressWarnings("unused")
public class Methods {

    public void method1() {
        Base b = new Base();
        System.out.println(Fields.field2.size());

        Object o = new Interface1[1][2][3];
        int[][][] arr = new int[1][2][3];
        int[] arr2 = new int[1];

        System.out.println(new int[1].length + "--" + arr2[0]);

        int[][] exerciseTypeInsn = new int[1][];

        Runnable methodHandle = ClassWithMethod::test;
    }

    public static void method2() {
        Derived d = new Derived();
    }

    public void  method3() {
        var result = methodTakingFunctionalArgument((Interface3)() -> "hello");
        System.out.println(result);
    }

    public String methodTakingFunctionalArgument(Supplier<String> function) {
        return function.get();
    }

    public void methodTakingGenericArgument(Map<String, List<Dummy>> map) {}

}