diff --git a/dev/checkstyle/checkstyle.xml b/dev/checkstyle/checkstyle.xml
index 9f19037..2317e0d 100644
--- a/dev/checkstyle/checkstyle.xml
+++ b/dev/checkstyle/checkstyle.xml
@@ -33,7 +33,6 @@
-
diff --git a/dev/checkstyle/header.txt b/dev/checkstyle/header.txt
index c448c3c..11bd74f 100644
--- a/dev/checkstyle/header.txt
+++ b/dev/checkstyle/header.txt
@@ -1,14 +1,3 @@
^/\*$
^ \* Copyright [\d]{4}((,[\s]*[\d]{4})*|(-[\d]{4})?) C Thing Software$
-^ \*$
-^ \* Licensed under the Apache License, Version 2\.0 \(the "License"\);$
-^ \* you may not use this file except in compliance with the License\.$
-^ \* You may obtain a copy of the License at$
-^ \*$
-^ \* http://www\.apache\.org/licenses/LICENSE-2\.0$
-^ \*$
-^ \* Unless required by applicable law or agreed to in writing, software$
-^ \* distributed under the License is distributed on an "AS IS" BASIS,$
-^ \* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.$
-^ \* See the License for the specific language governing permissions and$
-^ \* limitations under the License\.$
+^ \* SPDX-License-Identifier: Apache-2.0$
diff --git a/src/main/java/org/cthing/escapers/AbstractEscaper.java b/src/main/java/org/cthing/escapers/AbstractEscaper.java
index 2ed235c..bed02c1 100644
--- a/src/main/java/org/cthing/escapers/AbstractEscaper.java
+++ b/src/main/java/org/cthing/escapers/AbstractEscaper.java
@@ -1,17 +1,6 @@
/*
* Copyright 2024 C Thing Software
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * SPDX-License-Identifier: Apache-2.0
*/
package org.cthing.escapers;
diff --git a/src/main/java/org/cthing/escapers/CodePointProvider.java b/src/main/java/org/cthing/escapers/CodePointProvider.java
index a4a7cd2..54fef16 100644
--- a/src/main/java/org/cthing/escapers/CodePointProvider.java
+++ b/src/main/java/org/cthing/escapers/CodePointProvider.java
@@ -1,17 +1,6 @@
/*
* Copyright 2024 C Thing Software
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * SPDX-License-Identifier: Apache-2.0
*/
package org.cthing.escapers;
diff --git a/src/main/java/org/cthing/escapers/CsvEscaper.java b/src/main/java/org/cthing/escapers/CsvEscaper.java
index 217897e..c1615f5 100644
--- a/src/main/java/org/cthing/escapers/CsvEscaper.java
+++ b/src/main/java/org/cthing/escapers/CsvEscaper.java
@@ -1,17 +1,6 @@
/*
* Copyright 2024 C Thing Software
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * SPDX-License-Identifier: Apache-2.0
*/
package org.cthing.escapers;
diff --git a/src/main/java/org/cthing/escapers/HexUtils.java b/src/main/java/org/cthing/escapers/HexUtils.java
index fb26cdc..7cf2515 100644
--- a/src/main/java/org/cthing/escapers/HexUtils.java
+++ b/src/main/java/org/cthing/escapers/HexUtils.java
@@ -1,17 +1,6 @@
/*
* Copyright 2024 C Thing Software
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * SPDX-License-Identifier: Apache-2.0
*/
package org.cthing.escapers;
@@ -59,8 +48,7 @@ static void writeHex2(final int value, final Writer writer) throws IOException {
static void writeHex4(final int value, final Writer writer) throws IOException {
writer.write(HEX_DIGITS[value >> 12 & 0xF]);
writer.write(HEX_DIGITS[value >> 8 & 0xF]);
- writer.write(HEX_DIGITS[value >> 4 & 0xF]);
- writer.write(HEX_DIGITS[value & 0xF]);
+ writeHex2(value, writer);
}
/**
@@ -76,10 +64,7 @@ static void writeHex8(final int value, final Writer writer) throws IOException {
writer.write(HEX_DIGITS[value >> 24 & 0xF]);
writer.write(HEX_DIGITS[value >> 20 & 0xF]);
writer.write(HEX_DIGITS[value >> 16 & 0xF]);
- writer.write(HEX_DIGITS[value >> 12 & 0xF]);
- writer.write(HEX_DIGITS[value >> 8 & 0xF]);
- writer.write(HEX_DIGITS[value >> 4 & 0xF]);
- writer.write(HEX_DIGITS[value & 0xF]);
+ writeHex4(value, writer);
}
/**
diff --git a/src/main/java/org/cthing/escapers/HtmlEntities.java b/src/main/java/org/cthing/escapers/HtmlEntities.java
index a743669..eeae799 100644
--- a/src/main/java/org/cthing/escapers/HtmlEntities.java
+++ b/src/main/java/org/cthing/escapers/HtmlEntities.java
@@ -1,17 +1,6 @@
/*
* Copyright 2024 C Thing Software
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * SPDX-License-Identifier: Apache-2.0
*/
package org.cthing.escapers;
diff --git a/src/main/java/org/cthing/escapers/HtmlEscaper.java b/src/main/java/org/cthing/escapers/HtmlEscaper.java
index 21afa08..7b315a5 100644
--- a/src/main/java/org/cthing/escapers/HtmlEscaper.java
+++ b/src/main/java/org/cthing/escapers/HtmlEscaper.java
@@ -1,17 +1,6 @@
/*
* Copyright 2024 C Thing Software
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * SPDX-License-Identifier: Apache-2.0
*/
package org.cthing.escapers;
@@ -411,7 +400,6 @@ private static String escape(final CodePointProvider codePointProvider, final in
}
}
- @SuppressWarnings("ForLoopReplaceableByForEach")
private static void escape(final CodePointProvider codePointProvider, final int offset, final int length,
final Writer writer, final Set