• 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

70.83
/commons/util/src/main/java/net/automatalib/common/util/Triple.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.common.util;
17

18
import java.io.IOException;
19
import java.util.Objects;
20

21
import net.automatalib.common.util.string.AbstractPrintable;
22
import net.automatalib.common.util.string.StringUtil;
23
import org.checkerframework.checker.nullness.qual.Nullable;
24

25
/**
26
 * Immutable triple class.
27
 * <p>
28
 * <b>Note</b>: this class should only be used for internal representations of tuples with value type semantics (e.g.
29
 * equality, only if all components are equal).
30
 * <p>
31
 * Whenever a public interface returns an aggregation of individual objects, a separate class should be created/used
32
 * that has meaningful identifiers for the individual components.
33
 *
34
 * @param <T1>
35
 *         type of the first component
36
 * @param <T2>
37
 *         type of the second component
38
 * @param <T3>
39
 *         type of the third component
40
 */
41
public final class Triple<T1, T2, T3> extends AbstractPrintable {
42

43
    private final T1 first;
44
    private final T2 second;
45
    private final T3 third;
46

47
    private Triple(T1 first, T2 second, T3 third) {
1✔
48
        this.first = first;
1✔
49
        this.second = second;
1✔
50
        this.third = third;
1✔
51
    }
1✔
52

53
    /**
54
     * Creates a new triple from the given components.
55
     *
56
     * @param first
57
     *         the first triple component
58
     * @param second
59
     *         the second triple component
60
     * @param third
61
     *         the third triple component
62
     * @param <T1>
63
     *         type of the first component
64
     * @param <T2>
65
     *         type of the second component
66
     * @param <T3>
67
     *         type of the third component
68
     *
69
     * @return the new triple object
70
     */
71
    public static <T1, T2, T3> Triple<T1, T2, T3> of(T1 first, T2 second, T3 third) {
72
        return new Triple<>(first, second, third);
1✔
73
    }
74

75
    public T1 getFirst() {
76
        return first;
1✔
77
    }
78

79
    public T2 getSecond() {
80
        return second;
1✔
81
    }
82

83
    public T3 getThird() {
84
        return third;
1✔
85
    }
86

87
    @Override
88
    public void print(Appendable a) throws IOException {
89
        a.append('(');
1✔
90
        StringUtil.appendObject(a, first);
1✔
91
        a.append(", ");
1✔
92
        StringUtil.appendObject(a, second);
1✔
93
        a.append(", ");
1✔
94
        StringUtil.appendObject(a, third);
1✔
95
        a.append(')');
1✔
96
    }
1✔
97

98
    @Override
99
    public boolean equals(@Nullable Object o) {
NEW
100
        return this == o || o instanceof Triple<?, ?, ?> that && Objects.equals(first, that.first) &&
×
NEW
101
                            Objects.equals(second, that.second) && Objects.equals(third, that.third);
×
102
    }
103

104
    @Override
105
    public int hashCode() {
106
        int result = 1;
×
107
        result = 31 * result + Objects.hashCode(first);
×
108
        result = 31 * result + Objects.hashCode(second);
×
109
        result = 31 * result + Objects.hashCode(third);
×
110
        return result;
×
111
    }
112
}
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