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

devonfw / IDEasy / 19791210375

30 Nov 2025 12:14AM UTC coverage: 69.539% (+0.1%) from 69.41%
19791210375

Pull #1620

github

web-flow
Merge 364b58e0a into 011f82b20
Pull Request #1620: cleanup: link parameters + test and additionalInstallation

3708 of 5861 branches covered (63.27%)

Branch coverage included in aggregate %.

9638 of 13331 relevant lines covered (72.3%)

3.15 hits per line

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

86.67
cli/src/main/java/com/devonfw/tools/ide/tool/repository/CustomToolsJsonDeserializer.java
1
package com.devonfw.tools.ide.tool.repository;
2

3
import java.io.IOException;
4
import java.util.ArrayList;
5
import java.util.List;
6

7
import com.devonfw.tools.ide.json.JsonMapping;
8
import com.fasterxml.jackson.core.JsonParser;
9
import com.fasterxml.jackson.core.JsonToken;
10
import com.fasterxml.jackson.databind.DeserializationContext;
11
import com.fasterxml.jackson.databind.JsonDeserializer;
12

13
/**
14
 * {@link JsonDeserializer} for {@link CustomToolsJson}.
15
 */
16
public class CustomToolsJsonDeserializer extends JsonDeserializer<CustomToolsJson> {
4✔
17

18
  private static final String INVALID_CUSTOM_TOOLS = "Invalid JSON for custom tools!";
19

20
  @Override
21
  public CustomToolsJson deserialize(JsonParser p, DeserializationContext context) throws IOException {
22

23
    JsonToken token = p.getCurrentToken();
3✔
24
    if (token == JsonToken.START_OBJECT) {
3!
25
      token = p.nextToken();
3✔
26
      String url = null;
2✔
27
      List<CustomToolJson> tools = new ArrayList<>();
4✔
28
      while (token == JsonToken.FIELD_NAME) {
3✔
29
        String property = p.currentName();
3✔
30
        if (property.equals(CustomToolsJson.PROPERTY_URL)) {
4✔
31
          token = p.nextToken();
3✔
32
          assert token == JsonToken.VALUE_STRING;
4!
33
          url = p.getValueAsString();
4✔
34
        } else if (property.equals(CustomToolsJson.PROPERTY_TOOLS)) {
4✔
35
          token = p.nextToken();
3✔
36
          if (token == JsonToken.START_ARRAY) {
3!
37
            token = p.nextToken();
3✔
38
            while (token != JsonToken.END_ARRAY) {
3✔
39
              CustomToolJson customToolJson = p.readValueAs(CustomToolJson.class);
5✔
40
              tools.add(customToolJson);
4✔
41
              token = p.nextToken();
3✔
42
            }
1✔
43
          }
44
        } else {
45
          // ignore unknown property
46
          // currently cannot log here due to https://github.com/devonfw/IDEasy/issues/404
47
          JsonMapping.skipCurrentField(p);
2✔
48
        }
49
        token = p.nextToken();
3✔
50
      }
1✔
51
      if ((url != null) && !tools.isEmpty()) {
5!
52
        return new CustomToolsJson(url, tools);
6✔
53
      }
54
    }
55
    throw new IllegalStateException(INVALID_CUSTOM_TOOLS);
×
56
  }
57

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