Change Assert() into Warning for db.user/db.password/... #27
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
/- validate all 4 required data source parameters are present (including url)
- use error logging and exception throwing instead of assert()
- (the deprectaed properties are currently needed by the msk importer)
This change is needed because the msk importer currently requires the deprecated parameters:
db.user, db.password, db.connection_string, db.portal_db_name, db.host, db.driver
The change of the Assert() statement into a logged warning in JdbcDataSource.java was approved and merged into the cbioportal codebase previously with cBioPortal/cbioportal#10424
This PR also cleans up the code, providing functions for:
According to the final section notes of https://docs.oracle.com/javase/specs/jls/se7/html/jls-14.html#jls-14.10 it is bad practice to handle invalid argument problems through assert() because assert processing is disabled by default but validity of arguments should be checked regardless of whether assertions are enabled or not. Also, an appropriate exception is not thrown by assert(), which causes an AssertionError to be thrown instead. For these reasons, assert() was replaced by throw new RuntimeException(), which causes the construction of the datasource bean to fail during the bean construction stage of context creation, exiting the application.
Note : this PR replaced #26 because currently, pull requests across forks seems to cause a failure in the CI tests (updating dependencies in the manifest / maven.yml)