File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
core/src/main/java/org/openapitools/openapidiff/core/output Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -358,6 +358,9 @@ public String separator(char ch) {
358358 }
359359
360360 static int displayWidth (String text ) {
361+ if (text == null ) {
362+ return 0 ;
363+ }
361364 int width = 0 ;
362365 for (int i = 0 ; i < text .length (); i ++) {
363366 char c = text .charAt (i );
@@ -385,6 +388,9 @@ static boolean isFullWidth(char c) {
385388 }
386389
387390 static String centerCjk (String text , int width ) {
391+ if (text == null ) {
392+ text = "" ;
393+ }
388394 int textWidth = displayWidth (text );
389395 if (textWidth >= width ) {
390396 return text ;
Original file line number Diff line number Diff line change 1111public final class I18n {
1212
1313 private static final String BUNDLE_NAME = "i18n.messages" ;
14- private static Locale currentLocale = Locale .ENGLISH ;
15- private static ResourceBundle bundle = loadBundle (currentLocale );
14+ private static volatile Locale currentLocale = Locale .ENGLISH ;
15+ private static volatile ResourceBundle bundle = loadBundle (currentLocale );
1616
1717 private I18n () {}
1818
19- public static void setLocale (Locale locale ) {
20- currentLocale = locale ;
19+ public static synchronized void setLocale (Locale locale ) {
2120 bundle = loadBundle (locale );
21+ currentLocale = locale ;
2222 }
2323
2424 public static Locale getLocale () {
You can’t perform that action at this time.
0 commit comments