-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid unchecked casts/assignments/calls (#3626)
* Don't extend ActivatableViewAndModel when the model is empty Remove the no-arg constructor from ActivatableViewAndModel, which sets a dummy Activatable singleton as the model. (Since the model type param can't be checked at runtime, improper use of the constructor could cause heap pollution.) Instead, extend 'ActivatableView<R, Void>' consistently, as other views without a model currently do. * Improve type safety of the fluent interface of Overlay<T> Refactor all the unchecked casts from Overlay<T> to T into a single private cast() method. Also add a runtime type check to the constructor to prevent creation of window objects of the form "A extends Overlay<B>" for unrelated A & B, as such casts would then subvert the type system. * Improve type safety of ProtoUtil.collectionToProto(Collection) Add a Class<T> parameter to the method, in order to avoid an unchecked cast to the Message type T. The cast was wrapped in a try-catch block, which is useless due to erasure, so use Class.cast(..) instead. * Avoid raw types to prevent unchecked casts in Log.java Add missing ILoggingEvent type arg to local variable declarations. * Avoid unchecked casts when deserializing JSON using Gson * Fix unchecked casts in views due to raw chart point types Add missing 'Number' coord type args to some XYChart.(Data|Series) & AreaChart declarations, and avoid passing them as generic varargs, in order to eliminate some more unchecked cast warnings. Also simplify OfferBookChartView.updateChartData() by unboxing the x- coordinate of each (buy & sell) datapoint. * Avoid raw type bounds in class declarations to fix unchecked warnings Make sure the generic classes MutableOfferView & AgentRegistrationView don't use raw bounds for their associated view models, as that leads to unchecked assignments from the model fields further down. * Fix some remaining suppressed unchecked casts in the UI logic (This still leaves a few more which are hard to avoid.) * Fix a few remaining unsuppressed unchecked warnings
- Loading branch information
Showing
50 changed files
with
243 additions
and
257 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.