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

leeonky / test-charm-java / 329

01 Oct 2025 04:21PM UTC coverage: 74.68% (+0.03%) from 74.648%
329

push

circleci

leeonky
depends on primitive default value sub property

6 of 9 new or added lines in 3 files covered. (66.67%)

13 existing lines in 4 files now uncovered.

8565 of 11469 relevant lines covered (74.68%)

0.75 hits per line

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

72.73
/jfactory/src/main/java/com/github/leeonky/jfactory/CollectionInstance.java
1
package com.github.leeonky.jfactory;
2

3
import com.github.leeonky.util.PropertyWriter;
4

5
import java.util.ArrayList;
6
import java.util.List;
7
import java.util.stream.Collectors;
8

9
class CollectionInstance<T> extends SubInstance<T> {
10
    private final List<Integer> indexes;
11

12
    public CollectionInstance(List<Integer> indexes, PropertyWriter<?> property,
13
                              Spec<T> spec, Arguments argument, TypeSequence.Sequence sequence) {
14
        super(property, spec, argument, sequence);
1✔
15
        this.indexes = new ArrayList<>(indexes);
1✔
16
    }
1✔
17

18
    @Override
19
    public String propertyInfo() {
20
        return String.format("%s%s", super.propertyInfo(),
1✔
21
                indexes.stream().map(i -> String.format("[%d]", i)).collect(Collectors.joining()));
1✔
22
    }
23

24
    public CollectionInstance<T> element(int index) {
25
        CollectionInstance<T> collection = new CollectionInstance<>(indexes, getProperty(), spec, arguments, sequence);
1✔
26
        collection.indexes.add(index);
1✔
27
        return collection;
1✔
28
    }
29

30
    @Override
31
    public SubInstance<T> sub(PropertyWriter<?> property) {
32
        try {
NEW
33
            return element(Integer.parseInt(property.getName()));
×
NEW
34
        } catch (NumberFormatException ignore) {
×
NEW
35
            return super.sub(property);
×
36
        }
37
    }
38
}
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