terrymanu commented on a change in pull request #4955: lambda code modify.
URL:
https://github.com/apache/incubator-shardingsphere/pull/4955#discussion_r398395061
##########
File path:
shardingsphere-underlying/shardingsphere-common/src/main/java/org/apache/shardingsphere/underlying/common/database/type/DatabaseTypes.java
##########
@@ -60,40 +61,29 @@ public static DatabaseType getTrunkDatabaseType(final
String name) {
/**
* Get actual database type.
+ * @param name database name
*
- * @param name database name
* @return actual database type
*/
public static DatabaseType getActualDatabaseType(final String name) {
- Preconditions.checkState(DATABASE_TYPES.containsKey(name),
"Unsupported database: '%s'", name);
- return DATABASE_TYPES.get(name);
+ return Optional.ofNullable(DATABASE_TYPES.get(name)).orElseThrow(() ->
new ShardingSphereException("Unsupported database:'%s'", name));
}
/**
* Get database type by URL.
- *
* @param url database URL
+ *
Review comment:
Please do not modify original javadoc
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services