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

18
LINES

< > BotCompany Repo | #1016585 // call_checkArgs

JavaX fragment (include)

1  
static bool call_checkArgs(Method m, Object[] args, boolean debug) {
2  
  Class<?>[] types = m.getParameterTypes();
3  
  if (types.length != l(args)) {
4  
    if (debug)
5  
      print("Bad parameter length: " + args.length + " vs " + types.length);
6  
    false;
7  
  }
8  
  for (int i = 0; i < types.length; i++) {
9  
    O arg = args[i];
10  
    if (!(arg == null ? !types[i].isPrimitive()
11  
      : isInstanceX(types[i], arg))) {
12  
      if (debug)
13  
        print("Bad parameter " + i + ": " + arg + " vs " + types[i]);
14  
      false;
15  
    }
16  
  }
17  
  true;
18  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1016585
Snippet name: call_checkArgs
Eternal ID of this version: #1016585/5
Text MD5: 3ef1c128d1965eed4298250e1c22173a
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-03-08 06:46:28
Source code size: 540 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 488 / 543
Version history: 4 change(s)
Referenced in: [show references]