Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

7
LINES

< > BotCompany Repo | #1023102 // badCastException - give out more informative message

JavaX fragment (include)

1  
static RuntimeException badCastException(O o, Class c) {
2  
  ifclass DynamicObject
3  
  if (o cast DynamicObject)
4  
    fail("DynamicObject " + o.className + " can't be cast to " + c);
5  
  endif
6  
  fail(className(o) + " can't be cast to " + c);
7  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1023102
Snippet name: badCastException - give out more informative message
Eternal ID of this version: #1023102/2
Text MD5: 089e643d5e66bba64634e3148c6af217
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-05-05 18:20:49
Source code size: 242 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 199 / 246
Version history: 1 change(s)
Referenced in: [show references]