Skip to content

Commit

Permalink
#13: Fix sonar warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
kaklakariada committed Jan 9, 2021
1 parent a726cd4 commit f214000
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ private static UiStateModel loadState(Jsonb jsonb, Path path)
}
catch (final IOException | JsonbException e)
{
LOG.warn("Error loading ui-state from " + path + ": use default values", e);
LOG.warn("Error loading ui-state from {}: use default values", path, e);
}
}
LOG.info("Using fresh ui-state");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.itsallcode.whiterabbit.logic.model.json.FieldAccessStrategy;

@JsonbVisibility(FieldAccessStrategy.class)
@SuppressWarnings("java:S1104") // Encapsulation not necessary for model
public class ColumnStateModel
{
public String id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.itsallcode.whiterabbit.logic.model.json.FieldAccessStrategy;

@JsonbVisibility(FieldAccessStrategy.class)
@SuppressWarnings("java:S1104") // Encapsulation not necessary for model
public class SplitPaneStateModel
{
public String id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.itsallcode.whiterabbit.logic.model.json.FieldAccessStrategy;

@JsonbVisibility(FieldAccessStrategy.class)
@SuppressWarnings("java:S1104") // Encapsulation not necessary for model
public class StageStateModel
{
public String id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.itsallcode.whiterabbit.logic.model.json.FieldAccessStrategy;

@JsonbVisibility(FieldAccessStrategy.class)
@SuppressWarnings("java:S1104") // Encapsulation not necessary for model
public class TableStateModel
{
public String id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.itsallcode.whiterabbit.logic.model.json.FieldAccessStrategy;

@JsonbVisibility(FieldAccessStrategy.class)
@SuppressWarnings("java:S1104") // Encapsulation not necessary for model
public class UiStateModel
{
public Map<String, StageStateModel> stages = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class StageStateManager implements WidgetStateManager<Stage, StageStateModel>

public StageStateManager(DelayedPropertyListener propertyListener)
{
super();
this.propertyListener = propertyListener;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static TimeUtil start(Instant initialTime)

if (shouldRunExecutor(delayMillis.longValue(), runnable))
{
LOG.debug("Run real execution with delay {}ms of {}", delayMillis, runnable);
LOG.trace("Run real execution: delay {}ms, runnable: {}", delayMillis, runnable);
runnable.run();
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import java.time.Duration;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;

import org.itsallcode.whiterabbit.logic.service.ClockService;
Expand All @@ -24,10 +23,10 @@ public ScheduledTaskFuture schedule(Trigger trigger, Runnable command)
return new ReschedulingRunnable(command, trigger, executorService, clockService, errorHandler).schedule();
}

public ScheduledFuture<?> schedule(Duration delay, Runnable command)
public void schedule(Duration delay, Runnable command)
{
final ErrorHandler errorHandler = new DefaultErrorHandler();
return executorService.schedule(new DelegatingErrorHandlingRunnable(command, errorHandler), delay.toMillis(),
executorService.schedule(new DelegatingErrorHandlingRunnable(command, errorHandler), delay.toMillis(),
TimeUnit.MILLISECONDS);
}

Expand Down

0 comments on commit f214000

Please sign in to comment.