Skip to content

Commit

Permalink
#863 make StringBuilderWriter public and move test
Browse files Browse the repository at this point in the history
  • Loading branch information
Simulant87 committed Mar 10, 2024
1 parent 60090a7 commit 6c35b08
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/main/java/org/json/StringBuilderWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
* Performance optimised alternative for {@link java.io.StringWriter}
* using internally a {@link StringBuilder} instead of a {@link StringBuffer}.
*/
class StringBuilderWriter extends Writer {
public class StringBuilderWriter extends Writer {
private final StringBuilder builder;

/**
* Create a new string builder writer using the default initial string-builder buffer size.
*/
StringBuilderWriter() {
public StringBuilderWriter() {
builder = new StringBuilder();
lock = builder;
}
Expand All @@ -26,7 +26,7 @@ class StringBuilderWriter extends Writer {
*
* @throws IllegalArgumentException If {@code initialSize} is negative
*/
StringBuilderWriter(int initialSize) {
public StringBuilderWriter(int initialSize) {
builder = new StringBuilder(initialSize);
lock = builder;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package org.json;
package org.json.junit;

import static org.junit.Assert.assertEquals;

import org.json.StringBuilderWriter;
import org.junit.Before;
import org.junit.Test;

Expand Down

0 comments on commit 6c35b08

Please sign in to comment.