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

LearnLib / automatalib / 19566384231

21 Nov 2025 09:41AM UTC coverage: 92.565% (+0.4%) from 92.206%
19566384231

push

github

web-flow
Bump Java Version to 17/25 (#97)

* initial refactorings for Java 25 compatibility

spotbugs + pmd-plugin still need new releases that work on Java 25

* update CI config

* JDK builds pass

updates to the analysis plugins required some adjustments

* utilize Java 17 features

* fix documentation

* cleanups

* fix visibility issues

* potential fix for breaking GUI tests

* example: fix GUI tests

* cleanups

* jung: do not run GUI tests for now

* Revert "jung: do not run GUI tests for now"

This reverts commit 6a6645488.

* jung: found workaround for crashing JVM

* jacoco: correctly track coverage in GUI tests

* Revert "jung: found workaround for crashing JVM"

This reverts commit d99704042.

* Reapply "jung: do not run GUI tests for now"

This reverts commit 176cece7f.

* jung: add note

145 of 153 new or added lines in 51 files covered. (94.77%)

1 existing line in 1 file now uncovered.

16496 of 17821 relevant lines covered (92.56%)

1.72 hits per line

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

92.31
/core/src/main/java/net/automatalib/automaton/vpa/impl/AbstractSEVPA.java
1
/* Copyright (C) 2013-2025 TU Dortmund University
2
 * This file is part of AutomataLib <https://automatalib.net>.
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *     http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16
package net.automatalib.automaton.vpa.impl;
17

18
import net.automatalib.alphabet.VPAlphabet;
19
import net.automatalib.automaton.vpa.SEVPA;
20
import net.automatalib.automaton.vpa.StackContents;
21
import net.automatalib.automaton.vpa.State;
22
import org.checkerframework.checker.nullness.qual.Nullable;
23

24
/**
25
 * Abstract class for k-SEVPAs that implements functionality shared across different subtypes.
26
 *
27
 * @param <L>
28
 *         location type
29
 * @param <I>
30
 *         input alphabet type
31
 */
32
public abstract class AbstractSEVPA<L, I> implements SEVPA<L, I> {
33

34
    protected final VPAlphabet<I> alphabet;
35

36
    public AbstractSEVPA(VPAlphabet<I> alphabet) {
2✔
37
        this.alphabet = alphabet;
2✔
38
    }
2✔
39

40
    @Override
41
    public VPAlphabet<I> getInputAlphabet() {
42
        return alphabet;
2✔
43
    }
44

45
    @Override
46
    public @Nullable State<L> getTransition(State<L> state, I input) {
47
        final L loc = state.getLocation();
2✔
48
        final VPAlphabet.SymbolType type = alphabet.getSymbolType(input);
2✔
49
        return switch (type) {
2✔
50
            case CALL:
51
                final int newStackElem = encodeStackSym(loc, input);
2✔
52
                yield new State<>(getModuleEntry(input), StackContents.push(newStackElem, state.getStackContents()));
2✔
53
            case RETURN: {
54
                final StackContents contents = state.getStackContents();
2✔
55
                if (contents == null) {
2✔
56
                    yield null;
2✔
57
                }
58
                final int stackElem = contents.peek();
2✔
59
                final L succ = getReturnSuccessor(loc, input, stackElem);
2✔
60
                if (succ == null) {
2✔
61
                    yield null;
2✔
62
                }
63
                yield new State<>(succ, contents.pop());
2✔
64
            }
65
            case INTERNAL: {
66
                final L succ = getInternalSuccessor(loc, input);
1✔
67
                if (succ == null) {
1✔
NEW
68
                    yield null;
×
69
                }
70
                yield new State<>(succ, state.getStackContents());
1✔
71
            }
72
        };
73
    }
74

75
    @Override
76
    public int encodeStackSym(L srcLoc, I callSym) {
77
        return encodeStackSym(srcLoc, alphabet.getCallSymbolIndex(callSym));
2✔
78
    }
79

80
    public int encodeStackSym(L srcLoc, int callSymIdx) {
81
        return alphabet.getNumCalls() * getLocationId(srcLoc) + callSymIdx;
2✔
82
    }
83

84
    @Override
85
    public int getNumStackSymbols() {
86
        return size() * alphabet.getNumCalls();
1✔
87
    }
88

89
    public L getStackLoc(int stackSym) {
90
        return getLocation(stackSym / alphabet.getNumCalls());
2✔
91
    }
92

93
    public I getCallSym(int stackSym) {
94
        return alphabet.getCallSymbol(stackSym % alphabet.getNumCalls());
×
95
    }
96

97
}
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