Skip to content

Commit

Permalink
remove unnecessary casts
Browse files Browse the repository at this point in the history
  • Loading branch information
pabender committed Oct 25, 2018
1 parent 42463e4 commit 6f7ca4e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion java/src/jmri/jmrix/direct/ThrottleManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ static public ThrottleManager instance() {
public void requestThrottleSetup(LocoAddress address, boolean control) {
if (currentThrottle != null) {
log.error("DCC Direct cannot handle more than one throttle");
failedThrottleRequest((DccLocoAddress) address, "DCC direct cannot handle more than one throttle " + address);
failedThrottleRequest(address, "DCC direct cannot handle more than one throttle " + address);
return;
}
currentThrottle = new Throttle(((DccLocoAddress) address), tc); // uses address object
Expand Down
2 changes: 1 addition & 1 deletion java/src/jmri/jmrix/ecos/EcosDccThrottleManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public void throttleSetup(EcosDccThrottle throttle, LocoAddress address, boolean
notifyThrottleKnown(throttle, address);
} else {
log.debug("Ecos Throttle has NO control over loco " + address);
failedThrottleRequest((DccLocoAddress) address, "Loco is alredy in use by anoher throttle " + address);
failedThrottleRequest(address, "Loco is alredy in use by anoher throttle " + address);
}
}

Expand Down
2 changes: 1 addition & 1 deletion java/src/jmri/jmrix/loconet/LnThrottleManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ public void stealThrottleRequest(LocoAddress address, ThrottleListener l, boolea
log.debug("stealThrottleRequest() invoked for address {}, with steal boolean = {}",address.getNumber(),steal);
if (steal == false) {
if (address instanceof DccLocoAddress) {
failedThrottleRequest((DccLocoAddress) address, "User chose not to 'steal' the throttle.");
failedThrottleRequest(address, "User chose not to 'steal' the throttle.");
} else {
log.error("cannot cast address to DccLocoAddress.");
}
Expand Down

0 comments on commit 6f7ca4e

Please sign in to comment.