• 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

96.15
/src/main/java/org/commonwl/cwlsdk/cwl1_2/utils/IdMapLoader.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
import java.util.TreeSet;
8

9
public class IdMapLoader<T> implements Loader<T> {
10
  private final Loader<T> innerLoader;
11
  private final String mapSubject;
12
  private final String mapPredicate;
13

14
  public IdMapLoader(
15
      final Loader<T> innerLoader, final String mapSubject, final String mapPredicate) {
1✔
16
    this.innerLoader = innerLoader;
1✔
17
    this.mapSubject = mapSubject;
1✔
18
    this.mapPredicate = mapPredicate;
1✔
19
  }
1✔
20

21
  public T load(
22
      final Object doc_,
23
      final String baseUri,
24
      final LoadingOptions loadingOptions,
25
      final String docRoot) {
26
    Object doc = doc_;
1✔
27
    if (doc instanceof Map) {
1✔
28
      final Map<String, Object> docMap = (Map<String, Object>) doc;
1✔
29
      final List<Object> asList = new ArrayList();
1✔
30
      for (final String key : docMap.keySet()) {
1✔
31
        final Object el = docMap.get(key);
1✔
32
        if (el instanceof Map) {
1✔
33
          final Map<String, Object> v2 = new HashMap<String, Object>((Map<String, Object>) el);
1✔
34
          v2.put(this.mapSubject, key);
1✔
35
          asList.add(v2);
1✔
36
        } else {
1✔
37
          if (this.mapPredicate != null) {
1✔
38
            final Map<String, Object> v3 = new HashMap<String, Object>();
1✔
39
            v3.put(this.mapPredicate, el);
1✔
40
            v3.put(this.mapSubject, key);
1✔
41
            asList.add(v3);
1✔
42
          } else {
1✔
NEW
43
            throw new ValidationException("No mapPredicate");
×
44
          }
45
        }
46
      }
1✔
47
      doc = asList;
1✔
48
    }
49
    return this.innerLoader.load(doc, baseUri, loadingOptions);
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