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

leeonky / test-charm-java / 150

07 Mar 2025 12:58AM UTC coverage: 74.287% (-0.08%) from 74.367%
150

push

circleci

leeonky
Try to fix ci

7919 of 10660 relevant lines covered (74.29%)

0.74 hits per line

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

95.54
/DAL-java/src/main/java/com/github/leeonky/dal/runtime/RuntimeContextBuilder.java
1
package com.github.leeonky.dal.runtime;
2

3
import com.github.leeonky.dal.ast.opt.DALOperator;
4
import com.github.leeonky.dal.format.Formatter;
5
import com.github.leeonky.dal.runtime.checker.Checker;
6
import com.github.leeonky.dal.runtime.checker.CheckerSet;
7
import com.github.leeonky.dal.runtime.inspector.Dumper;
8
import com.github.leeonky.dal.runtime.inspector.DumperFactory;
9
import com.github.leeonky.dal.runtime.schema.Expect;
10
import com.github.leeonky.dal.type.ExtensionName;
11
import com.github.leeonky.dal.type.InputCode;
12
import com.github.leeonky.dal.type.Schema;
13
import com.github.leeonky.interpreter.RuntimeContext;
14
import com.github.leeonky.interpreter.SyntaxException;
15
import com.github.leeonky.util.*;
16

17
import java.io.PrintStream;
18
import java.lang.reflect.Array;
19
import java.lang.reflect.Method;
20
import java.lang.reflect.Modifier;
21
import java.util.*;
22
import java.util.function.BiFunction;
23
import java.util.function.BiPredicate;
24
import java.util.function.Function;
25
import java.util.function.Supplier;
26
import java.util.stream.Collectors;
27
import java.util.stream.Stream;
28

29
import static com.github.leeonky.dal.runtime.ExpressionException.illegalOp2RuntimeException;
30
import static com.github.leeonky.dal.runtime.ExpressionException.illegalOperationRuntimeException;
31
import static com.github.leeonky.dal.runtime.schema.Actual.actual;
32
import static com.github.leeonky.dal.runtime.schema.Verification.expect;
33
import static com.github.leeonky.util.Classes.getClassName;
34
import static com.github.leeonky.util.CollectionHelper.toStream;
35
import static java.lang.String.format;
36
import static java.lang.reflect.Modifier.STATIC;
37
import static java.util.Arrays.stream;
38
import static java.util.Collections.emptySet;
39
import static java.util.stream.Collectors.joining;
40
import static java.util.stream.Collectors.toList;
41

