Skip to content

Commit

Permalink
Use SPDX license header.
Browse files Browse the repository at this point in the history
  • Loading branch information
baron1405 committed Jun 14, 2024
1 parent 3ff4ff3 commit 4b43933
Show file tree
Hide file tree
Showing 23 changed files with 30 additions and 280 deletions.
1 change: 0 additions & 1 deletion dev/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
<!-- File must start with the C Thing copyright header -->
<module name="RegexpHeader">
<property name="headerFile" value="${config_loc}/header.txt"/>
<property name="multiLines" value="3"/>
</module>

<!-- Flag IDE generated comments -->
Expand Down
13 changes: 1 addition & 12 deletions dev/checkstyle/header.txt
Original file line number Diff line number Diff line change
@@ -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$
13 changes: 1 addition & 12 deletions src/main/java/org/cthing/escapers/AbstractEscaper.java
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
13 changes: 1 addition & 12 deletions src/main/java/org/cthing/escapers/CodePointProvider.java
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
13 changes: 1 addition & 12 deletions src/main/java/org/cthing/escapers/CsvEscaper.java
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
21 changes: 3 additions & 18 deletions src/main/java/org/cthing/escapers/HexUtils.java
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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);
}

/**
Expand All @@ -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);
}

/**
Expand Down
13 changes: 1 addition & 12 deletions src/main/java/org/cthing/escapers/HtmlEntities.java
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
14 changes: 1 addition & 13 deletions src/main/java/org/cthing/escapers/HtmlEscaper.java
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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<Option> options) throws IOException {
if (writer == null) {
Expand Down
13 changes: 1 addition & 12 deletions src/main/java/org/cthing/escapers/JavaEscaper.java
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
13 changes: 1 addition & 12 deletions src/main/java/org/cthing/escapers/JavaScriptEscaper.java
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
13 changes: 1 addition & 12 deletions src/main/java/org/cthing/escapers/JsonEscaper.java
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
13 changes: 1 addition & 12 deletions src/main/java/org/cthing/escapers/XmlEscaper.java
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
13 changes: 1 addition & 12 deletions src/main/java/org/cthing/escapers/YamlEscaper.java
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
13 changes: 1 addition & 12 deletions src/main/java/org/cthing/escapers/package-info.java
Original file line number Diff line number Diff line change
@@ -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
*/

/**
Expand Down
14 changes: 1 addition & 13 deletions src/test/java/org/cthing/escapers/AbstractVarargsAggregator.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -36,7 +25,6 @@ protected AbstractVarargsAggregator(final Class<T> optionsType, final int startI
}

@Override
@SuppressWarnings("unchecked")
public Set<T> aggregateArguments(final ArgumentsAccessor arguments, final ParameterContext context) {
return IntStream.range(this.startIndex, arguments.size())
.mapToObj(i -> arguments.get(i, this.optionsType))
Expand Down
14 changes: 1 addition & 13 deletions src/test/java/org/cthing/escapers/CsvEscaperTest.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -31,7 +20,6 @@
import static org.junit.jupiter.params.provider.Arguments.arguments;


@SuppressWarnings("DataFlowIssue")
public class CsvEscaperTest {

public static Stream<Arguments> escapeProvider() {
Expand Down
13 changes: 1 addition & 12 deletions src/test/java/org/cthing/escapers/HexUtilsTest.java
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
15 changes: 2 additions & 13 deletions src/test/java/org/cthing/escapers/HtmlEscaperTest.java
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -39,7 +28,7 @@
import static org.junit.jupiter.params.provider.Arguments.arguments;


@SuppressWarnings({ "DataFlowIssue", "UnnecessaryUnicodeEscape" })
@SuppressWarnings("UnnecessaryUnicodeEscape")
public class HtmlEscaperTest {

public static Stream<Arguments> escapeProvider() {
Expand Down
Loading

0 comments on commit 4b43933

Please sign in to comment.