Skip to content

Commit

Permalink
Fixing code smells & changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastian-peter committed Jan 6, 2022
1 parent 8fa966b commit 064cdad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- added `EvcsLocationType` support in `EvcsInput` and `EvcsInputFactory` [#406](https://github.com/ie3-institute/PowerSystemDataModel/issues/406)
- Opportunity to close writer in `CsvFileSink`
- Generified SQL data sources for future extensions

### Fixed
- adapted `LineInput` constructor to convert line length to `StandardUnits.LINE_LENGTH` [#412](https://github.com/ie3-institute/PowerSystemDataModel/issues/412)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public abstract class SqlDataSource<T> {

private final SqlConnector connector;

public SqlDataSource(SqlConnector connector) {
protected SqlDataSource(SqlConnector connector) {
this.connector = connector;
}

Expand Down Expand Up @@ -103,8 +103,8 @@ protected List<T> executeQuery(String query, AddParams addParams) {

return fieldMaps.stream()
.map(this::createEntity)
.flatMap(o -> o.map(Stream::of).orElseGet(Stream::empty))
.collect(Collectors.toList());
.flatMap(Optional::stream)
.toList();
} catch (SQLException e) {
log.error("Error during execution of query {}", query, e);
}
Expand Down

0 comments on commit 064cdad

Please sign in to comment.