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

common-workflow-language / cwljava / #336

29 Jan 2025 12:41PM UTC coverage: 60.005% (-2.2%) from 62.203%
#336

Pull #192

github

web-flow
Merge 40f1ed817 into e28b918d2
Pull Request #192: regenerate using latest schema & schema-salad-tool

441 of 968 new or added lines in 65 files covered. (45.56%)

21 existing lines in 3 files now uncovered.

7347 of 12244 relevant lines covered (60.0%)

0.6 hits per line

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

65.38
/src/main/java/org/w3id/cwl/cwl1_1/utils/MapLoader.java
1
package org.w3id.cwl.cwl1_1.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