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

devonfw / IDEasy / 32943560171

26 Aug 2026 07:36AM UTC coverage: 73.807% (+0.2%) from 73.628%
32943560171

Pull #2282

github

web-flow
Merge 87828e441 into ea838b0fd
Pull Request #2282: #989: allow expressions in template variable definitions

5441 of 8200 branches covered (66.35%)

Branch coverage included in aggregate %.

14196 of 18406 relevant lines covered (77.13%)

3.29 hits per line

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

81.82
cli/src/main/java/com/devonfw/tools/ide/environment/EnvironmentVariablesMap.java
1
package com.devonfw.tools.ide.environment;
2

3
import java.util.Map;
4

5
import org.slf4j.Logger;
6
import org.slf4j.LoggerFactory;
7

8
import com.devonfw.tools.ide.context.IdeContext;
9
import com.devonfw.tools.ide.os.WindowsPathSyntax;
10

11
/**
12
 * Implementation of {@link EnvironmentVariables}.
13
 */
14
abstract class EnvironmentVariablesMap extends AbstractEnvironmentVariables {
15

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

18
  /**
19
   * The constructor.
20
   *
21
   * @param parent the parent {@link EnvironmentVariables} to inherit from.
22
   * @param context the {@link IdeContext}.
23
   */
24
  EnvironmentVariablesMap(AbstractEnvironmentVariables parent, IdeContext context) {
25

26
    super(parent, context);
4 ✔
27
  }
1 ✔
28

29
  /**
30
   * @return the {@link Map} with the underlying variables. Internal method do not call from outside and never manipulate this {@link Map} externally.
31
   */
32
  protected abstract Map<String, String> getVariables();
33

34
  @Override
35
  public String getFlat(String name) {
36

37
    String value = getVariables().get(name);
6 ✔
38
    if (value == null) {
2 ✔
39
      LOG.trace("{}: Variable {} is undefined.", getSource(), name);
7 ✔
40
    } else {
41
      // register the value before it is logged so that a secret variable read from an existing ide.properties is
42
      // masked as well, not only a value that was just entered by the user
43
      this.context.addSecretValue(name, value);
5 ✔
44
      LOG.trace("{}: Variable {}={}", getSource(), name, value);
18 ✔
45
      WindowsPathSyntax pathSyntax = this.context.getPathSyntax();
4 ✔
46
      if (pathSyntax != null) {
2 ✔
47
        String normalized = pathSyntax.normalize(value);
4 ✔
48
        if (!value.equals(normalized)) {
4 !
49
          LOG.trace("Normalized {} using {} to {}", value, pathSyntax, normalized);
×
50
          value = normalized;
×
51
        }
52
      }
53
    }
54
    return value;
2 ✔
55
  }
56

57
  @Override
58
  public String toString() {
59

60
    return getSource() + ":\n" + getVariables();
×
61
  }
62

63
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc