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 25
25
import org .springframework .core .style .ValueStyler ;
26
26
27
27
public class JsonToStringStyler implements ToStringStyler , ValueStyler {
28
- public static final ToStringStyler INSTANCE = new JsonToStringStyler ();
29
28
public static final String INDENT_SPACES = " " ;
30
29
private int indent = 0 ;
31
-
30
+
31
+ private static ThreadLocal <JsonToStringStyler > threadLocal = ThreadLocal .withInitial (JsonToStringStyler ::new );
32
+
32
33
private void newLine (StringBuilder buffer ) {
33
34
buffer .append ('\n' );
34
35
buffer .append (getIndentSpaces (0 ));
@@ -95,7 +96,11 @@ private String getMapStyle(Map<?, ?> map) {
95
96
private String getDefaultStyle (Object value ) {
96
97
return String .valueOf (value );
97
98
}
98
-
99
+
100
+ public static ToStringStyler getInstance () {
101
+ return threadLocal .get ();
102
+ }
103
+
99
104
@ Override
100
105
public void styleStart (StringBuilder buffer , Object obj ) {
101
106
indent ++;
You can’t perform that action at this time.
0 commit comments