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

pkiraly / metadata-qa-marc / #1527

22 Aug 2025 02:21PM UTC coverage: 90.345%. Remained the same
#1527

push

pkiraly
Improve timeline handling

5191 of 6416 new or added lines in 219 files covered. (80.91%)

886 existing lines in 78 files now uncovered.

36717 of 40641 relevant lines covered (90.34%)

0.9 hits per line

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

75.0
/src/main/java/de/gwdg/metadataqa/marc/definition/general/parser/FixedLengthSplitter.java
1
package de.gwdg.metadataqa.marc.definition.general.parser;
2

3
import org.apache.commons.lang3.StringUtils;
4

5
import java.util.ArrayList;
6
import java.util.List;
7

8
/**
9
 * Split content into list of fixed length strings
10
 */
11
public class FixedLengthSplitter implements SubfieldContentSplitter {
12
  private int fixedLength = 3;
1✔
13

14
  public FixedLengthSplitter() {}
1✔
15

NEW
16
  public FixedLengthSplitter(int fixedLength) {
×
NEW
17
    this.fixedLength = fixedLength;
×
NEW
18
  }
×
19

20
  @Override
21
  public List<String> parse(String content) {
22
    List<String> result = new ArrayList<>();
1✔
23
    if (StringUtils.isBlank(content))
1✔
NEW
24
      return result;
×
25

26
    if (content.length() > fixedLength) {
1✔
27
      int contentLength = content.length();
1✔
28
      for (int i = 0; i < contentLength; i = i + fixedLength) {
1✔
29
        int end = i + fixedLength < contentLength ? i + fixedLength : contentLength;
1✔
30
        result.add(content.substring(i, end));
1✔
31
      }
32
    } else
1✔
33
      result.add(content);
1✔
34

35
    return result;
1✔
36
  }
37
}
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