• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

hazendaz / jmockit1 / 496

15 Nov 2025 05:33PM UTC coverage: 72.192% (-0.008%) from 72.2%
496

push

github

web-flow
Merge pull request #412 from hazendaz/renovate/major-spring-core

Update spring core to v7 (major)

5677 of 8360 branches covered (67.91%)

Branch coverage included in aggregate %.

11922 of 16018 relevant lines covered (74.43%)

0.74 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

86.36
/main/src/main/java/mockit/internal/state/ParameterNames.java
1
/*
2
 * MIT License
3
 * Copyright (c) 2006-2025 JMockit developers
4
 * See LICENSE file for full license text.
5
 */
6
package mockit.internal.state;
7

8
import edu.umd.cs.findbugs.annotations.NonNull;
9
import edu.umd.cs.findbugs.annotations.Nullable;
10

11
import java.util.HashMap;
12
import java.util.Map;
13

14
import mockit.internal.util.TestMethod;
15

16
import org.checkerframework.checker.index.qual.NonNegative;
17

18
public final class ParameterNames {
19
    private static final Map<String, Map<String, String[]>> classesToMethodsToParameters = new HashMap<>();
1✔
20

21
    private ParameterNames() {
22
    }
23

24
    public static boolean hasNamesForClass(@NonNull String classDesc) {
25
        return classesToMethodsToParameters.containsKey(classDesc);
1✔
26
    }
27

28
    public static void register(@NonNull String classDesc, @NonNull String memberName, @NonNull String memberDesc,
29
            @NonNull String[] names) {
30
        Map<String, String[]> methodsToParameters = classesToMethodsToParameters.get(classDesc);
1✔
31

32
        if (methodsToParameters == null) {
1✔
33
            methodsToParameters = new HashMap<>();
1✔
34
            classesToMethodsToParameters.put(classDesc, methodsToParameters);
1✔
35
        }
36

37
        String methodKey = memberName + memberDesc;
1✔
38
        methodsToParameters.put(methodKey, names);
1✔
39
    }
1✔
40

41
    @NonNull
42
    public static String getName(@NonNull TestMethod method, @NonNegative int index) {
43
        String name = getName(method.testClassDesc, method.testMethodDesc, index);
1✔
44
        return name == null ? "param" + index : name;
1!
45
    }
46

47
    @Nullable
48
    public static String getName(@NonNull String classDesc, @NonNull String methodDesc, @NonNegative int index) {
49
        Map<String, String[]> methodsToParameters = classesToMethodsToParameters.get(classDesc);
1✔
50

51
        if (methodsToParameters == null) {
1!
52
            return null;
×
53
        }
54

55
        String[] parameterNames = methodsToParameters.get(methodDesc);
1✔
56
        return parameterNames[index];
1✔
57
    }
58
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc