Skip to content

Commit ad55661

Browse files
committed
snakeyaml is always doubles instead of floats
1 parent 8fd3c89 commit ad55661

File tree

3 files changed

+15
-16
lines changed

3 files changed

+15
-16
lines changed

src/main/java/org/w3id/cwl/cwl1_2/ResourceRequirementImpl.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ public ResourceRequirementImpl(
253253
try {
254254
coresMin =
255255
LoaderInstances
256-
.union_of_NullInstance_or_IntegerInstance_or_LongInstance_or_FloatInstance_or_ExpressionLoader
256+
.union_of_NullInstance_or_IntegerInstance_or_LongInstance_or_DoubleInstance_or_ExpressionLoader
257257
.loadField(__doc.get("coresMin"), __baseUri, __loadingOptions);
258258
} catch (ValidationException e) {
259259
coresMin = null; // won't be used but prevents compiler from complaining.
@@ -270,7 +270,7 @@ public ResourceRequirementImpl(
270270
try {
271271
coresMax =
272272
LoaderInstances
273-
.union_of_NullInstance_or_IntegerInstance_or_LongInstance_or_FloatInstance_or_ExpressionLoader
273+
.union_of_NullInstance_or_IntegerInstance_or_LongInstance_or_DoubleInstance_or_ExpressionLoader
274274
.loadField(__doc.get("coresMax"), __baseUri, __loadingOptions);
275275
} catch (ValidationException e) {
276276
coresMax = null; // won't be used but prevents compiler from complaining.
@@ -287,7 +287,7 @@ public ResourceRequirementImpl(
287287
try {
288288
ramMin =
289289
LoaderInstances
290-
.union_of_NullInstance_or_IntegerInstance_or_LongInstance_or_FloatInstance_or_ExpressionLoader
290+
.union_of_NullInstance_or_IntegerInstance_or_LongInstance_or_DoubleInstance_or_ExpressionLoader
291291
.loadField(__doc.get("ramMin"), __baseUri, __loadingOptions);
292292
} catch (ValidationException e) {
293293
ramMin = null; // won't be used but prevents compiler from complaining.
@@ -304,7 +304,7 @@ public ResourceRequirementImpl(
304304
try {
305305
ramMax =
306306
LoaderInstances
307-
.union_of_NullInstance_or_IntegerInstance_or_LongInstance_or_FloatInstance_or_ExpressionLoader
307+
.union_of_NullInstance_or_IntegerInstance_or_LongInstance_or_DoubleInstance_or_ExpressionLoader
308308
.loadField(__doc.get("ramMax"), __baseUri, __loadingOptions);
309309
} catch (ValidationException e) {
310310
ramMax = null; // won't be used but prevents compiler from complaining.
@@ -321,7 +321,7 @@ public ResourceRequirementImpl(
321321
try {
322322
tmpdirMin =
323323
LoaderInstances
324-
.union_of_NullInstance_or_IntegerInstance_or_LongInstance_or_FloatInstance_or_ExpressionLoader
324+
.union_of_NullInstance_or_IntegerInstance_or_LongInstance_or_DoubleInstance_or_ExpressionLoader
325325
.loadField(__doc.get("tmpdirMin"), __baseUri, __loadingOptions);
326326
} catch (ValidationException e) {
327327
tmpdirMin = null; // won't be used but prevents compiler from complaining.
@@ -338,7 +338,7 @@ public ResourceRequirementImpl(
338338
try {
339339
tmpdirMax =
340340
LoaderInstances
341-
.union_of_NullInstance_or_IntegerInstance_or_LongInstance_or_FloatInstance_or_ExpressionLoader
341+
.union_of_NullInstance_or_IntegerInstance_or_LongInstance_or_DoubleInstance_or_ExpressionLoader
342342
.loadField(__doc.get("tmpdirMax"), __baseUri, __loadingOptions);
343343
} catch (ValidationException e) {
344344
tmpdirMax = null; // won't be used but prevents compiler from complaining.
@@ -355,7 +355,7 @@ public ResourceRequirementImpl(
355355
try {
356356
outdirMin =
357357
LoaderInstances
358-
.union_of_NullInstance_or_IntegerInstance_or_LongInstance_or_FloatInstance_or_ExpressionLoader
358+
.union_of_NullInstance_or_IntegerInstance_or_LongInstance_or_DoubleInstance_or_ExpressionLoader
359359
.loadField(__doc.get("outdirMin"), __baseUri, __loadingOptions);
360360
} catch (ValidationException e) {
361361
outdirMin = null; // won't be used but prevents compiler from complaining.
@@ -372,7 +372,7 @@ public ResourceRequirementImpl(
372372
try {
373373
outdirMax =
374374
LoaderInstances
375-
.union_of_NullInstance_or_IntegerInstance_or_LongInstance_or_FloatInstance_or_ExpressionLoader
375+
.union_of_NullInstance_or_IntegerInstance_or_LongInstance_or_DoubleInstance_or_ExpressionLoader
376376
.loadField(__doc.get("outdirMax"), __baseUri, __loadingOptions);
377377
} catch (ValidationException e) {
378378
outdirMax = null; // won't be used but prevents compiler from complaining.

src/main/java/org/w3id/cwl/cwl1_2/utils/LoaderInstances.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ public class LoaderInstances {
88
public static Loader<String> StringInstance = new PrimitiveLoader<String>(String.class);
99
public static Loader<Integer> IntegerInstance = new PrimitiveLoader<Integer>(Integer.class);
1010
public static Loader<Long> LongInstance = new PrimitiveLoader<Long>(Long.class);
11-
public static Loader<Float> FloatInstance = new PrimitiveLoader<Float>(Float.class);
1211
public static Loader<Double> DoubleInstance = new PrimitiveLoader<Double>(Double.class);
1312
public static Loader<Boolean> BooleanInstance = new PrimitiveLoader<Boolean>(Boolean.class);
1413
public static Loader<Object> NullInstance = new NullLoader();
@@ -242,7 +241,7 @@ public class LoaderInstances {
242241
public static Loader<ShellCommandRequirement_class> uri_ShellCommandRequirement_class_False_True_None = new UriLoader(ShellCommandRequirement_class, false, true, null);
243242
public static Loader<ResourceRequirement_class> ResourceRequirement_class = new EnumLoader(ResourceRequirement_class.class);
244243
public static Loader<ResourceRequirement_class> uri_ResourceRequirement_class_False_True_None = new UriLoader(ResourceRequirement_class, false, true, null);
245-
public static Loader<Object> union_of_NullInstance_or_IntegerInstance_or_LongInstance_or_FloatInstance_or_ExpressionLoader = new UnionLoader(new Loader[] { NullInstance, IntegerInstance, LongInstance, FloatInstance, ExpressionLoader });
244+
public static Loader<Object> union_of_NullInstance_or_IntegerInstance_or_LongInstance_or_DoubleInstance_or_ExpressionLoader = new UnionLoader(new Loader[] { NullInstance, IntegerInstance, LongInstance, DoubleInstance, ExpressionLoader });
246245
public static Loader<WorkReuse_class> WorkReuse_class = new EnumLoader(WorkReuse_class.class);
247246
public static Loader<WorkReuse_class> uri_WorkReuse_class_False_True_None = new UriLoader(WorkReuse_class, false, true, null);
248247
public static Loader<Object> union_of_BooleanInstance_or_ExpressionLoader = new UnionLoader(new Loader[] { BooleanInstance, ExpressionLoader });

src/test/java/org/w3id/cwl/cwl1_2/utils/ExamplesTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,7 @@ public void testvalid_updatedir_inplaceByMap() throws Exception {
942942
doc = (java.util.Map<String, Object>) YamlUtils.mapFromString(yaml);
943943
RootLoader.loadDocument(doc, url.toString());
944944
}
945-
@org.junit.Test(expected = ValidationException.class)
945+
@org.junit.Test
946946
public void testvalid_storage_floatByString() throws Exception {
947947
String path = java.nio.file.Paths.get(".").toAbsolutePath().normalize().toString();
948948
String baseUri = Uris.fileUri(path) + "/";
@@ -952,14 +952,14 @@ public void testvalid_storage_floatByString() throws Exception {
952952
RootLoader.loadDocument(yaml, baseUri);
953953
}
954954

955-
@org.junit.Test(expected = ValidationException.class)
955+
@org.junit.Test
956956
public void testvalid_storage_floatByPath() throws Exception {
957957
java.net.URL url = getClass().getResource("valid_storage_float.cwl");
958958
java.nio.file.Path resPath = java.nio.file.Paths.get(url.toURI());
959959
RootLoader.loadDocument(resPath);
960960
}
961961

962-
@org.junit.Test(expected = ValidationException.class)
962+
@org.junit.Test
963963
public void testvalid_storage_floatByMap() throws Exception {
964964
java.net.URL url = getClass().getResource("valid_storage_float.cwl");
965965
java.nio.file.Path resPath = java.nio.file.Paths.get(url.toURI());
@@ -4400,7 +4400,7 @@ public void testvalid_iwd_container_entryname2ByMap() throws Exception {
44004400
doc = (java.util.Map<String, Object>) YamlUtils.mapFromString(yaml);
44014401
RootLoader.loadDocument(doc, url.toString());
44024402
}
4403-
@org.junit.Test(expected = ValidationException.class)
4403+
@org.junit.Test
44044404
public void testvalid_cores_floatByString() throws Exception {
44054405
String path = java.nio.file.Paths.get(".").toAbsolutePath().normalize().toString();
44064406
String baseUri = Uris.fileUri(path) + "/";
@@ -4410,14 +4410,14 @@ public void testvalid_cores_floatByString() throws Exception {
44104410
RootLoader.loadDocument(yaml, baseUri);
44114411
}
44124412

4413-
@org.junit.Test(expected = ValidationException.class)
4413+
@org.junit.Test
44144414
public void testvalid_cores_floatByPath() throws Exception {
44154415
java.net.URL url = getClass().getResource("valid_cores_float.cwl");
44164416
java.nio.file.Path resPath = java.nio.file.Paths.get(url.toURI());
44174417
RootLoader.loadDocument(resPath);
44184418
}
44194419

4420-
@org.junit.Test(expected = ValidationException.class)
4420+
@org.junit.Test
44214421
public void testvalid_cores_floatByMap() throws Exception {
44224422
java.net.URL url = getClass().getResource("valid_cores_float.cwl");
44234423
java.nio.file.Path resPath = java.nio.file.Paths.get(url.toURI());

0 commit comments

Comments
 (0)