@@ -24,44 +24,39 @@ public class LightningProviders {
2424 private ExceptionHandler exceptionHandler ;
2525
2626 public MapProvider mapProvider () {
27-
28- if (mapProvider != null ) {
29- return mapProvider ;
27+ if (mapProvider == null ) {
28+ mapProvider = new MapProvider () {};
3029 }
31-
32- return mapProvider = new MapProvider () {
33- };
30+ return mapProvider ;
3431 }
3532
3633 public YamlConfig yamlConfig () {
37- if (yamlConfig != null ) {
38- return yamlConfig ;
34+ if (yamlConfig == null ) {
35+ final YamlConfig config = new YamlConfig ();
36+ // Use unicode
37+ config .writeConfig .setEscapeUnicode (false );
38+ // Don't use anchors
39+ config .writeConfig .setAutoAnchor (false );
40+ // Never use write the classname above keys
41+ config .writeConfig .setWriteClassname (YamlConfig .WriteClassName .NEVER );
42+ yamlConfig = config ;
3943 }
40- final YamlConfig config = new YamlConfig ();
41- // Use unicode
42- config .writeConfig .setEscapeUnicode (false );
43- // Don't use anchors
44- config .writeConfig .setAutoAnchor (false );
45- // Never use write the classname above keys
46- config .writeConfig .setWriteClassname (YamlConfig .WriteClassName .NEVER );
47- return yamlConfig = config ;
44+ return yamlConfig ;
4845 }
4946
5047 public InputStreamProvider inputStreamProvider () {
51- if (inputStreamProvider ! = null ) {
52- return inputStreamProvider ;
48+ if (inputStreamProvider = = null ) {
49+ inputStreamProvider = new InputStreamProvider () {} ;
5350 }
5451
55- return inputStreamProvider = new InputStreamProvider () {
56- };
52+ return inputStreamProvider ;
5753 }
5854
5955 public ExceptionHandler exceptionHandler () {
60- if (exceptionHandler ! = null ) {
61- return exceptionHandler ;
56+ if (exceptionHandler = = null ) {
57+ exceptionHandler = new ExceptionHandler () {} ;
6258 }
6359
64- return exceptionHandler = new ExceptionHandler () {
65- };
60+ return exceptionHandler ;
6661 }
6762}
0 commit comments