Skip to content

Commit 75286d1

Browse files
committed
last issues fixed
1 parent 5f5e855 commit 75286d1

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

src/main/java/de/doubleslash/keeptime/Main.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public void start(final Stage primaryStage) throws Exception {
107107
.addAll(model.getAllProjects().stream().filter(Project::isEnabled).collect(Collectors.toList()));
108108

109109
// set default project
110-
final Optional<Project> findAny = projects.stream().filter(p -> p.isDefault()).findAny();
110+
final Optional<Project> findAny = projects.stream().filter(Project::isDefault).findAny();
111111
if (findAny.isPresent()) {
112112
model.setIdleProject(findAny.get());
113113
log.debug("Using project '{}' as default project.", model.getIdleProject());

src/main/java/de/doubleslash/keeptime/view/ReportController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ private void updateReport(final LocalDate newvalue) {
7070
currentDayLabel.setText(DateFormatter.toDayDateString(newvalue));
7171
final List<Work> currentWorkItems = model.getWorkRepository().findByCreationDate(newvalue);
7272

73-
final SortedSet<Project> workedProjectsSet = currentWorkItems.stream().map(m -> m.getProject())
73+
final SortedSet<Project> workedProjectsSet = currentWorkItems.stream().map(Work::getProject)
7474
.collect(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(Project::getName))));
7575

7676
gridPane.getChildren().clear();

src/main/java/de/doubleslash/keeptime/view/ViewController.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
import javafx.beans.property.SimpleBooleanProperty;
3333
import javafx.beans.property.SimpleLongProperty;
3434
import javafx.beans.property.SimpleObjectProperty;
35-
import javafx.collections.ListChangeListener;
3635
import javafx.collections.ListChangeListener.Change;
3736
import javafx.collections.ObservableList;
3837
import javafx.embed.swing.SwingFXUtils;
@@ -203,7 +202,7 @@ private void initialize() {
203202
calendarButton.setOnAction(ae -> calendarClicked());
204203
calendarButton.setEffect(lighting);
205204

206-
final Runnable updateMainBackgroundColor = () -> runUpdateMainBackgroundColor();
205+
final Runnable updateMainBackgroundColor = this::runUpdateMainBackgroundColor;
207206

208207
mouseHoveringProperty.addListener((a, b, c) -> updateMainBackgroundColor.run());
209208

@@ -259,8 +258,7 @@ private void initialize() {
259258
textArea.setText("");
260259
});
261260

262-
model.getAvailableProjects()
263-
.addListener((ListChangeListener<Project>) lis -> setUpAvailableProjectsListener(lis));
261+
model.getAvailableProjects().addListener(this::setUpAvailableProjectsListener);
264262

265263
Model.DEFAULT_BACKGROUND_COLOR.addListener((a, b, c) -> updateMainBackgroundColor.run());
266264
Model.HOVER_BACKGROUND_COLOR.addListener((a, b, c) -> updateMainBackgroundColor.run());

0 commit comments

Comments
 (0)