42
public class RuntimeContextBuilder {
1✔
43
    private final ClassKeyMap<PropertyAccessor<Object>> propertyAccessors = new ClassKeyMap<>();
1✔
44
    private final ClassKeyMap<DALCollectionFactory<Object, Object>> dALCollectionFactories = new ClassKeyMap<>();
1✔
45
    private final ClassKeyMap<Function<Object, Object>> objectImplicitMapper = new ClassKeyMap<>();
1✔
46
    private final Map<String, ConstructorViaSchema> valueConstructors = new LinkedHashMap<>();
1✔
47
    private final Map<String, BeanClass<?>> schemas = new HashMap<>();
1✔
48
    private final Set<Method> extensionMethods = new HashSet<>();
1✔
49
    private final Map<Object, Function<MetaData, Object>> metaProperties = new HashMap<>();
1✔
50
    private final ClassKeyMap<Function<RemarkData, Data>> remarks = new ClassKeyMap<>();
1✔
51
    private final ClassKeyMap<Function<RuntimeData, Data>> exclamations = new ClassKeyMap<>();
1✔
52
    private final List<UserLiteralRule> userDefinedLiterals = new ArrayList<>();
1✔
53
    private final NumberType numberType = new NumberType();
1✔
54
    private final Map<Method, BiFunction<Object, List<Object>, List<Object>>> curryingMethodArgRanges = new HashMap<>();
1✔
55
    private final Map<String, TextFormatter<?, ?>> textFormatterMap = new LinkedHashMap<>();
1✔
56
    private final Map<Operators, LinkedList<Operation>> operations = new HashMap<>();
1✔
57
    private Converter converter = Converter.getInstance();
1✔
58
    private final ClassKeyMap<DumperFactory> dumperFactories = new ClassKeyMap<>();
1✔
59
    private final CheckerSet checkerSetForMatching = new CheckerSet(CheckerSet::defaultMatching);
1✔
60
    private final CheckerSet checkerSetForEqualing = new CheckerSet(CheckerSet::defaultEqualing);
1✔
61
    //    private final
62
    private int maxDumpingLineSize = 2000;
1✔
63
    private int maxDumpingObjectSize = 255;
1✔
64
    private ErrorHook errorHook = (i, code, e) -> false;
1✔
65
    private final Map<Class<?>, Map<Object, Function<MetaData, Object>>> localMetaProperties
1✔
66
            = new TreeMap<>(Classes::compareByExtends);
67
    private PrintStream warning = System.err;
1✔
68
    private final Features features = new Features();
1✔
69

70
    public RuntimeContextBuilder registerMetaProperty(Object property, Function<MetaData, Object> function) {
71
        metaProperties.put(property, function);
1✔
72
        return this;
1✔
73
    }
74

75
    public RuntimeContextBuilder registerTextFormatter(String name, TextFormatter<?, ?> formatter) {
76
        textFormatterMap.put(name, formatter);
1✔
77
        return this;
1✔
78
    }
79

80
    public DALRuntimeContext build(Object inputValue) {
81
        return build(() -> inputValue, null);
1✔
82
    }
83

84
    public DALRuntimeContext build(InputCode<?> inputSupplier) {
85
        return build(inputSupplier, null);
1✔
86
    }
87

88
    public DALRuntimeContext build(InputCode<?> inputSupplier, Class<?> rootSchema) {
89
        if (inputSupplier == null)
1✔
90
            return new DALRuntimeContext(() -> null, rootSchema);
1✔
91
        return new DALRuntimeContext(inputSupplier, rootSchema);
1✔
92
    }
93

94
    public RuntimeContextBuilder registerValueFormat(Formatter<?, ?> formatter) {
95
        return registerValueFormat(formatter.getFormatterName(), formatter);
1✔
96
    }
97

98
    @SuppressWarnings("unchecked")
99
    public RuntimeContextBuilder registerValueFormat(String name, Formatter<?, ?> formatter) {
100
        valueConstructors.put(name, (o, c) -> ((Formatter<Object, ?>) formatter).transform(o.instance()));
1✔
101
        return this;
1✔
102
    }
103

104
    public RuntimeContextBuilder registerSchema(Class<? extends Schema> schema) {
105
        return registerSchema(NameStrategy.SIMPLE_NAME, schema);
1✔
106
    }
107

108
    @SuppressWarnings("unchecked")
109
    public RuntimeContextBuilder registerSchema(String name, Class<? extends Schema> schema) {
110
        schemas.put(name, BeanClass.create(schema));
1✔
111
        return registerSchema(name, (data, context) ->
1✔
112
                expect(new Expect(BeanClass.create((Class) schema), null)).verify(context, actual(data)));
1✔
113
    }
114

115
    public RuntimeContextBuilder registerSchema(String name, BiFunction<Data, DALRuntimeContext, Boolean> predicate) {
116
        valueConstructors.put(name, (o, context) -> {
1✔
117
            if (predicate.apply(o, context))
1✔
118
                return o.instance();
1✔
119
            throw new IllegalTypeException();
×
120
        });
121
        return this;
1✔
122
    }
123

124
    @SuppressWarnings("unchecked")
125
    public <T> RuntimeContextBuilder registerPropertyAccessor(Class<T> type, PropertyAccessor<? extends T> propertyAccessor) {
126
        propertyAccessors.put(type, (PropertyAccessor<Object>) propertyAccessor);
1✔
127
        return this;
1✔
128
    }
129

130
    @SuppressWarnings("unchecked")
131
    public <T, E> RuntimeContextBuilder registerDALCollectionFactory(Class<T> type, DALCollectionFactory<T, E> DALCollectionFactory) {
132
        dALCollectionFactories.put(type, (DALCollectionFactory<Object, Object>) DALCollectionFactory);
1✔
133
        return this;
1✔
134
    }
135

136
    public RuntimeContextBuilder registerSchema(NameStrategy nameStrategy, Class<? extends Schema> schema) {
137
        return registerSchema(nameStrategy.toName(schema), schema);
1✔
138
    }
139

140
    public RuntimeContextBuilder registerStaticMethodExtension(Class<?> staticMethodExtensionClass) {
141
        Stream.of(staticMethodExtensionClass.getMethods()).filter(method -> method.getParameterCount() >= 1
1✔
142
                && (STATIC & method.getModifiers()) != 0).forEach(extensionMethods::add);
1✔
143
        return this;
1✔
144
    }
145

146
    @SuppressWarnings("unchecked")
147
    public <T> RuntimeContextBuilder registerImplicitData(Class<T> type, Function<T, Object> mapper) {
148
        objectImplicitMapper.put(type, (Function) mapper);
1✔
149
        return this;
1✔
150
    }
151

152
    public Converter getConverter() {
153
        return converter;
×
154
    }
155

156
    public RuntimeContextBuilder setConverter(Converter converter) {
157
        this.converter = converter;
×
158
        return this;
×
159
    }
160

161
    public RuntimeContextBuilder registerUserDefinedLiterals(UserLiteralRule rule) {
162
        userDefinedLiterals.add(rule);
1✔
163
        return this;
1✔
164
    }
165

166
    public RuntimeContextBuilder registerCurryingMethodAvailableParameters(Method method, BiFunction<Object,
167
            List<Object>, List<Object>> range) {
168
        curryingMethodArgRanges.put(method, range);
1✔
169
        return this;
1✔
170
    }
171

172
    private Set<Method> methodToCurrying(Class<?> type, Object methodName) {
173
        return Stream.of(stream(type.getMethods()).filter(method -> !Modifier.isStatic(method.getModifiers()))
1✔
174
                                .filter(method -> method.getName().equals(methodName)),
1✔
175
                        staticMethodsToCurrying(type, methodName, Object::equals),
1✔
176
                        staticMethodsToCurrying(type, methodName, Class::isAssignableFrom))
1✔
177
                .flatMap(Function.identity()).collect(Collectors.toCollection(LinkedHashSet::new));
1✔
178
    }
179

180
    private Stream<Method> staticMethodsToCurrying(Class<?> type, Object property,
181
                                                   BiPredicate<Class<?>, Class<?>> condition) {
182
        return extensionMethods.stream()
1✔
183
                .filter(method -> staticExtensionMethodName(method).equals(property))
1✔
184
                .filter(method -> condition.test(method.getParameters()[0].getType(), type));
1✔
185
    }
186

187
    private static String staticExtensionMethodName(Method method) {
188
        ExtensionName extensionName = method.getAnnotation(ExtensionName.class);
1✔
189
        return extensionName != null ? extensionName.value() : method.getName();
1✔
190
    }
191

192
    BiFunction<Object, List<Object>, List<Object>> fetchCurryingMethodArgRange(Method method) {
193
        return curryingMethodArgRanges.get(method);
×
194
    }
195

196
    public CheckerSet checkerSetForMatching() {
197
        return checkerSetForMatching;
1✔
198
    }
199

200
    public CheckerSet checkerSetForEqualing() {
201
        return checkerSetForEqualing;
1✔
202
    }
203

204
    public RuntimeContextBuilder registerDumper(Class<?> type, DumperFactory factory) {
205
        dumperFactories.put(type, factory);
1✔
206
        return this;
1✔
207
    }
208

209
    public void setMaxDumpingLineSize(int size) {
210
        maxDumpingLineSize = size;
1✔
211
    }
1✔
212

213
    public <T> RuntimeContextBuilder registerErrorHook(ErrorHook hook) {
214
        errorHook = Objects.requireNonNull(hook);
1✔
215
        return this;
1✔
216
    }
217

218
    public void mergeTextFormatter(String name, String other, String... others) {
219
        TextFormatter formatter = textFormatterMap.get(other);
1✔
220
        for (String o : others)
1✔
221
            formatter = formatter.merge(textFormatterMap.get(o));
1✔
222
        registerTextFormatter(name, delegateFormatter(formatter, "Merged from " + other + " " + String.join(" ", others)));
1✔
223
    }
1✔
224

225
    private TextFormatter delegateFormatter(TextFormatter formatter, final String description) {
226
        return new TextFormatter() {
1✔
227
            @Override
228
            protected Object format(Object content, TextAttribute attribute, DALRuntimeContext context) {
229
                return formatter.format(content, attribute, context);
×
230
            }
231

232
            @Override
233
            protected TextAttribute attribute(TextAttribute attribute) {
234
                return formatter.attribute(attribute);
×
235
            }
236

237
            @Override
238
            public Class<?> returnType() {
239
                return formatter.returnType();
1✔
240
            }
241

242
            @Override
243
            public Class<?> acceptType() {
244
                return formatter.acceptType();
1✔
245
            }
246

247
            @Override
248
            public String description() {
249
                return description;
1✔
250
            }
251
        };
252
    }
253

254
    public RuntimeContextBuilder registerMetaProperty(Class<?> type, Object name, Function<MetaData, Object> function) {
255
        localMetaProperties.computeIfAbsent(type, k -> new HashMap<>()).put(name, function);
1✔
256
        return this;
1✔
257
    }
258

259
    public RuntimeContextBuilder registerDataRemark(Class<?> type, Function<RemarkData, Data> action) {
260
        remarks.put(type, action);
1✔
261
        return this;
1✔
262
    }
263

264
    public RuntimeContextBuilder registerExclamation(Class<?> type, Function<RuntimeData, Data> action) {
265
        exclamations.put(type, action);
1✔
266
        return this;
1✔
267
    }
268

269
    public RuntimeContextBuilder registerOperator(Operators operator, Operation operation) {
270
        operations.computeIfAbsent(operator, o -> new LinkedList<>()).addFirst(operation);
1✔
271
        return this;
1✔
272
    }
273

274
    public BeanClass<?> schemaType(String schema) {
275
        BeanClass<?> type = schemas.get(schema);
1✔
276
        if (type != null)
1✔
277
            return type;
1✔
278
        throw new IllegalStateException(format("Unknown schema '%s'", schema));
×
279
    }
280

281
    public void setMaxDumpingObjectSize(int maxDumpingObjectSize) {
282
        this.maxDumpingObjectSize = maxDumpingObjectSize;
×
283
    }
×
284

285
    public RuntimeContextBuilder setWarningOutput(PrintStream printStream) {
286
        warning = printStream;
1✔
287
        return this;
1✔
288
    }
289

290
    public Features features() {
291
        return features;
1✔
292
    }
293

294
    public class DALRuntimeContext implements RuntimeContext {
295
        private final LinkedList<Data> stack = new LinkedList<>();
1✔
296
        private final Map<Data, PartialPropertyStack> partialPropertyStacks;
297
        private final Data inputValue;
298
        private final Throwable inputError;
299

300
        public Features features() {
301
            return features;
1✔
302
        }
303

304
        public DALRuntimeContext(InputCode<?> supplier, Class<?> schema) {
1✔
305
            BeanClass<?> rootSchema = null;
1✔
306
            if (schema != null)
1✔
307
                rootSchema = BeanClass.create(schema);
1✔
308
            Data value;
309
            Throwable error;
310
            try {
311
                value = wrap(supplier.get(), rootSchema);
1✔
312
                error = null;
1✔
313
            } catch (Throwable e) {
1✔
314
                value = wrap(null);
1✔
315
                error = e;
1✔
316
            }
1✔
317
            inputError = error;
1✔
318
            inputValue = value;
1✔
319
            partialPropertyStacks = new HashMap<>();
1✔
320
        }
1✔
321

322
        public Data getThis() {
323
            if (stack.isEmpty()) {
1✔
324
                if (inputError != null)
1✔
325
                    throw new InputException(inputError);
1✔
326
                return inputValue;
1✔
327
            }
328
            return stack.getFirst();
1✔
329
        }
330

331
        public <T> T pushAndExecute(Data data, Supplier<T> supplier) {
332
            try {
333
                stack.push(data);
1✔
334
                return supplier.get();
1✔
335
            } finally {
336
                stack.pop();
1✔
337
            }
338
        }
339

340
        public Optional<ConstructorViaSchema> searchValueConstructor(String type) {
341
            return Optional.ofNullable(valueConstructors.get(type));
1✔
342
        }
343

344
        public Set<?> findPropertyReaderNames(Object instance) {
345
            return getObjectPropertyAccessor(instance).getPropertyNames(instance);
1✔
346
        }
347

348
        private PropertyAccessor<Object> getObjectPropertyAccessor(Object instance) {
349
            return propertyAccessors.tryGetData(instance)
1✔
350
                    .orElseGet(() -> new JavaClassPropertyAccessor<>(BeanClass.createFrom(instance)));
1✔
351
        }
352

353
        public Boolean isNull(Object instance) {
354
            return propertyAccessors.tryGetData(instance).map(f -> f.isNull(instance))
1✔
355
                    .orElseGet(() -> Objects.equals(instance, null));
1✔
356
        }
357

358
        public Object getPropertyValue(Data data, Object property) {
359
            PropertyAccessor<Object> propertyAccessor = getObjectPropertyAccessor(data.instance());
1✔
360
            try {
361
                return propertyAccessor.getValueByData(data, property);
1✔
362
            } catch (InvalidPropertyException e) {
1✔
363
                return data.currying(property).orElseThrow(() -> e).resolve();
1✔
364
            } catch (InvocationException e) {
1✔
365
                throw e;
1✔
366
            } catch (Exception e) {
1✔
367
                throw new InvocationException(e);
1✔
368
            }
369
        }
370

371
        public DALCollection<Object> createCollection(Object instance) {
372
            return dALCollectionFactories.tryGetData(instance).map(factory -> factory.create(instance))
1✔
373
                    .orElseGet(() -> new CollectionDALCollection<>(toStream(instance).collect(toList())));
1✔
374
        }
375

376
        public boolean isRegisteredList(Object instance) {
377
            return dALCollectionFactories.tryGetData(instance).map(f -> f.isList(instance)).orElse(false);
1✔
378
        }
379

380
        public Converter getConverter() {
381
            return converter;
1✔
382
        }
383

384
        public Data wrap(Object instance) {
385
            return wrap(instance, null);
1✔
386
        }
387

388
        public Data wrap(Object instance, String schema, boolean isList) {
389
            BeanClass<?> schemaType = schemas.get(schema);
1✔
390
            if (isList && schemaType != null)
1✔
391
                schemaType = BeanClass.create(Array.newInstance(schemaType.getType(), 0).getClass());
1✔
392
            return wrap(instance, schemaType);
1✔
393
        }
394

395
        public Data wrap(Object instance, BeanClass<?> schemaType) {
396
            return new Data(instance, this, SchemaType.create(schemaType));
1✔
397
        }
398

399
        public Optional<Result> takeUserDefinedLiteral(String token) {
400
            return userDefinedLiterals.stream().map(userLiteralRule -> userLiteralRule.compile(token))
1✔
401
                    .filter(Result::hasResult)
1✔
402
                    .findFirst();
1✔
403
        }
404

405
        public void appendPartialPropertyReference(Data data, Object symbol) {
406
            fetchPartialProperties(data).map(partialProperties -> partialProperties.appendPartialProperties(symbol));
1✔
407
        }
1✔
408

409
        private Optional<PartialProperties> fetchPartialProperties(Data data) {
410
            return partialPropertyStacks.values().stream().map(partialPropertyStack ->
1✔
411
                    partialPropertyStack.fetchPartialProperties(data)).filter(Objects::nonNull).findFirst();
1✔
412
        }
413

414
        public void initPartialPropertyStack(Data instance, Object prefix, Data partial) {
415
            partialPropertyStacks.computeIfAbsent(instance, _key -> fetchPartialProperties(instance)
1✔
416
                    .map(partialProperties -> partialProperties.partialPropertyStack)
1✔
417
                    .orElseGet(PartialPropertyStack::new)).setupPartialProperties(prefix, partial);
1✔
418
        }
1✔
419

420
        public Set<String> collectPartialProperties(Data instance) {
421
            PartialPropertyStack partialPropertyStack = partialPropertyStacks.get(instance);
1✔
422
            if (partialPropertyStack != null)
1✔
423
                return partialPropertyStack.collectPartialProperties(instance);
1✔
424
            return fetchPartialProperties(instance).map(partialProperties ->
1✔
425
                    partialProperties.partialPropertyStack.collectPartialProperties(instance)).orElse(emptySet());
1✔
426
        }
427

428
        public NumberType getNumberType() {
429
            return numberType;
1✔
430
        }
431

432
        public Optional<Object> getImplicitObject(Object obj) {
433
            return objectImplicitMapper.tryGetData(obj).map(mapper -> mapper.apply(obj));
1✔
434
        }
435

436
        public Set<Method> methodToCurrying(Class<?> type, Object methodName) {
437
            return RuntimeContextBuilder.this.methodToCurrying(type, methodName);
1✔
438
        }
439

440
        public Function<MetaData, Object> fetchGlobalMetaFunction(MetaData metaData) {
441
            return metaProperties.computeIfAbsent(metaData.name(), k -> {
1✔
442
                throw illegalOp2RuntimeException(format("Meta property `%s` not found", metaData.name()));
1✔
443
            });
444
        }
445

446
        private Optional<Function<MetaData, Object>> fetchLocalMetaFunction(MetaData metaData) {
447
            return metaFunctionsByType(metaData).map(e -> {
1✔
448
                metaData.addCallType(e.getKey());
1✔
449
                return e.getValue().get(metaData.name());
1✔
450
            }).filter(Objects::nonNull).findFirst();
1✔
451
        }
452

453
        public Optional<Function<MetaData, Object>> fetchSuperMetaFunction(MetaData metaData) {
454
            return metaFunctionsByType(metaData)
1✔
455
                    .filter(e -> !metaData.calledBy(e.getKey()))
1✔
456
                    .map(e -> {
1✔
457
                        metaData.addCallType(e.getKey());
1✔
458
                        return e.getValue().get(metaData.name());
1✔
459
                    }).filter(Objects::nonNull).findFirst();
1✔
460
        }
461

462
        private Stream<Map.Entry<Class<?>, Map<Object, Function<MetaData, Object>>>> metaFunctionsByType(MetaData metaData) {
463
            return localMetaProperties.entrySet().stream().filter(e -> metaData.isInstance(e.getKey()));
1✔
464
        }
465

466
        @SuppressWarnings("unchecked")
467
        public <T> TextFormatter<String, T> fetchFormatter(String name, int position) {
468
            return (TextFormatter<String, T>) textFormatterMap.computeIfAbsent(name, attribute -> {
1✔
469
                throw new SyntaxException(format("Invalid text formatter `%s`, all supported formatters are:\n%s",
1✔
470
                        attribute, textFormatterMap.entrySet().stream().map(e -> format("  %s:\n    %s",
1✔
471
                                e.getKey(), e.getValue().fullDescription())).collect(joining("\n"))), position);
1✔
472
            });
473
        }
474

475
        public Checker fetchEqualsChecker(Data expected, Data actual) {
476
            return checkerSetForEqualing.fetch(expected, actual);
1✔
477
        }
478

479
        public Checker fetchMatchingChecker(Data expected, Data actual) {
480
            return checkerSetForMatching.fetch(expected, actual);
1✔
481
        }
482

483
        public Dumper fetchDumper(Data data) {
484
            return dumperFactories.tryGetData(data.instance()).map(factory -> factory.apply(data)).orElseGet(() -> {
1✔
485
                if (data.isNull())
1✔
486
                    return (_data, dumpingContext) -> dumpingContext.append("null");
1✔
487
                if (data.isList())
1✔
488
                    return Dumper.LIST_DUMPER;
1✔
489
                if (data.instance() != null && data.instance().getClass().isEnum())
1✔
490
                    return Dumper.VALUE_DUMPER;
1✔
491
                return Dumper.MAP_DUMPER;
1✔
492
            });
493
        }
494

495
        public int maxDumpingLineCount() {
496
            return maxDumpingLineSize;
1✔
497
        }
498

499
        public int maxDumpingObjectSize() {
500
            return maxDumpingObjectSize;
1✔
501
        }
502

503
        public boolean hookError(String expression, Throwable error) {
504
            return errorHook.handle(getThis().instance(), expression, error);
1✔
505
        }
506

507
        public Object invokeMetaProperty(MetaData metaData) {
508
            return fetchLocalMetaFunction(metaData).orElseGet(() -> fetchGlobalMetaFunction(metaData)).apply(metaData);
1✔
509
        }
510

511
        public Data invokeDataRemark(RemarkData remarkData) {
512
            Object instance = remarkData.data().instance();
1✔
513
            return remarks.tryGetData(instance)
1✔
514
                    .orElseThrow(() -> illegalOperationRuntimeException("Not implement operator () of " + Classes.getClassName(instance)))
1✔
515
                    .apply(remarkData);
1✔
516
        }
517

518
        public Data invokeExclamations(ExclamationData exclamationData) {
519
            Object instance = exclamationData.data().instance();
1✔
520
            return exclamations.tryGetData(instance)
1✔
521
                    .orElseThrow(() -> illegalOp2RuntimeException(format("Not implement operator %s of %s",
1✔
522
                            exclamationData.label(), Classes.getClassName(instance))))
1✔
523
                    .apply(exclamationData);
1✔
524
        }
525

526
        public Data calculate(Data v1, DALOperator opt, Data v2) {
527
            for (Operation operation : operations.get(opt.overrideType()))
1✔
528
                if (operation.match(v1, opt, v2, this))
1✔
529
                    return operation.operate(v1, opt, v2, this);
1✔
530
            throw illegalOperationRuntimeException(format("No operation `%s` between '%s' and '%s'", opt.overrideType(),
1✔
531
                    getClassName(v1.instance()), getClassName(v2.instance())));
1✔
532
        }
533

534
        public PrintStream warningOutput() {
535
            return warning;
1✔
536
        }
537

538
        public BiFunction<Object, List<Object>, List<Object>> fetchCurryingMethodArgRange(Method method) {
539
            return curryingMethodArgRanges.get(method);
1✔
540
        }
541
    }
542
}
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