-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
commit #12
base: master
Are you sure you want to change the base?
commit #12
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @shaileshexp.
A couple of things apart from the comments:
- You have missed implementing the Registry pattern in the prototype question.
- Try to take a pull from the master branch. It should remove the unrelated changes.
- Update the name of this pull request. The name of a pull request should tell me what is present in it.
...main/java/com/scaler/lld/design/assignments/singleton/FileBasedConfigurationManagerImpl.java
Outdated
Show resolved
Hide resolved
@@ -55,6 +56,9 @@ protected <T> T convert(String value, Class<T> type) { | |||
return (T) Float.valueOf(value); | |||
case "Double": | |||
return (T) Double.valueOf(value); | |||
}} | |||
catch (Exception e){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never catch a generic exception. This catch block can be triggered for multiple reasons instead of NPE such as a class cast exception, etc. Rather than catching the null pointer exception, add a validation as I have mentioned below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, but not sure the calling method how to handle it?
src/main/java/com/scaler/lld/design/assignments/builder/DatabaseConfigurationBuilder.java
Outdated
Show resolved
Hide resolved
public String getDatabaseUrl() { | ||
return databaseUrl; | ||
} | ||
|
||
public String getUsername() { | ||
return username; | ||
} | ||
|
||
public String getPassword() { | ||
return password; | ||
} | ||
|
||
public int getMaxConnections() { | ||
return maxConnections; | ||
} | ||
|
||
public boolean isEnableCache() { | ||
return enableCache; | ||
} | ||
|
||
public boolean isReadOnly() { | ||
return isReadOnly; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[MINOR] You can use the @Getter
annotation here as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
implemented the review comments
No description provided.