Skip to content

Commit 28829f1

Browse files
author
nareshwart
committed
fix
1 parent d471d2c commit 28829f1

4 files changed

Lines changed: 12 additions & 3 deletions

File tree

src/main/java/com/devopsdemo/tutorial/addressbook/ContactForm.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ private void cancel() {
7979
if (isUIAvailable()) {
8080
Notification.show("Cancelled");
8181
}
82+
setVisible(false);
8283
if (listener != null) listener.onCancel();
8384
}
8485

src/main/java/com/devopsdemo/utilities/HexAsciiConvertor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public static String asciiToHex(String asciiValue) {
4545
*/
4646
public static String convertAsciiToHex(String asciiValue) {
4747
if (asciiValue == null || asciiValue.isEmpty()) {
48-
return null;
48+
throw new IllegalArgumentException("Hex value cannot be null or empty");
4949
}
5050

5151
var hex = new StringBuilder();

src/main/java/com/devopsdemo/utilities/LoggerStackTraceUtil.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public class LoggerStackTraceUtil {
1717
public static String getStackTrace(Exception ex) {
1818
if (ex == null) throw new NullPointerException("Exception cannot be null");
1919
StringBuilder sb = new StringBuilder();
20+
sb.append(ex.toString()).append(System.lineSeparator());
2021
for (StackTraceElement elem : ex.getStackTrace()) {
2122
sb.append(elem.toString()).append(System.lineSeparator());
2223
}

src/main/java/com/devopsdemo/utilities/PropertyLoader.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,15 @@ public static Properties loadProperties(String names, ClassLoader loader) {
5151
boolean loaded = false;
5252

5353
try {
54-
if (LOAD_AS_RESOURCE_BUNDLE) {
54+
if (names.endsWith(".properties")) {
55+
name = name.replace('.', '/');
56+
try (InputStream in = loader != null ? loader.getResourceAsStream(name) : null) {
57+
if (in != null) {
58+
result.load(in);
59+
loaded = true;
60+
}
61+
}
62+
} else if (LOAD_AS_RESOURCE_BUNDLE) {
5563
name = name.replace('/', '.');
5664
try {
5765
ResourceBundle rb = ResourceBundle.getBundle(name, Locale.getDefault(),
@@ -66,7 +74,6 @@ public static Properties loadProperties(String names, ClassLoader loader) {
6674
if (!name.endsWith(SUFFIX)) {
6775
name = name.concat(SUFFIX);
6876
}
69-
7077
try (InputStream in = loader != null ? loader.getResourceAsStream(name) : null) {
7178
if (in != null) {
7279
result.load(in);

0 commit comments

Comments
 (0)