- // Get a handle for `AddDomainListener` from `context`.
- try {
- addDomainListener = (AddDomainListener) context;
- } catch(ClassCastException exception) {
- throw new ClassCastException(context.toString() + " must implement `AddDomainListener`.");
- }
+ // Get a handle for the listener from the launching context.
+ addDomainListener = (AddDomainListener) context;