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

27
LINES

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

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

Libraryless. Click here for Pure Java version (2064L/13K).

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

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

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

download  show line numbers  debug dex   

Travelled to 3 computer(s): cfunsshuasjs, mqqgnosmbjvj, tvejysmllsmz

No comments. add comment

Snippet ID: #1022256
Snippet name: makeAccessible - turn Field or Method accessible
Eternal ID of this version: #1022256/6
Text MD5: f2185bbfda13698c8533568488bf8437
Transpilation MD5: 1b47c2151a9621213dba70e71c0c61a0
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-08-31 15:01:24
Source code size: 565 bytes / 27 lines
Pitched / IR pitched: No / No
Views / Downloads: 38 / 59
Version history: 5 change(s)
Referenced in: [show references]