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)

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

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: 295 / 336
Version history: 1 change(s)
Referenced in: [show references]