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

devonfw / IDEasy / 23245836110

18 Mar 2026 12:58PM UTC coverage: 70.687% (+0.06%) from 70.626%
23245836110

Pull #1757

github

web-flow
Merge 4a4f56114 into 66ce91d51
Pull Request #1757: #1751: go-lang commandlet

4164 of 6490 branches covered (64.16%)

Branch coverage included in aggregate %.

10804 of 14685 relevant lines covered (73.57%)

3.1 hits per line

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

98.16
cli/src/main/java/com/devonfw/tools/ide/common/Tag.java
1
package com.devonfw.tools.ide.common;
2

3
import java.util.Collection;
4
import java.util.Collections;
5
import java.util.HashMap;
6
import java.util.HashSet;
7
import java.util.Locale;
8
import java.util.Map;
9
import java.util.Objects;
10
import java.util.Set;
11

12
/**
13
 * A {@link Tag} represents a classifier or category. A tool and plugin can be associated with {@link Tag}s allowing end users to find them.
14
 */
15
public final class Tag {
16

17
  private static final Tag[] NO_TAGS = new Tag[0];
3✔
18

19
  private static final Map<String, Tag> TAG_MAP = new HashMap<>(128);
5✔
20

21
  private static final Collection<Tag> ALL_TAGS = Collections.unmodifiableCollection(TAG_MAP.values());
4✔
22

23
  /** The root {@link Tag}. */
24
  public static final Tag ROOT = new Tag();
4✔
25

26
  static {
27
    TAG_MAP.put(ROOT.id, ROOT);
6✔
28
  }
29

30
  /** {@link #getParent() Parent} for miscellaneous (undefined) tags. */
31
  public static final Tag MISC = create("miscellaneous", ROOT, true, "misc");
6✔
32

33
  /** {@link #getParent() Parent} for programming-languages. */
34
  public static final Tag LANGUAGE = create("language", ROOT, true, "programming");
6✔
35

36
  /** {@link Tag} for JVM (Java Virtual Machine). */
37
  public static final Tag JVM = create("java-virtual-machine", LANGUAGE, false, "jvm");
6✔
38

39
  /** {@link Tag} for Java. */
40
  public static final Tag JAVA = create("java", JVM);
4✔
41

42
  /** {@link Tag} for Go. */
43
  public static final Tag GO = create("go", LANGUAGE);
4✔
44

45
  /** {@link Tag} for Kotlin. */
46
  public static final Tag KOTLIN = create("kotlin", JVM);
4✔
47

48
  /** {@link Tag} for Scala. */
49
  public static final Tag SCALA = create("scala", JVM);
4✔
50

51
  /** {@link Tag} for DotNet (.NET). */
52
  public static final Tag DOTNET = create("dotnet", LANGUAGE, false, "net");
6✔
53

54
  /** {@link Tag} for C#. */
55
  public static final Tag CS = create("c#", DOTNET, false, "cs", "csharp");
15✔
56

57
  /** {@link Tag} for C. */
58
  public static final Tag C = create("c", LANGUAGE);
4✔
59

60
  /** {@link Tag} for Rust. */
61
  public static final Tag RUST = create("rust", LANGUAGE, false, "rs");
6✔
62

63
  /** {@link Tag} for C++. */
64
  public static final Tag CPP = create("c++", LANGUAGE, false, "cpp");
6✔
65

66
  /** {@link Tag} for Python. */
67
  public static final Tag PYTHON = create("python", LANGUAGE);
4✔
68

69
  /** {@link Tag} for Ruby. */
70
  public static final Tag RUBY = create("ruby", LANGUAGE);
4✔
71

72
  /** {@link Tag} for Perl. */
73
  public static final Tag PERL = create("perl", LANGUAGE);
4✔
74

75
  /** {@link Tag} for Shell scripting. */
76
  public static final Tag SHELL = create("shell", JVM, false, "script");
6✔
77

78
  /** {@link Tag} for Bash. */
79
  public static final Tag BASH = create("bash", SHELL, false, "terminal");
6✔
80

81
  /** {@link Tag} for TypeScript. */
82
  public static final Tag JAVA_SCRIPT = create("javascript", LANGUAGE, false, "js");
6✔
83

84
  /** {@link Tag} for TypeScript. */
85
  public static final Tag TYPE_SCRIPT = create("typescript", JAVA_SCRIPT, false, "ts");
6✔
86

87
  /** {@link #getParent() Parent} for programming-languages. */
88
  public static final Tag IDE = create("ide", ROOT);
4✔
89

90
  /** {@link Tag} for Eclipse. */
91
  public static final Tag ECLIPSE = create("eclipse", IDE);
4✔
92

93
  /** {@link Tag} for IDEA (JetBrains IDE Platform). */
94
  public static final Tag IDEA = create("idea", IDE);
4✔
95

96
  /** {@link Tag} for IntelliJ. */
97
  public static final Tag INTELLIJ = create("intellij", IDEA);
4✔
98

99
  /** {@link Tag} for Android-Studio. */
100
  public static final Tag ANDROID_STUDIO = create("android-studio", IDEA);
4✔
101

102
  /** {@link Tag} for Pycharm. */
103
  public static final Tag PYCHARM = create("pycharm", IDEA);
4✔
104

105
  /** {@link Tag} for VS-Code. */
106
  public static final Tag VS_CODE = create("vscode", IDE, false, "visualstudiocode");
6✔
107

108
  /** {@link Tag} for (code-)generators (including template-engines, etc.). */
109
  public static final Tag GENERATOR = create("generator", ROOT);
4✔
110

111
  /** {@link #getParent() Parent} for frameworks. */
112
  public static final Tag FRAMEWORK = create("framework", ROOT, true);
5✔
113

114
  /** {@link Tag} for Spring(framework). */
115
  public static final Tag SPRING = create("spring", FRAMEWORK, false, new String[] { "springframework", "springboot" },
21✔
116
      JAVA);
117

118
  /** {@link Tag} for Quarkus. */
119
  public static final Tag QUARKUS = create("quarkus", FRAMEWORK, false, null, JAVA);
12✔
120

121
  /** {@link Tag} for Micronaut. */
122
  public static final Tag MICRONAUT = create("micronaut", FRAMEWORK, false, null, JAVA);
12✔
123

124
  /** {@link Tag} for Angular. */
125
  public static final Tag ANGULAR = create("angular", FRAMEWORK, false, new String[] { "ng", "angularjs" },
21✔
126
      TYPE_SCRIPT);
127

128
  /** {@link Tag} for React. */
129
  public static final Tag REACT = create("react", FRAMEWORK, false, null, TYPE_SCRIPT);
12✔
130

131
  /** {@link Tag} for Vue. */
132
  public static final Tag VUE = create("vue", FRAMEWORK, false, null, TYPE_SCRIPT);
12✔
133

134
  /** {@link Tag} for Cordova. */
135
  public static final Tag CORDOVA = create("cordova", FRAMEWORK, false, null, JAVA_SCRIPT);
12✔
136

137
  /** {@link Tag} for Ionic. */
138
  public static final Tag IONIC = create("ionic", CORDOVA, false);
5✔
139

140
  /** {@link #getParent() Parent} for quality-assurance. */
141
  public static final Tag QA = create("quality-assurance", ROOT, false, "qa", "quality");
15✔
142

143
  /** {@link Tag} for everything related to testing. */
144
  public static final Tag TEST = create("testing", QA, false, "test");
6✔
145

146
  /** {@link Tag} for everything related to testing. */
147
  public static final Tag MOCK = create("mocking", TEST, false, "mock");
6✔
148

149
  /** {@link Tag} for everything related to testing. */
150
  public static final Tag CODE_QA = create("static-code-analysis", QA, false, "codeqa");
6✔
151

152
  /** {@link #getParent() Parent} for linters. */
153
  public static final Tag LINTING = create("linter", QA, false, "lint", "linting");
15✔
154

155
  /** {@link Tag} for everything related to documentation. */
156
  public static final Tag DOCUMENTATION = create("documentation", ROOT, false, "doc");
6✔
157

158
  /** {@link #getParent() Parent} for file formats. */
159
  public static final Tag FORMAT = create("format", ROOT, true);
5✔
160

161
  /** {@link Tag} for JSON. */
162
  public static final Tag JSON = create("json", FORMAT);
4✔
163

164
  /** {@link Tag} for YAML. */
165
  public static final Tag YAML = create("yaml", FORMAT, false, "yml");
6✔
166

167
  /** {@link Tag} for CSS. */
168
  public static final Tag CSS = create("css", FORMAT);
4✔
169

170
  /** {@link Tag} for Properties. */
171
  public static final Tag PROPERTIES = create("properties", FORMAT);
4✔
172

173
  /** {@link Tag} for AsciiDoc. */
174
  public static final Tag ASCII_DOC = create("ascii-doc", FORMAT, false, new String[] { "adoc" }, DOCUMENTATION);
17✔
175

176
  /** {@link Tag} for MarkDown. */
177
  public static final Tag MARK_DOWN = create("markdown", DOCUMENTATION, false, new String[] { "md" }, DOCUMENTATION);
17✔
178

179
  /** {@link Tag} for YAML. */
180
  public static final Tag PDF = create("pdf", FORMAT, false, null, DOCUMENTATION);
12✔
181

182
  /** {@link Tag} for HTML. */
183
  public static final Tag HTML = create("html", FORMAT, false, null, DOCUMENTATION);
12✔
184

185
  /** {@link Tag} for machine-learning. */
186
  public static final Tag MACHINE_LEARNING = create("machine-learning", ROOT, false, "ml");
6✔
187

188
  /** {@link Tag} for artificial-intelligence. */
189
  public static final Tag ARTIFICIAL_INTELLIGENCE = create("artificial-intelligence", MACHINE_LEARNING, false, "ai");
6✔
190

191
  /** {@link Tag} for data-science. */
192
  public static final Tag DATA_SCIENCE = create("data-science", ROOT);
4✔
193

194
  /** {@link Tag} for business-intelligence. */
195
  public static final Tag BUSINESS_INTELLIGENCE = create("business-intelligence", ROOT, false, "bi", "datawarehouse",
19✔
196
      "dwh");
197

198
  /** {@link #Tag} for productivity. */
199
  public static final Tag ARCHITECTURE = create("architecture", ROOT);
4✔
200

201
  /** {@link Tag} for AsciiDoc. */
202
  public static final Tag UML = create("uml", ARCHITECTURE, false, null, DOCUMENTATION);
12✔
203

204
  /** {@link #Tag} for security. */
205
  public static final Tag SECURITY = create("security", ROOT, false, "cve");
6✔
206

207
  /** {@link #Tag} for collaboration. */
208
  public static final Tag COLLABORATION = create("collaboration", ROOT, false, "collab");
6✔
209

210
  /** {@link #Tag} for virtualization. */
211
  public static final Tag VIRTUALIZATION = create("virtualization", ROOT, false, "vm");
6✔
212

213
  /** {@link #Tag} for docker. */
214
  public static final Tag DOCKER = create("docker", VIRTUALIZATION);
4✔
215

216
  /** {@link #Tag} for docker. */
217
  public static final Tag KUBERNETES = create("kubernetes", DOCKER, false, "k8s");
6✔
218

219
  /** {@link #Tag} for WSL. */
220
  public static final Tag WSL = create("wsl", VIRTUALIZATION);
4✔
221

222
  /** {@link Tag} for everything related to databases. */
223
  public static final Tag DB = create("database", ROOT);
4✔
224

225
  /** {@link Tag} for administration tools. */
226
  public static final Tag ADMIN = create("admin", ROOT);
4✔
227

228
  /** {@link #Tag} for network. */
229
  public static final Tag NETWORK = create("network", ROOT, false, "remote");
6✔
230

231
  /** {@link #Tag} for HTTP. */
232
  public static final Tag HTTP = create("http", NETWORK);
4✔
233

234
  /** {@link #Tag} for REST. */
235
  public static final Tag REST = create("rest", HTTP);
4✔
236

237
  /** {@link #Tag} for secure-shell. */
238
  public static final Tag SSH = create("secure-shell", NETWORK, false, "ssh", "scp");
15✔
239

240
  /** {@link #Tag} for capture. */
241
  public static final Tag CAPTURE = create("capture", ROOT, false, "capturing");
6✔
242

243
  /** {@link #Tag} for capture. */
244
  public static final Tag SCREENSHOT = create("screenshot", CAPTURE);
4✔
245

246
  /** {@link #Tag} for capture. */
247
  public static final Tag SCREEN_RECORDING = create("screenrecording", CAPTURE, false, "videocapture");
6✔
248

249
  /** {@link #Tag} for productivity. */
250
  public static final Tag PRODUCTIVITY = create("productivity", ROOT);
4✔
251

252
  /** {@link #Tag} for regular-expression. */
253
  public static final Tag REGEX = create("regular-expression", PRODUCTIVITY, false, "regex", "regexp");
15✔
254

255
  /** {@link #Tag} for search. */
256
  public static final Tag SEARCH = create("search", PRODUCTIVITY, false, "find");
6✔
257

258
  /** {@link #Tag} for spellchecker. */
259
  public static final Tag SPELLCHECKER = create("spellchecker", PRODUCTIVITY, false, "spellcheck", "spellchecking");
15✔
260

261
  /** {@link #Tag} for analyse. */
262
  public static final Tag ANALYSE = create("analyse", ROOT, false, "analyze", "analysis");
15✔
263

264
  /** {@link #Tag} for monitoring. */
265
  public static final Tag MONITORING = create("monitoring", ANALYSE, false, "monitor");
6✔
266

267
  /** {@link #Tag} for formatter. */
268
  public static final Tag FORMATTER = create("formatter", ROOT, false, "codeformat", "codeformatter");
15✔
269

270
  /** {@link #Tag} for user-experience. */
271
  public static final Tag UX = create("user-experience", PRODUCTIVITY, false, "ux");
6✔
272

273
  /** {@link #Tag} for style. */
274
  public static final Tag STYLE = create("style", UX, false, "theme", "icon", "skin");
19✔
275

276
  /** {@link #Tag} for style. */
277
  public static final Tag KEYBINDING = create("keybinding", UX, false, "keybindings", "keymap");
15✔
278

279
  /** {@link #Tag} for draw(ing). */
280
  public static final Tag DRAW = create("draw", UX, false, "diagram", "paint");
15✔
281

282
  /** {@link #Tag} for cloud. */
283
  public static final Tag CLOUD = create("cloud", ROOT);
4✔
284

285
  /** {@link #Tag} for infrastructure-as-code. */
286
  public static final Tag IAC = create("infrastructure-as-code", CLOUD, false, "iac");
6✔
287

288
  /** {@link #Tag} for software-configuration-management. */
289
  public static final Tag CONFIG_MANAGEMENT = create("software-configuration-management", ROOT, false,
15✔
290
      "configmanagement", "configurationmanagement");
291

292
  /** {@link #Tag} for build-management. */
293
  public static final Tag BUILD = create("build-management", CONFIG_MANAGEMENT, false, "build");
6✔
294

295
  /** {@link #Tag} for version-control. */
296
  public static final Tag VCS = create("version-control", CONFIG_MANAGEMENT, false, "vcs", "versioncontrolsystem");
15✔
297

298
  /** {@link #Tag} for issue-management. */
299
  public static final Tag ISSUE = create("issue-management", CONFIG_MANAGEMENT, false, "issue");
6✔
300

301
  /** {@link #Tag} for git. */
302
  public static final Tag GIT = create("git", VCS);
4✔
303

304
  /** {@link #Tag} for github. */
305
  public static final Tag GITHUB = create("github", GIT);
4✔
306

307

308
  /** {@link #Tag} for diff (tools that compare files and determine the difference). */
309
  public static final Tag DIFF = create("diff", CONFIG_MANAGEMENT, false, "patch");
6✔
310

311
  /** {@link #Tag} for diff (tools that compare files and determine the difference). */
312
  public static final Tag RUNTIME = create("runtime", ROOT);
4✔
313

314
  /** {@link #getParent() Parent} for operating-system. */
315
  public static final Tag OS = create("operating-system", ROOT, true, "os");
6✔
316

317
  /** {@link #Tag} for Windows. */
318
  public static final Tag WINDOWS = create("windows", OS);
4✔
319

320
  /** {@link #Tag} for Mac. */
321
  public static final Tag MAC = create("mac", OS, false, "macos", "osx");
15✔
322

323
  /** {@link #Tag} for Linux. */
324
  public static final Tag LINUX = create("linux", OS, false);
5✔
325

326
  /** {@link #getParent() Parent} for cryptography. */
327
  public static final Tag CRYPTO = create("cryptography", ROOT, false, "crypto");
6✔
328

329
  /** {@link #Tag} for encryption. */
330
  public static final Tag ENCRYPTION = create("encryption", CRYPTO);
5✔
331

332
  private final String id;
333

334
  private final Tag parent;
335

336
  private final boolean isAbstract;
337

338
  private final Tag[] additionalParents;
339

340
  private Tag() {
2✔
341

342
    this.id = "<root>";
3✔
343
    this.parent = null;
3✔
344
    this.isAbstract = true;
3✔
345
    this.additionalParents = NO_TAGS;
3✔
346
  }
1✔
347

348
  private Tag(String id, Tag parent, boolean isAbstract, Tag... additionalParents) {
349

350
    super();
2✔
351
    Objects.requireNonNull(id);
3✔
352
    Objects.requireNonNull(parent);
3✔
353
    assert (id.toLowerCase(Locale.ROOT).equals(id));
7!
354
    this.id = id;
3✔
355
    this.parent = parent;
3✔
356
    this.isAbstract = isAbstract;
3✔
357
    this.additionalParents = additionalParents;
3✔
358
  }
1✔
359

360
  /**
361
   * @return the identifier and name of this tag.
362
   */
363
  public String getId() {
364

365
    return this.id;
3✔
366
  }
367

368
  /**
369
   * @return the parent {@link Tag} or {@code null} if this is the root tag.
370
   */
371
  public Tag getParent() {
372

373
    return this.parent;
3✔
374
  }
375

376
  /**
377
   * @param i the index of the requested parent. Should be in the range from {@code 0} to
378
   *     <code>{@link #getParentCount()}-1</code>.
379
   * @return the requested {@link Tag}.
380
   */
381
  public Tag getParent(int i) {
382

383
    if (i == 0) {
2✔
384
      return this.parent;
3✔
385
    }
386
    return this.additionalParents[i - 1];
7✔
387
  }
388

389
  /**
390
   * @return the number of {@link #getParent(int) parents} available.
391
   */
392
  public int getParentCount() {
393

394
    if (this.parent == null) {
3✔
395
      return 0;
2✔
396
    }
397
    return this.additionalParents.length + 1;
6✔
398
  }
399

400
  /**
401
   * @return {@code true} if this {@link Tag} is abstract and cannot be selected since it is just a generic parent container, {@code false} otherwise.
402
   */
403
  public boolean isAbstract() {
404

405
    return this.isAbstract;
3✔
406
  }
407

408
  public boolean isAncestorOf(Tag tag) {
409

410
    return isAncestorOf(tag, false);
5✔
411
  }
412

413
  /**
414
   * @param tag the {@link Tag} to check.
415
   * @param includeAdditionalParents - {@code true} if {@link #getParent(int) additional parents} should be included, {@code false} otherwise (only consider
416
   *     {@link #getParent() primary parent}).
417
   * @return {@code true} if the given {@link Tag} is an ancestor of this tag, {@code false} otherwise. An ancestor is a direct or indirect
418
   *     {@link #getParent() parent}. Therefore, if {@link #ROOT} is given as {@link Tag} parameter, this method should always return {@code true}.
419
   */
420
  public boolean isAncestorOf(Tag tag, boolean includeAdditionalParents) {
421

422
    Tag ancestor = this.parent;
3✔
423
    while (ancestor != null) {
2✔
424
      if (ancestor == tag) {
3✔
425
        return true;
2✔
426
      }
427
      ancestor = ancestor.parent;
4✔
428
    }
429
    if (includeAdditionalParents) {
2✔
430
      for (Tag p : this.additionalParents) {
17✔
431
        do {
432
          if (p == tag) {
3✔
433
            return true;
2✔
434
          }
435
          p = p.parent;
3✔
436
        } while (p != null);
2✔
437
      }
438
    }
439
    return false;
2✔
440
  }
441

442
  @Override
443
  public String toString() {
444

445
    return this.id;
3✔
446
  }
447

448
  /**
449
   * @param id the {@link #getId() ID} of the tag.
450
   * @param parent the {@link #getParent() parent tag}.
451
   * @return the new {@link Tag}.
452
   */
453
  static Tag create(String id, Tag parent) {
454

455
    return create(id, parent, false);
5✔
456
  }
457

458
  /**
459
   * @param id the {@link #getId() ID} of the tag.
460
   * @param parent the {@link #getParent() parent tag}.
461
   * @param isAbstract the {@link #isAbstract() abstract flag}.
462
   * @return the new {@link Tag}.
463
   */
464
  static Tag create(String id, Tag parent, boolean isAbstract) {
465

466
    return create(id, parent, isAbstract, null, NO_TAGS);
7✔
467
  }
468

469
  /**
470
   * @param id the {@link #getId() ID} of the tag.
471
   * @param parent the {@link #getParent() parent tag}.
472
   * @param isAbstract the {@link #isAbstract() abstract flag}.
473
   * @return the new {@link Tag}.
474
   */
475
  static Tag create(String id, Tag parent, boolean isAbstract, String synonym) {
476

477
    return create(id, parent, isAbstract, new String[] { synonym }, NO_TAGS);
12✔
478
  }
479

480
  /**
481
   * @param id the {@link #getId() ID} of the tag.
482
   * @param parent the {@link #getParent() parent tag}.
483
   * @param isAbstract the {@link #isAbstract() abstract flag}.
484
   * @return the new {@link Tag}.
485
   */
486
  static Tag create(String id, Tag parent, boolean isAbstract, String... synonyms) {
487

488
    return create(id, parent, isAbstract, synonyms, NO_TAGS);
7✔
489
  }
490

491
  /**
492
   * @param id the {@link #getId() ID} of the tag.
493
   * @param parent the {@link #getParent() parent tag}.
494
   * @param isAbstract the {@link #isAbstract() abstract flag}.
495
   * @return the new {@link Tag}.
496
   */
497
  static Tag create(String id, Tag parent, boolean isAbstract, String[] synonyms, Tag... additionalParents) {
498

499
    Tag tag = new Tag(id, parent, isAbstract, additionalParents);
8✔
500
    add(id, tag);
3✔
501
    if (synonyms != null) {
2✔
502
      for (String synonym : synonyms) {
16✔
503
        add(synonym, tag);
3✔
504
      }
505
    }
506
    return tag;
2✔
507
  }
508

509
  private static void add(String key, Tag tag) {
510

511
    Tag duplicate = TAG_MAP.put(normalizeKey(key), tag);
7✔
512
    if (duplicate != null) {
2✔
513
      throw new IllegalStateException("Duplicate tag for " + key);
6✔
514
    }
515
  }
1✔
516

517
  private static String normalizeKey(String key) {
518

519
    return key.replace("-", "").replace(".", "");
8✔
520
  }
521

522
  private static Tag require(String key) {
523

524
    Tag tag = TAG_MAP.get(normalizeKey(key));
6✔
525
    if (tag == null) {
2!
526
      throw new IllegalStateException("Could not find required tag " + key);
×
527
    }
528
    return tag;
2✔
529
  }
530

531
  /**
532
   * @param id the {@link #getId() ID} of the requested {@link Tag}.
533
   * @return the {@link Tag} with the given {@link #getId() ID}. Will be lazily created as child of {@link #MISC} if not already exists.
534
   */
535
  public static Tag of(String id) {
536

537
    final String tagId = id.trim();
3✔
538
    int slash = tagId.indexOf('/');
4✔
539
    if (slash >= 0) {
2✔
540
      String parentId = tagId.substring(0, slash);
5✔
541
      Tag parent = require(parentId);
3✔
542
      String childId = tagId.substring(slash + 1);
6✔
543
      return TAG_MAP.computeIfAbsent(normalizeKey(childId), i -> new Tag(childId, parent, false, NO_TAGS));
17✔
544
    }
545
    return TAG_MAP.computeIfAbsent(normalizeKey(tagId), i -> new Tag(tagId, MISC, false, NO_TAGS));
16✔
546
  }
547

548
  /**
549
   * @return the {@link Collections} of all available {@link Tag}s.
550
   */
551
  public static Collection<Tag> getAll() {
552

553
    return ALL_TAGS;
2✔
554
  }
555

556
  /**
557
   * @param tagsCsv the tags as {@link String} in CSV format («first-tag»,...,«last-tag»). May be {@code null} or empty.
558
   * @return the parsed {@link Set} of {@link Tag}s.
559
   */
560
  public static Set<Tag> parseCsv(String tagsCsv) {
561

562
    if (tagsCsv == null) {
2✔
563
      return Collections.emptySet();
2✔
564
    }
565
    tagsCsv = tagsCsv.trim().toLowerCase(Locale.ROOT);
5✔
566
    if (tagsCsv.isEmpty()) {
3✔
567
      return Collections.emptySet();
2✔
568
    }
569
    String[] tagArray = tagsCsv.split(",");
4✔
570
    Set<Tag> tags = new HashSet<>(tagArray.length);
6✔
571
    for (String tag : tagArray) {
16✔
572
      tags.add(of(tag));
5✔
573
    }
574
    assert (tags.size() == tagArray.length);
6!
575
    return Set.of(tags.toArray(new Tag[tags.size()]));
8✔
576
  }
577

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