• 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

64.0
/src/main/java/org/w3id/cwl/cwl1_1/utils/RecordLoader.java
1
package org.w3id.cwl.cwl1_1.utils;
2

3
import java.lang.reflect.Constructor;
4
import java.lang.reflect.InvocationTargetException;
5

6
public class RecordLoader<T extends Saveable> implements Loader<T> {
7
  private final Class<? extends T> saveableClass;
8
  private final String container;
9
  private final Boolean noLinkCheck;
10

11
  public RecordLoader(final Class<? extends T> saveableClass, final String container, final Boolean noLinkCheck) {
1✔
12
    this.saveableClass = saveableClass;
1✔
13
    this.container = container;
1✔
14
    this.noLinkCheck = noLinkCheck;
1✔
15
  }
1✔
16

17
  public T load(
18
      final Object doc,
19
      final String baseUri,
20
      final LoadingOptions loadingOptions,
21
      final String docRoot) {
22
    Loader.validateOfJavaType(java.util.Map.class, doc);
1✔
23
    try {
24
      final Constructor<? extends T> constructor =
1✔
25
          this.saveableClass.getConstructor(
1✔
26
              new Class[] {Object.class, String.class, LoadingOptions.class, String.class});
27
      LoadingOptions innerLoadingOptions = loadingOptions;
1✔
28
      if (this.container != null || this.noLinkCheck != null) {
1✔
NEW
29
        LoadingOptionsBuilder builder = new LoadingOptionsBuilder().copiedFrom(loadingOptions);
×
NEW
30
        if (this.container != null) {
×
NEW
31
          builder.setContainer(this.container);
×
32
        }
NEW
33
        if (this.noLinkCheck != null) {
×
NEW
34
          builder.setNoLinkCheck(this.noLinkCheck);
×
35
        }
NEW
36
        innerLoadingOptions = builder.build();
×
37
      }
38
      final T ret = constructor.newInstance(doc, baseUri, innerLoadingOptions, docRoot);
1✔
39
      return ret;
1✔
40
    } catch (InvocationTargetException e) {
1✔
41
      final Throwable cause = e.getCause();
1✔
42
      if (cause instanceof RuntimeException) {
1✔
43
        throw (RuntimeException) cause;
1✔
44
      }
45
      throw new RuntimeException(e.getCause());
×
46
    } catch (ReflectiveOperationException e) {
×
47
      throw new RuntimeException(e);
×
48
    }
49
  }
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