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

devonfw / IDEasy / 16608545412

29 Jul 2025 10:10PM UTC coverage: 69.092% (+0.5%) from 68.562%
16608545412

Pull #1435

github

web-flow
Merge c08efa9c4 into 45ff803eb
Pull Request #1435: increase coverage

3322 of 5246 branches covered (63.32%)

Branch coverage included in aggregate %.

8557 of 11947 relevant lines covered (71.62%)

3.16 hits per line

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

73.53
cli/src/main/java/com/devonfw/tools/ide/npm/NpmJsonVersions.java
1
package com.devonfw.tools.ide.npm;
2

3
import java.util.HashMap;
4
import java.util.Map;
5
import java.util.Objects;
6
import java.util.TreeMap;
7

8
import com.devonfw.tools.ide.json.JsonObject;
9
import com.fasterxml.jackson.annotation.JsonAnyGetter;
10
import com.fasterxml.jackson.annotation.JsonAnySetter;
11

12
/**
13
 * {@link JsonObject} for {@link NpmJsonVersion}.
14
 */
15
public class NpmJsonVersions {
2✔
16

17
  private Map<String, NpmJsonVersion> versions = new TreeMap<>();
6✔
18

19
  @JsonAnySetter
20
  public void setDetails(String key, NpmJsonVersion val) {
21

22
    if (this.versions == null) {
3!
23
      this.versions = new HashMap<>();
×
24
    }
25
    this.versions.put(key, val);
6✔
26
  }
1✔
27

28
  /**
29
   * @return the {@link Map} of {@link NpmJsonVersion}s.
30
   */
31
  @JsonAnyGetter
32
  public Map<String, NpmJsonVersion> getVersionMap() {
33

34
    return this.versions;
3✔
35
  }
36

37
  @Override
38
  public int hashCode() {
39

40
    return this.versions.size();
×
41
  }
42

43
  @Override
44
  public boolean equals(Object obj) {
45

46
    if (this == obj) {
3✔
47
      return true;
2✔
48
    } else if (!(obj instanceof NpmJsonVersions)) {
3!
49
      return false;
×
50
    }
51
    NpmJsonVersions other = (NpmJsonVersions) obj;
3✔
52
    if (this.versions.size() != other.versions.size()) {
7!
53
      return false;
×
54
    }
55
    for (String key : this.versions.keySet()) {
12✔
56
      NpmJsonVersion myVersion = this.versions.get(key);
6✔
57
      NpmJsonVersion otherVersion = other.versions.get(key);
6✔
58
      if (!Objects.equals(myVersion, otherVersion)) {
4!
59
        return false;
×
60
      }
61
    }
1✔
62
    return true;
2✔
63
  }
64
}
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