• 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

65.38
/src/main/java/org/commonwl/cwlsdk/cwl1_1/utils/MapLoader.java
1
package org.commonwl.cwlsdk.cwl1_2.utils;
2

3
import java.util.ArrayList;
4
import java.util.HashMap;
5
import java.util.List;
6
import java.util.Map;
7

8
public class MapLoader<T> implements Loader<Map<String, T>> {
9
  private final Loader<T> valueLoader;
10
  private final String container;
11
  private final Boolean noLinkCheck;
12

13
  public MapLoader(Loader<T> valueLoader, final String container, final Boolean noLinkCheck) {
1✔
14
    this.valueLoader = valueLoader;
1✔
15
    this.container = container;
1✔
16
    this.noLinkCheck = noLinkCheck;
1✔
17
  }
1✔
18

19
  public Map<String, T> load(
20
      final Object doc,
21
      final String baseUri,
22
      final LoadingOptions loadingOptions,
23
      final String docRoot) {
24
    final Map<String, Object> docMap = (Map<String, Object>) Loader.validateOfJavaType(Map.class, doc);
1✔
25
    LoadingOptions innerLoadingOptions = loadingOptions;
1✔
26
    if (this.container != null || this.noLinkCheck != null) {
1✔
NEW
27
      LoadingOptionsBuilder builder = new LoadingOptionsBuilder().copiedFrom(loadingOptions);
×
NEW
28
      if (this.container != null) {
×
NEW
29
        builder.setContainer(this.container);
×
30
      }
NEW
31
      if (this.noLinkCheck != null) {
×
NEW
32
        builder.setNoLinkCheck(this.noLinkCheck);
×
33
      }
NEW
34
      innerLoadingOptions = builder.build();
×
35
    }
36
    final Map<String, T> r = new HashMap();
1✔
37
    final List<ValidationException> errors = new ArrayList();
1✔
38
    for (final Map.Entry<String, Object> entry : docMap.entrySet()) {
1✔
39
      try {
40
        final Object loadedField = this.valueLoader.loadField(entry.getValue(), baseUri, innerLoadingOptions);
1✔
41
        r.put(entry.getKey(), (T) loadedField);
1✔
NEW
42
      } catch (final ValidationException e) {
×
NEW
43
        errors.add(e);
×
44
      }
1✔
45
    }
1✔
46
    if (!errors.isEmpty()) {
1✔
NEW
47
      throw new ValidationException("", errors);
×
48
    }
49
    return r;
1✔
50
  }
51
}
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