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

devonfw / IDEasy / 9907372175

12 Jul 2024 11:49AM UTC coverage: 61.142% (-0.02%) from 61.162%
9907372175

push

github

hohwille
fixed tests

1997 of 3595 branches covered (55.55%)

Branch coverage included in aggregate %.

5296 of 8333 relevant lines covered (63.55%)

2.8 hits per line

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

60.0
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 com.devonfw.tools.ide.context.IdeContext;
6
import com.devonfw.tools.ide.os.WindowsPathSyntax;
7

8
/**
9
 * Implementation of {@link EnvironmentVariables}.
10
 */
11
abstract class EnvironmentVariablesMap extends AbstractEnvironmentVariables {
12

13
  /**
14
   * The constructor.
15
   *
16
   * @param parent the parent {@link EnvironmentVariables} to inherit from.
17
   * @param context the {@link IdeContext}.
18
   */
19
  EnvironmentVariablesMap(AbstractEnvironmentVariables parent, IdeContext context) {
20

21
    super(parent, context);
4✔
22
  }
1✔
23

24
  /**
25
   * @return the {@link Map} with the underlying variables. Internal method do not call from outside and never manipulate this {@link Map} externally.
26
   */
27
  protected abstract Map<String, String> getVariables();
28

29
  @Override
30
  public String getFlat(String name) {
31

32
    String value = getVariables().get(name);
6✔
33
    if (value == null) {
2✔
34
      this.context.trace("{}: Variable {} is undefined.", getSource(), name);
16✔
35
    } else {
36
      this.context.trace("{}: Variable {}={}", getSource(), name, value);
19✔
37
      WindowsPathSyntax pathSyntax = this.context.getPathSyntax();
4✔
38
      if (pathSyntax != null) {
2!
39
        String normalized = pathSyntax.normalize(value);
×
40
        if (!value.equals(normalized)) {
×
41
          this.context.trace("Normalized {} using {} to {}", value, pathSyntax, normalized);
×
42
          value = normalized;
×
43
        }
44
      }
45
    }
46
    return value;
2✔
47
  }
48

49
  @Override
50
  public String toString() {
51

52
    return getSource() + ":\n" + getVariables();
×
53
  }
54

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

© 2025 Coveralls, Inc