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

leeonky / test-charm-java / 287

04 Sep 2025 02:56PM UTC coverage: 74.315% (+0.008%) from 74.307%
287

push

circleci

leeonky
Support overloading method in should

19 of 22 new or added lines in 2 files covered. (86.36%)

8107 of 10909 relevant lines covered (74.31%)

0.74 hits per line

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

86.36
/DAL-java/src/main/java/com/github/leeonky/dal/runtime/CurryingArgument.java
1
package com.github.leeonky.dal.runtime;
2

3
import com.github.leeonky.dal.runtime.inspector.DumpingBuffer;
4
import com.github.leeonky.util.ConvertException;
5

6
import java.lang.reflect.Parameter;
7

8
import static com.github.leeonky.util.NumberType.boxedClass;
9

10
public class CurryingArgument {
11
    private final Parameter parameter;
12
    protected final Data<?> data;
13
    private Object properType;
14

15
    public CurryingArgument(Parameter parameter, Data<?> data) {
1✔
16
        this.parameter = parameter;
1✔
17
        this.data = data;
1✔
18
    }
1✔
19

20
    public boolean isSameType() {
21
        return data.value() != null && boxedClass(data.value().getClass()).equals(boxedClass(parameter.getType()));
1✔
22
    }
23

24
    public boolean isSuperType() {
25
        return data.value() != null && boxedClass(parameter.getType()).isInstance(data.value());
1✔
26
    }
27

28
    public boolean isConvertibleType() {
29
        try {
30
            properType();
1✔
31
            return true;
1✔
32
        } catch (ConvertException ignore) {
1✔
33
            return false;
1✔
34
        }
35
    }
36

37
    public Object properType() {
38
        if (properType == null)
1✔
39
            properType = data.convert(parameter.getType()).value();
1✔
40
        return properType;
1✔
41
    }
42

43
    public void dumpParameter(DumpingBuffer indentBuffer) {
44
        indentBuffer.newLine().dumpValue(data);
1✔
45
    }
1✔
46

47
    public static class Extraneous extends CurryingArgument {
48

49
        public Extraneous(Data<Object> data) {
50
            super(null, data);
1✔
51
        }
1✔
52

53
        @Override
54
        public boolean isConvertibleType() {
NEW
55
            return false;
×
56
        }
57

58
        @Override
59
        public boolean isSameType() {
NEW
60
            return false;
×
61
        }
62

63
        @Override
64
        public boolean isSuperType() {
NEW
65
            return false;
×
66
        }
67

68
        @Override
69
        public void dumpParameter(DumpingBuffer indentBuffer) {
70
            indentBuffer.newLine().append("*extraneous* ").dumpValue(data);
1✔
71
        }
1✔
72
    }
73
}
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