Skip to content

Commit

Permalink
code inspections
Browse files Browse the repository at this point in the history
  • Loading branch information
s1mpl3x committed Apr 25, 2016
1 parent f77d205 commit 75cc78d
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions src/main/java/eu/over9000/skadi/model/StateContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,15 @@ public double getWindowWidth() {
return windowWidth;
}

public void setWindowWidth(double windowWidth) {
public void setWindowWidth(final double windowWidth) {
this.windowWidth = windowWidth;
}

public double getWindowHeight() {
return windowHeight;
}

public void setWindowHeight(double windowHeight) {
public void setWindowHeight(final double windowHeight) {
this.windowHeight = windowHeight;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ protected Task<ImageView> createTask() {

@Override
protected ImageView call() throws Exception {
Image img = ImageUtil.getImageInternal(url);
final Image img = ImageUtil.getImageInternal(url);

final ImageView iv = new ImageView(img);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class LivestreamerVersionCheckService extends Service<String> {

public LivestreamerVersionCheckService(final StatusBar sb) {
setOnSucceeded(event -> {
String message = (String) event.getSource().getValue();
final String message = (String) event.getSource().getValue();

if (message != null) {
sb.setText(message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
public class PanelConstructionService extends Service<VBox> {
private Panel panel;

public PanelConstructionService(Panel panel) {
public PanelConstructionService(final Panel panel) {
this.panel = panel;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@ public VersionCheckerService(final Stage window, final StatusBar sb) {
LOGGER.info(msg_older);
sb.setText(msg_older);

UpdateAvailableDialog dialog = new UpdateAvailableDialog(result.getRemoteResult());
final UpdateAvailableDialog dialog = new UpdateAvailableDialog(result.getRemoteResult());
dialog.initModality(Modality.APPLICATION_MODAL);
dialog.initOwner(window);
final Optional<ButtonType> doDownload = dialog.showAndWait();
if (doDownload.get() == UpdateAvailableDialog.UPDATE_BUTTON_TYPE) {
window.hide();

PerformUpdateDialog doDialog = new PerformUpdateDialog(result.getRemoteResult());
final PerformUpdateDialog doDialog = new PerformUpdateDialog(result.getRemoteResult());
doDialog.initModality(Modality.APPLICATION_MODAL);
doDialog.initOwner(window);
final Optional<File> newJar = doDialog.showAndWait();
Expand All @@ -101,7 +101,7 @@ public VersionCheckerService(final Stage window, final StatusBar sb) {
try {
LOGGER.info("starting new jar..");
Runtime.getRuntime().exec("java -jar " + newJar.get().getAbsolutePath());
} catch (IOException e) {
} catch (final IOException e) {
LOGGER.error("error starting updated version", e);
}
LOGGER.info("begin shutdown");
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/eu/over9000/skadi/ui/MainWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -478,8 +478,8 @@ private void checkThemeChange() {
private void updateFilterPredicate() {
final Predicate<Channel> channelPredicate = channel -> {

boolean isOnlineResult;
boolean containsTextResult;
final boolean isOnlineResult;
final boolean containsTextResult;

// isOnline returns a Boolean, can be null
isOnlineResult = !onlineOnly.isSelected() || Boolean.TRUE.equals(channel.isOnline());
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/eu/over9000/skadi/util/EmoteUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public static List<HBox> buildEmotePanel(final List<EmoteDataRetriever.Emoticon>

try {
latch.await();
} catch (InterruptedException e) {
} catch (final InterruptedException e) {
LOGGER.error("error in emote list retrieval: ", e);
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/eu/over9000/skadi/util/HttpUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ public static String getAPIResponse(final String apiUrl) throws URISyntaxExcepti
return new BasicResponseHandler().handleResponse(response);
}

public static InputStream getAPIResponseBin(String apiURL) throws IOException, URISyntaxException {
public static InputStream getAPIResponseBin(final String apiURL) throws IOException, URISyntaxException {
final URI URL = new URI(apiURL);
final HttpGet request = new HttpGet(URL);
request.setHeader("Client-ID", SKADI_CLIENT_ID);
final HttpResponse response = HTTP_CLIENT.execute(request);
HttpEntity entity = response.getEntity();
final HttpEntity entity = response.getEntity();
return entity.getContent();
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/eu/over9000/skadi/util/ImageUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ public class ImageUtil {

public static Image getImageInternal(final String url) {
try {
InputStream stream = HttpUtil.getAPIResponseBin(url);
Image img = new Image(stream);
final InputStream stream = HttpUtil.getAPIResponseBin(url);
final Image img = new Image(stream);
stream.close();
return img;
} catch (URISyntaxException | IOException e) {
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/eu/over9000/skadi/util/PanelUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ public class PanelUtil {
private static final Logger LOGGER = LoggerFactory.getLogger(PanelUtil.class);

public static List<VBox> buildPanels(final List<Panel> panels) {
List<VBox> result = new ArrayList<>(panels.size());
final List<VBox> result = new ArrayList<>(panels.size());

CountDownLatch latch = new CountDownLatch(panels.size());
final CountDownLatch latch = new CountDownLatch(panels.size());

panels.forEach(panel -> {
PanelConstructionService service = new PanelConstructionService(panel);
final PanelConstructionService service = new PanelConstructionService(panel);
service.setOnSucceeded(event -> {
final VBox panelBox = (VBox) event.getSource().getValue();
result.add(panelBox);
Expand All @@ -90,7 +90,7 @@ public static List<VBox> buildPanels(final List<Panel> panels) {

try {
latch.await();
} catch (InterruptedException e) {
} catch (final InterruptedException e) {
LOGGER.error("error waiting for panel construction: ", e);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

public class AsyncImageUpdateTask implements Callable<Void> {
private final Channel channel;
private String url;
private final String url;

public AsyncImageUpdateTask(final Channel channel, final String url) {
this.channel = channel;
Expand Down

0 comments on commit 75cc78d

Please sign in to comment.