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

devonfw / IDEasy / 19790688145

29 Nov 2025 11:20PM UTC coverage: 69.42% (-0.01%) from 69.431%
19790688145

Pull #1619

github

web-flow
Merge f911699f8 into 907818bed
Pull Request #1619: #1616: fixed postInstall problems

3698 of 5857 branches covered (63.14%)

Branch coverage included in aggregate %.

9621 of 13329 relevant lines covered (72.18%)

3.14 hits per line

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

87.88
cli/src/main/java/com/devonfw/tools/ide/tool/jmc/Jmc.java
1
package com.devonfw.tools.ide.tool.jmc;
2

3
import java.io.IOException;
4
import java.nio.file.Files;
5
import java.nio.file.Path;
6
import java.util.Iterator;
7
import java.util.Set;
8
import java.util.stream.Stream;
9

10
import com.devonfw.tools.ide.common.Tag;
11
import com.devonfw.tools.ide.context.IdeContext;
12
import com.devonfw.tools.ide.io.FileAccess;
13
import com.devonfw.tools.ide.process.ProcessMode;
14
import com.devonfw.tools.ide.tool.LocalToolCommandlet;
15
import com.devonfw.tools.ide.tool.ToolCommandlet;
16

17
/**
18
 * {@link ToolCommandlet} for <a href="https://www.oracle.com/java/technologies/jdk-mission-control.html">JDK Mission Control</a>, An advanced set of tools for
19
 * managing, monitoring, profiling, and troubleshooting Java applications.
20
 */
21
public class Jmc extends LocalToolCommandlet {
22

23
  /**
24
   * The constructor.
25
   *
26
   * @param context the {@link IdeContext}. method.
27
   */
28
  public Jmc(IdeContext context) {
29

30
    super(context, "jmc", Set.of(Tag.JAVA, Tag.ANALYSE));
7✔
31
  }
1✔
32

33
  @Override
34
  public void run() {
35

36
    runTool(ProcessMode.BACKGROUND, null, this.arguments.asArray());
8✔
37
  }
1✔
38

39
  @Override
40
  protected void postExtract(Path extractedDir) {
41

42
    super.postExtract(extractedDir);
3✔
43
    if (this.context.getSystemInfo().isWindows() || this.context.getSystemInfo().isLinux()) {
10✔
44
      Path oldBinaryPath = extractedDir.resolve("JDK Mission Control");
4✔
45
      if (Files.isDirectory(oldBinaryPath)) {
5!
46
        FileAccess fileAccess = this.context.getFileAccess();
4✔
47
        moveFilesAndDirs(oldBinaryPath, extractedDir);
4✔
48
        fileAccess.delete(oldBinaryPath);
3✔
49
      } else {
1✔
50
        this.context.debug(
×
51
            "JMC binary folder not found at {} - ignoring as this legacy problem may be resolved in newer versions.",
52
            oldBinaryPath);
53
      }
54
    }
55
  }
1✔
56

57
  private void moveFilesAndDirs(Path sourceFolder, Path targetFolder) {
58

59
    FileAccess fileAccess = this.context.getFileAccess();
4✔
60
    try (Stream<Path> childStream = Files.list(sourceFolder)) {
3✔
61
      Iterator<Path> iterator = childStream.iterator();
3✔
62
      while (iterator.hasNext()) {
3✔
63
        Path child = iterator.next();
4✔
64
        fileAccess.move(child, targetFolder.resolve(child.getFileName()));
9✔
65
      }
1✔
66
    } catch (IOException e) {
×
67
      throw new IllegalStateException("Failed to list files to move in " + sourceFolder, e);
×
68
    }
1✔
69
  }
1✔
70

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