Skip to content

Commit

Permalink
test ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
kernelsam committed May 13, 2024
1 parent 57e095f commit 14fc0ef
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/maven-openclover.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: maven jacoco
name: maven openclover

on:
push:
Expand Down
3 changes: 3 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,9 @@
<groupId>org.openclover</groupId>
<artifactId>clover-maven-plugin</artifactId> <!-- maven-clover2-plugin for version <= 4.0.6 -->
<version>4.5.2</version>
<configuration>
<targetPercentage>80%</targetPercentage>
</configuration>
<executions>
<execution>
<id>clover</id>
Expand Down
56 changes: 29 additions & 27 deletions src/main/java/com/senzing/g2/engine/Utilities.java
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
package com.senzing.g2.engine;

class Utilities {
/**
* Formats a <code>long</code> integer value as hexadecimal with
* spaces between each group of for hex digits.
*
* @param value The value to format.
*
* @return The value formatted as a {@link String}.
*/
public static String hexFormat(long value) {
StringBuilder sb = new StringBuilder(20);
long mask = 0xFFFF << 48;
String prefix = "";
/**
* Formats a <code>long</code> integer value as hexadecimal with
* spaces between each group of for hex digits.
*
* @param value The value to format.
*
* @return The value formatted as a {@link String}.
*/
public static String hexFormat(long value) {
StringBuilder sb = new StringBuilder(20);
long mask = 0xFFFF << 48;
String prefix = "";

for (int index = 0; index < 4; index++) {
long masked = value & mask;
mask = mask >>> 16;
masked = masked >>> ((3 - index) * 16);
sb.append(prefix);
String hex = Long.toUnsignedString(masked, 16);
for (int zero = hex.length(); zero < 4; zero++) {
sb.append("0");
}
sb.append(hex);
prefix = " ";
}

return sb.toString();
for (int index = 0; index < 4; index++) {
long masked = value & mask;
mask = mask >>> 16;
masked = masked >>> ((3 - index) * 16);
sb.append(prefix);
String hex = Long.toUnsignedString(masked, 16);
for (int zero = hex.length(); zero < 4; zero++) {
sb.append("0");
}
sb.append(hex);
prefix = " ";
}

/**
return sb.toString();
}

/**
* Escapes the specified {@link String} into a JSON string with the
* the surrounding double quotes. If the specified {@link String} is
* <code>null</code> then <code>"null"</code> is returned.
Expand All @@ -45,12 +45,14 @@ public static String jsonEscape(String string) {
int escapeCount = 0;
for (int index = 0; index < string.length(); index++) {
char c = string.charAt(index);
// CLOVER:OFF
escapeCount += switch (c) {
case '\b','\f','\n','\r','\t','"','\\':
yield 1;
default:
yield (c < ' ') ? 6 : 0;
};
// CLOVER:ON
}
if (escapeCount == 0) return "\"" + string + "\"";
StringBuilder sb = new StringBuilder(string.length() + escapeCount + 2);
Expand Down

0 comments on commit 14fc0ef

Please sign in to comment.