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

33
LINES

< > BotCompany Repo | #1022256 // makeAccessible - turn Field or Method accessible

JavaX fragment (include) [tags: use-pretranspiled]

Transpiled version (2064L) is out of date.

static Field makeAccessible(Field f) {
  try {
    f.setAccessible(true);
  } catch e {
    // Note: The error reporting only works with Java VM option --illegal-access=deny
    ifndef LeanMode
    vmBus_send makeAccessible_error(e, f);
    endifndef
  }
  ret f;
}

static Method makeAccessible(Method m) {
  try {
    m.setAccessible(true);
  } catch e {
    ifndef LeanMode
    vmBus_send makeAccessible_error(e, m);
    endifndef
  }
  ret m;
}

static Constructor makeAccessible(Constructor c) {
  try {
    c.setAccessible(true);
  } catch e {
    ifndef LeanMode
    vmBus_send makeAccessible_error(e, c);
    endifndef
  }
  ret c;
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1022256
Snippet name: makeAccessible - turn Field or Method accessible
Eternal ID of this version: #1022256/8
Text MD5: e22d7d521afb3aa6064f4cdccee39793
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-05-27 15:01:55
Source code size: 673 bytes / 33 lines
Pitched / IR pitched: No / No
Views / Downloads: 430 / 562
Version history: 7 change(s)
Referenced in: [show references]