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

devonfw / IDEasy / 14726569126

29 Apr 2025 08:16AM UTC coverage: 67.534% (+0.09%) from 67.448%
14726569126

push

github

web-flow
#1190: Added pycharm support (#1219)

Co-authored-by: Jörg Hohwiller <hohwille@users.noreply.github.com>

3087 of 4976 branches covered (62.04%)

Branch coverage included in aggregate %.

7942 of 11355 relevant lines covered (69.94%)

3.06 hits per line

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

98.15
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 Kotlin. */
43
  public static final Tag KOTLIN = create("kotlin", JVM);
4✔
44

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

304

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

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

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

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

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

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

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

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

329
  private final String id;
330

331
  private final Tag parent;
332

333
  private final boolean isAbstract;
334

335
  private final Tag[] additionalParents;
336

337
  private Tag() {
2✔
338

339
    this.id = "<root>";
3✔
340
    this.parent = null;
3✔
341
    this.isAbstract = true;
3✔
342
    this.additionalParents = NO_TAGS;
3✔
343
  }
1✔
344

345
  private Tag(String id, Tag parent, boolean isAbstract, Tag... additionalParents) {
346

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

357
  /**
358
   * @return the identifier and name of this tag.
359
   */
360
  public String getId() {
361

362
    return this.id;
3✔
363
  }
364

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

370
    return this.parent;
3✔
371
  }
372

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

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

386
  /**
387
   * @return the number of {@link #getParent(int) parents} available.
388
   */
389
  public int getParentCount() {
390

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

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

402
    return this.isAbstract;
3✔
403
  }
404

405
  public boolean isAncestorOf(Tag tag) {
406

407
    return isAncestorOf(tag, false);
5✔
408
  }
409

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

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

439
  @Override
440
  public String toString() {
441

442
    return this.id;
3✔
443
  }
444

445
  /**
446
   * @param id the {@link #getId() ID} of the tag.
447
   * @param parent the {@link #getParent() parent tag}.
448
   * @param isAbstract the {@link #isAbstract() abstract flag}.
449
   * @return the new {@link Tag}.
450
   */
451
  static Tag create(String id, Tag parent) {
452

453
    return create(id, parent, false);
5✔
454
  }
455

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

464
    return create(id, parent, isAbstract, null, NO_TAGS);
7✔
465
  }
466

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

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

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

486
    return create(id, parent, isAbstract, synonyms, NO_TAGS);
7✔
487
  }
488

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

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

507
  private static void add(String key, Tag tag) {
508

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

515
  private static String normalizeKey(String key) {
516

517
    return key.replace("-", "").replace(".", "");
8✔
518
  }
519

520
  private static Tag require(String key) {
521

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

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

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

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

551
    return ALL_TAGS;
2✔
552
  }
553

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

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

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