• 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

91.67
/src/main/java/org/commonwl/cwlsdk/cwl1_2/utils/EnumLoader.java
1
package org.commonwl.cwlsdk.cwl1_2.utils;
2

3
import java.lang.reflect.Method;
4
import java.lang.ReflectiveOperationException;
5
import java.util.Arrays;
6
import java.util.List;
7

8
public class EnumLoader<T extends Enum> implements Loader<T>{
9
  private final Class<T> symbolEnumClass;
10

11
  public EnumLoader(final Class<T> symbolEnumClass) {
1✔
12
    this.symbolEnumClass = symbolEnumClass;
1✔
13
  }
1✔
14

15
  public T load(
16
      final Object doc,
17
      final String baseUri,
18
      final LoadingOptions loadingOptions,
19
      final String docRoot) {
20
    final String docString = Loader.validateOfJavaType(String.class, doc);
1✔
21
    try {
22
      final Method m = symbolEnumClass.getMethod("fromDocumentVal", String.class);
1✔
23
      final T val = (T) m.invoke(null, docString);
1✔
24
      return val;
1✔
25
    } catch (final ReflectiveOperationException e) {
1✔
26
      final Throwable cause = e.getCause();
1✔
27
      if (cause instanceof RuntimeException) {
1✔
28
        throw (RuntimeException) cause;
1✔
29
      }
NEW
30
      throw new RuntimeException(e);
×
31
    }
32
  }
33
}
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

© 2025 Coveralls, Inc