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

devonfw / IDEasy / 19751480105

28 Nov 2025 01:26AM UTC coverage: 69.441% (+0.3%) from 69.136%
19751480105

push

github

web-flow
#1613: fixed duplicated CVE check and refactored installation routine (#1614)

3696 of 5851 branches covered (63.17%)

Branch coverage included in aggregate %.

9620 of 13325 relevant lines covered (72.2%)

3.14 hits per line

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

15.79
cli/src/main/java/com/devonfw/tools/ide/tool/DelegatingToolCommandlet.java
1
package com.devonfw.tools.ide.tool;
2

3
import java.nio.file.Path;
4
import java.util.Set;
5

6
import com.devonfw.tools.ide.common.Tag;
7
import com.devonfw.tools.ide.context.IdeContext;
8
import com.devonfw.tools.ide.environment.EnvironmentVariablesFiles;
9
import com.devonfw.tools.ide.version.VersionIdentifier;
10

11
/**
12
 * {@link ToolCommandlet} that delegates to another ToolCommandlet.
13
 *
14
 * @param <D> type of the {@link ToolCommandlet} to delegate to.
15
 */
16
public abstract class DelegatingToolCommandlet<D extends ToolCommandlet> extends ToolCommandlet {
17

18
  private final Class<D> delegateClass;
19

20
  /**
21
   * The constructor.
22
   *
23
   * @param context the {@link IdeContext}.
24
   * @param tool the {@link #getName() tool name}.
25
   * @param tags the {@link #getTags() tags} classifying the tool. Should be created via {@link Set#of(Object) Set.of} method.
26
   * @param delegateClass the {@link ToolCommandlet}.
27
   */
28
  public DelegatingToolCommandlet(IdeContext context, String tool, Set<Tag> tags, Class<D> delegateClass) {
29

30
    super(context, tool, tags);
5✔
31
    this.delegateClass = delegateClass;
3✔
32
  }
1✔
33

34
  private D getDelegate() {
35
    return getCommandlet(this.delegateClass);
×
36
  }
37

38
  @Override
39
  public ToolInstallation install(ToolInstallRequest request) {
40
    return getDelegate().install(request);
×
41
  }
42

43
  @Override
44
  protected ToolInstallation doInstall(ToolInstallRequest request) {
45
    return getDelegate().doInstall(request);
×
46
  }
47

48
  @Override
49
  public VersionIdentifier getInstalledVersion() {
50
    return getDelegate().getInstalledVersion();
×
51
  }
52

53
  @Override
54
  public String getInstalledEdition() {
55
    return getDelegate().getInstalledEdition();
×
56
  }
57

58
  @Override
59
  protected Path getInstallationPath(String edition, VersionIdentifier resolvedVersion) {
60

61
    return getDelegate().getInstallationPath(edition, resolvedVersion);
×
62
  }
63

64
  @Override
65
  public void uninstall() {
66
    getDelegate().uninstall();
×
67
  }
×
68

69
  @Override
70
  public void listEditions() {
71
    getDelegate().listEditions();
×
72
  }
×
73

74
  @Override
75
  public void listVersions() {
76
    getDelegate().listVersions();
×
77
  }
×
78

79
  @Override
80
  public void setVersion(VersionIdentifier version, boolean hint, EnvironmentVariablesFiles destination) {
81
    getDelegate().setVersion(version, hint, destination);
×
82
  }
×
83

84
  @Override
85
  public void setEdition(String edition, boolean hint, EnvironmentVariablesFiles destination) {
86
    getDelegate().setEdition(edition, hint, destination);
×
87
  }
×
88
}
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