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

common-workflow-language / cwljava / #394

31 Oct 2025 04:10PM UTC coverage: 57.972% (-1.6%) from 59.538%
#394

push

github

mr-c
rename package to a namespace that we control

7575 of 12994 new or added lines in 261 files covered. (58.3%)

7752 of 13372 relevant lines covered (57.97%)

0.58 hits per line

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

86.96
/src/main/java/org/commonwl/cwlsdk/cwl1_2/utils/ArrayLoader.java
1
package org.commonwl.cwlsdk.cwl1_1.utils;
2

3
import java.util.ArrayList;
4
import java.util.List;
5

6
public class ArrayLoader<T> implements Loader<List<T>> {
7
  private final Loader<T> itemLoader;
8

9
  public ArrayLoader(Loader<T> itemLoader) {
1✔
10
    this.itemLoader = itemLoader;
1✔
11
  }
1✔
12

13
  public List<T> load(
14
      final Object doc,
15
      final String baseUri,
16
      final LoadingOptions loadingOptions,
17
      final String docRoot) {
18
    final List<Object> docList = (List<Object>) Loader.validateOfJavaType(List.class, doc);
1✔
19
    final List<T> r = new ArrayList();
1✔
20
    final List<Loader> loaders = new ArrayList<Loader>();
1✔
21
    loaders.add(this);
1✔
22
    loaders.add(this.itemLoader);
1✔
23
    final UnionLoader unionLoader = new UnionLoader(loaders);
1✔
24
    final List<ValidationException> errors = new ArrayList();
1✔
25
    for (final Object el : docList) {
1✔
26
      try {
27
        final Object loadedField = unionLoader.loadField(el, baseUri, loadingOptions);
1✔
28
        final boolean flatten = !"@list".equals(loadingOptions.container);
1✔
29
        if (flatten && loadedField instanceof List) {
1✔
30
          r.addAll((List<T>) loadedField);
1✔
31
        } else {
32
          r.add((T) loadedField);
1✔
33
        }
NEW
34
      } catch (final ValidationException e) {
×
NEW
35
        errors.add(e);
×
36
      }
1✔
37
    }
1✔
38
    if (!errors.isEmpty()) {
1✔
NEW
39
      throw new ValidationException("", errors);
×
40
    }
41
    return r;
1✔
42
  }
43
}
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