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

devonfw / IDEasy / 22284264868

22 Feb 2026 08:00PM UTC coverage: 70.75% (+0.3%) from 70.474%
22284264868

Pull #1714

github

web-flow
Merge 98f01421f into 379acdc9d
Pull Request #1714: #404: #1713: advanced logging

4063 of 6346 branches covered (64.02%)

Branch coverage included in aggregate %.

10636 of 14430 relevant lines covered (73.71%)

3.1 hits per line

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

90.0
cli/src/main/java/com/devonfw/tools/ide/commandlet/UninstallCommandlet.java
1
package com.devonfw.tools.ide.commandlet;
2

3
import org.slf4j.Logger;
4
import org.slf4j.LoggerFactory;
5

6
import com.devonfw.tools.ide.context.IdeContext;
7
import com.devonfw.tools.ide.property.ToolProperty;
8
import com.devonfw.tools.ide.tool.IdeasyCommandlet;
9
import com.devonfw.tools.ide.tool.ToolCommandlet;
10

11
/**
12
 * An internal {@link Commandlet} to uninstall a tool.
13
 */
14
public class UninstallCommandlet extends Commandlet {
15

16
  private static final Logger LOG = LoggerFactory.getLogger(UninstallCommandlet.class);
4✔
17

18
  /** The tool to uninstall. */
19
  public final ToolProperty tools;
20

21
  /**
22
   * The constructor.
23
   *
24
   * @param context the {@link IdeContext}.
25
   */
26
  public UninstallCommandlet(IdeContext context) {
27

28
    super(context);
3✔
29
    addKeyword(getName());
4✔
30
    this.tools = add(new ToolProperty("", false, true, "tool"));
12✔
31
  }
1✔
32

33
  @Override
34
  public String getName() {
35

36
    return "uninstall";
2✔
37
  }
38

39
  @Override
40
  public boolean isIdeRootRequired() {
41

42
    return this.tools.getValueCount() > 0;
6!
43
  }
44

45
  @Override
46
  protected void doRun() {
47

48
    int valueCount = this.tools.getValueCount();
4✔
49
    if (valueCount == 0) {
2✔
50
      if (!this.context.isForceMode()) {
4!
51
        this.context.askToContinue("Sub-command uninstall without any further arguments will perform the entire uninstallation of IDEasy.\n"
×
52
            + "Since this is typically not to be called manually, you may have forgotten to specify the tool to install as extra argument.\n"
53
            + "The current command will uninstall IDEasy from your computer. Are you sure?");
54
      }
55
      IdeasyCommandlet ideasy = new IdeasyCommandlet(this.context);
6✔
56
      ideasy.uninstallIdeasy();
2✔
57
      return;
1✔
58
    }
59
    for (int i = 0; i < valueCount; i++) {
7✔
60
      ToolCommandlet toolCommandlet = this.tools.getValue(i);
6✔
61
      if (toolCommandlet.isInstalled()) {
3✔
62
        toolCommandlet.uninstall();
3✔
63
      } else {
64
        LOG.warn("Couldn't uninstall " + toolCommandlet.getName() + " because we could not find an installation");
5✔
65
      }
66
    }
67
  }
1✔
68
}
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