Skip to content

Commit

Permalink
SUBMARINE-1149. Sonar: Fix reliability issues in submarine-server
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Su <pingsutwapache.org>

### What is this PR for?
<!-- A few sentences describing the overall goals of the pull request's commits.
First time? Check out the contributing guide - https://submarine.apache.org/contribution/contributions.html
-->
Try to fix the issues on the sonarcloud. https://sonarcloud.io/project/issues?id=apache_submarine&resolved=false&sinceLeakPeriod=true&types=BUG

### What type of PR is it?
[Bug Fix]

### Todos
* [ ] - Task

### What is the Jira issue?
<!-- * Open an issue on Jira https://issues.apache.org/jira/browse/SUBMARINE/
* Put link here, and add [SUBMARINE-*Jira number*] in PR title, eg. `SUBMARINE-23. PR title`
-->
https://issues.apache.org/jira/browse/SUBMARINE-1149

### How should this be tested?
<!--
* First time? Setup Travis CI as described on https://submarine.apache.org/contribution/contributions.html#continuous-integration
* Strongly recommended: add automated unit tests for any new or changed behavior
* Outline any manual steps to test the PR here.
-->
pass the cis
### Screenshots (if appropriate)

### Questions:
* Do the license files need updating? No
* Are there breaking changes for older versions? No
* Does this need new documentation? No

Author: Kevin Su <pingsutw@apache.org>

Signed-off-by: Kevin <pingsutw@apache.org>

Closes apache#841 from pingsutw/SUBMARINE-1149 and squashes the following commits:

6551936 [Kevin Su] Sonar: Fix reliability issues in submarine-server
  • Loading branch information
pingsutw committed Dec 21, 2021
1 parent a0f5a49 commit a1436e3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
public class ModelManager {
private static final Logger LOG = LoggerFactory.getLogger(ModelManager.class);

private static volatile ModelManager manager;
private static ModelManager manager;

private final Submitter submitter;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,27 +47,26 @@ public static void main(String[] args) {
Configuration config = null;
try {
config = cp.parseConfiguration(configFile);
} catch (IOException e) {
LOG.error(e.getMessage(), e);
} catch (XMLParserException e) {
} catch (IOException | XMLParserException e) {
LOG.error(e.getMessage(), e);
}

DefaultShellCallback callback = new DefaultShellCallback(overwrite);
MyBatisGenerator myBatisGenerator = null;
try {
assert config != null;
myBatisGenerator = new MyBatisGenerator(config, callback, warnings);
} catch (InvalidConfigurationException e) {
LOG.error(e.getMessage(), e);
}
try {
assert myBatisGenerator != null;
myBatisGenerator.generate(null);
} catch (SQLException e) {
LOG.error(e.getMessage(), e);
} catch (IOException e) {
} catch (SQLException | IOException e) {
LOG.error(e.getMessage(), e);
} catch (InterruptedException e) {
LOG.error(e.getMessage(), e);
throw new RuntimeException(e);
}
}
}

0 comments on commit a1436e3

Please sign in to comment.