File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
sqldev/src/main/java/org/utplsql/sqldev/model Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 2525import org .springframework .core .style .ValueStyler ;
2626
2727public class JsonToStringStyler implements ToStringStyler , ValueStyler {
28- public static final ToStringStyler INSTANCE = new JsonToStringStyler ();
2928 public static final String INDENT_SPACES = " " ;
3029 private int indent = 0 ;
31-
30+
31+ private static ThreadLocal <JsonToStringStyler > threadLocal = ThreadLocal .withInitial (JsonToStringStyler ::new );
32+
3233 private void newLine (StringBuilder buffer ) {
3334 buffer .append ('\n' );
3435 buffer .append (getIndentSpaces (0 ));
@@ -95,7 +96,11 @@ private String getMapStyle(Map<?, ?> map) {
9596 private String getDefaultStyle (Object value ) {
9697 return String .valueOf (value );
9798 }
98-
99+
100+ public static ToStringStyler getInstance () {
101+ return threadLocal .get ();
102+ }
103+
99104 @ Override
100105 public void styleStart (StringBuilder buffer , Object obj ) {
101106 indent ++;
You can’t perform that action at this time.
0 commit comments