Skip to content

Commit 5ea802f

Browse files
committed
Merge remote-tracking branch 'package-url/scratch/refactor-stringutils' into feat/percent-performance
2 parents d7066f1 + 576f2c6 commit 5ea802f

File tree

5 files changed

+31
-5
lines changed

5 files changed

+31
-5
lines changed

src/main/java/com/github/packageurl/PackageURL.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
import static java.util.Objects.requireNonNull;
2525

26-
import com.github.packageurl.utils.StringUtil;
26+
import com.github.packageurl.internal.StringUtil;
2727
import java.io.Serializable;
2828
import java.net.URI;
2929
import java.net.URISyntaxException;

src/main/java/com/github/packageurl/utils/StringUtil.java renamed to src/main/java/com/github/packageurl/internal/StringUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2020
* SOFTWARE.
2121
*/
22-
package com.github.packageurl.utils;
22+
package com.github.packageurl.internal;
2323

2424
import static java.lang.Byte.toUnsignedInt;
2525

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* MIT License
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to deal
6+
* in the Software without restriction, including without limitation the rights
7+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
* copies of the Software, and to permit persons to whom the Software is
9+
* furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in all
12+
* copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
* SOFTWARE.
21+
*/
22+
23+
/**
24+
* This package contains utility classes used by the PackageURL library.
25+
*/
26+
package com.github.packageurl.internal;

src/test/java/com/github/packageurl/utils/StringUtilBenchmark.java renamed to src/test/java/com/github/packageurl/internal/StringUtilBenchmark.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2020
* SOFTWARE.
2121
*/
22-
package com.github.packageurl.utils;
22+
package com.github.packageurl.internal;
2323

2424
import java.nio.charset.StandardCharsets;
2525
import java.util.Locale;
@@ -91,7 +91,7 @@ private String[] createDecodedData() {
9191

9292
private static String[] encodeData(String[] decodedData) {
9393
String[] encodedData = new String[decodedData.length];
94-
for (int i = 0; i < decodedData.length; i++) {
94+
for (int i = 0; i < encodedData.length; i++) {
9595
encodedData[i] = StringUtil.percentEncode(decodedData[i]);
9696
if (!StringUtil.percentDecode(encodedData[i]).equals(decodedData[i])) {
9797
throw new RuntimeException(

src/test/java/com/github/packageurl/utils/StringUtilTest.java renamed to src/test/java/com/github/packageurl/internal/StringUtilTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2020
* SOFTWARE.
2121
*/
22-
package com.github.packageurl.utils;
22+
package com.github.packageurl.internal;
2323

2424
import static org.junit.jupiter.api.Assertions.assertEquals;
2525
import static org.junit.jupiter.api.Assertions.assertThrowsExactly;

0 commit comments

Comments
 (0)