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

Camelcade / Perl5-IDEA / #525521563

01 Jun 2025 02:15PM UTC coverage: 82.332% (+0.04%) from 82.289%
#525521563

push

github

hurricup
Bounded wildcards

2 of 2 new or added lines in 2 files covered. (100.0%)

69 existing lines in 17 files now uncovered.

30882 of 37509 relevant lines covered (82.33%)

0.82 hits per line

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

82.14
/plugin/core/src/main/java/com/perl5/lang/perl/psi/stubs/PerlStubSerializationUtil.java
1
/*
2
 * Copyright 2015-2025 Alexandr Evstigneev
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 * http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16

17
package com.perl5.lang.perl.psi.stubs;
18

19
import com.intellij.psi.stubs.StubInputStream;
20
import com.intellij.psi.stubs.StubOutputStream;
21
import com.intellij.util.io.StringRef;
22
import org.jetbrains.annotations.NotNull;
23
import org.jetbrains.annotations.Nullable;
24

25
import java.io.IOException;
26
import java.util.*;
27

28

29
public class PerlStubSerializationUtil {
×
30
  public static @NotNull String readNotNullString(@NotNull StubInputStream dataStream) throws IOException {
31
    return Objects.requireNonNull(readString(dataStream));
1✔
32
  }
33

34
  public static @Nullable String readString(@NotNull StubInputStream dataStream) throws IOException {
35
    return StringRef.toString(dataStream.readName());
1✔
36
  }
37

38

39
  public static void writeStringsList(@NotNull StubOutputStream dataStream, List<String> stringList) throws IOException {
40
    if (stringList == null) {
1✔
41
      dataStream.writeVarInt(0);
1✔
42
    }
43
    else {
44
      dataStream.writeVarInt(stringList.size() + 1);
1✔
45
      for (String stringItem : stringList) {
1✔
46
        dataStream.writeName(stringItem);
1✔
47
      }
1✔
48
    }
49
  }
1✔
50

51
  public static @Nullable List<String> readStringsList(@NotNull StubInputStream dataStream) throws IOException {
52
    int listSize = dataStream.readVarInt();
1✔
53

54
    if (listSize == 0) {
1✔
55
      return null;
1✔
56
    }
57

58
    ArrayList<String> result = new ArrayList<>(listSize);
1✔
59
    for (int i = 0; i < listSize - 1; i++) {
1✔
60
      result.add(readString(dataStream));
1✔
61
    }
62
    return result;
1✔
63
  }
64

65
  public static void writeStringListMap(@NotNull StubOutputStream dataStream, Map<String, ? extends List<String>> stringListMap)
66
    throws IOException {
67
    dataStream.writeVarInt(stringListMap.size());
1✔
68
    for (String key : stringListMap.keySet()) {
1✔
69
      dataStream.writeName(key);
×
70
      writeStringsList(dataStream, stringListMap.get(key));
×
UNCOV
71
    }
×
72
  }
1✔
73

74
  public static Map<String, List<String>> readStringListMap(@NotNull StubInputStream dataStream) throws IOException {
75
    int mapSize = dataStream.readVarInt();
1✔
76
    Map<String, List<String>> stringListMap = new HashMap<>(mapSize);
1✔
77
    for (int i = 0; i < mapSize; i++) {
1✔
UNCOV
78
      stringListMap.put(readString(dataStream), readStringsList(dataStream));
×
79
    }
80
    return stringListMap;
1✔
81
  }
82
}
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