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

Ekryd / echo-maven-plugin / 3648

14 Nov 2024 01:38PM CUT coverage: 96.795%. Remained the same
3648

push

circleci

web-flow
Update dependency org.codehaus.mojo:versions-maven-plugin to v2.18.0

302 of 312 relevant lines covered (96.79%)

0.97 hits per line

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

100.0
/echo/src/main/java/echo/parameter/LineSeparator.java
1
package echo.parameter;
2

3
import echo.exception.FailureException;
4
import java.util.Arrays;
5

6
/** Encapsulates end of line character logic. */
7
public class LineSeparator {
8
  private final String formattedLineSeparator;
9
  private final String lineSeparatorString;
10

11
  /**
12
   * Creates a line separator and makes sure that it is either \n, \r or \r\n
13
   *
14
   * @param lineSeparatorString The line separator characters
15
   */
16
  LineSeparator(final String lineSeparatorString) {
1✔
17
    this.lineSeparatorString = lineSeparatorString;
1✔
18
    this.formattedLineSeparator = lineSeparatorString.replace("\\r", "\r").replace("\\n", "\n");
1✔
19
  }
1✔
20

21
  void checkLineSeparator() {
22
    if (isIllegalString()) {
1✔
23
      throw new FailureException(
1✔
24
          "LineSeparator must be either \\n, \\r or \\r\\n, but separator characters were "
25
              + Arrays.toString(lineSeparatorString.getBytes()));
1✔
26
    }
27
  }
1✔
28

29
  private boolean isIllegalString() {
30
    return !("\n".equalsIgnoreCase(formattedLineSeparator)
1✔
31
        || "\r".equalsIgnoreCase(formattedLineSeparator)
1✔
32
        || "\r\n".equalsIgnoreCase(formattedLineSeparator));
1✔
33
  }
34

35
  public String getFormattedLineSeparator() {
36
    return formattedLineSeparator;
1✔
37
  }
38
}
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

© 2025 Coveralls, Inc