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

leeonky / test-charm-java / 332

02 Oct 2025 03:38PM UTC coverage: 74.653% (-0.03%) from 74.68%
332

push

circleci

leeonky
Refactor

10 of 10 new or added lines in 3 files covered. (100.0%)

16 existing lines in 5 files now uncovered.

8559 of 11465 relevant lines covered (74.65%)

0.75 hits per line

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

80.0
/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
    @Override
25
    public SubInstance<T> sub(PropertyWriter<?> property) {
26
        try {
27
            CollectionInstance<T> collection = new CollectionInstance<>(indexes, getProperty(), spec, arguments, sequence);
1✔
28
            collection.indexes.add(Integer.parseInt(property.getName()));
1✔
29
            return collection;
1✔
UNCOV
30
        } catch (NumberFormatException ignore) {
×
UNCOV
31
            return super.sub(property);
×
32
        }
33
    }
34
}
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