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

devonfw / IDEasy / 19877232762

02 Dec 2025 11:45PM UTC coverage: 69.903% (+0.05%) from 69.852%
19877232762

push

github

web-flow
#1636: improved security scoring (#1637)

3857 of 6049 branches covered (63.76%)

Branch coverage included in aggregate %.

9851 of 13561 relevant lines covered (72.64%)

3.15 hits per line

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

80.39
cli/src/main/java/com/devonfw/tools/ide/tool/ToolEditionAndVersion.java
1
package com.devonfw.tools.ide.tool;
2

3
import com.devonfw.tools.ide.version.GenericVersionRange;
4
import com.devonfw.tools.ide.version.VersionIdentifier;
5

6
/**
7
 * Container for a {@link ToolEdition} together with its version.
8
 */
9
public class ToolEditionAndVersion {
1✔
10

11
  private ToolEdition edition;
12

13
  private GenericVersionRange version;
14

15
  private VersionIdentifier resolvedVersion;
16

17
  /**
18
   * The constructor.
19
   *
20
   * @param edition the {@link #getEdition() edition}.
21
   */
22
  public ToolEditionAndVersion(ToolEdition edition) {
23
    super();
2✔
24
    this.edition = edition;
3✔
25
  }
1✔
26

27
  /**
28
   * The constructor.
29
   *
30
   * @param version the {@link #getVersion() version}.
31
   */
32
  public ToolEditionAndVersion(GenericVersionRange version) {
33
    super();
2✔
34
    if (version != null) {
2✔
35
      setVersion(version);
3✔
36
    }
37
  }
1✔
38

39
  /**
40
   * The constructor.
41
   *
42
   * @param edition the {@link #getEdition() edition}.
43
   * @param version the {@link #getVersion() version}.
44
   */
45
  public ToolEditionAndVersion(ToolEdition edition, GenericVersionRange version) {
46
    this(version);
3✔
47
    assert edition != null;
3!
48
    assert version != null;
3!
49
    this.edition = edition;
3✔
50
  }
1✔
51

52
  /**
53
   * @return the {@link ToolEdition}.
54
   */
55
  public ToolEdition getEdition() {
56

57
    return this.edition;
3✔
58
  }
59

60
  /**
61
   * @param edition new value of {@link #getEdition()}.
62
   */
63
  public void setEdition(ToolEdition edition) {
64

65
    if (this.edition != null) {
3!
66
      throw new IllegalStateException();
×
67
    }
68
    this.edition = edition;
3✔
69
  }
1✔
70

71
  /**
72
   * @return the {@link GenericVersionRange} that is installed or configured.
73
   */
74
  public GenericVersionRange getVersion() {
75

76
    return this.version;
3✔
77
  }
78

79
  /**
80
   * @param version new value of {@link #getVersion()}.
81
   */
82
  public void setVersion(GenericVersionRange version) {
83
    if (this.version != null) {
3!
84
      throw new IllegalStateException();
×
85
    }
86
    this.version = version;
3✔
87
    if ((this.resolvedVersion == null) && (version instanceof VersionIdentifier vi)) {
9!
88
      if (!vi.isPattern()) {
3✔
89
        this.resolvedVersion = vi;
3✔
90
      }
91
    }
92
  }
1✔
93

94
  /**
95
   * @return the resolved {@link VersionIdentifier}.
96
   */
97
  public VersionIdentifier getResolvedVersion() {
98
    return this.resolvedVersion;
3✔
99
  }
100

101
  /**
102
   * @param resolvedVersion new value of {@link #getResolvedVersion()}.
103
   */
104
  public void setResolvedVersion(VersionIdentifier resolvedVersion) {
105

106
    if ((resolvedVersion == null) || resolvedVersion.isPattern()) {
5!
107
      throw new IllegalStateException();
×
108
    }
109
    this.resolvedVersion = resolvedVersion;
3✔
110
  }
1✔
111
}
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