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

11
LINES

< > BotCompany Repo | #1024100 // objectDirectlyReferencesObjectOfType

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

Libraryless. Click here for Pure Java version (1688L/11K).

sbool objectDirectlyReferencesObjectOfType(O a, Class c) ctex {
  if (a == null) false;
  if (a instanceof O[])
    for (O x : (O[]) a)
      if (isInstance(c, x))
        true;
  for (Field f : nonStaticNonPrimitiveFieldObjects(a))
    if (isInstance(c, f.get(a)))
      true;
  false;
}

Author comment

Began life as a copy of #1024099

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1024100
Snippet name: objectDirectlyReferencesObjectOfType
Eternal ID of this version: #1024100/5
Text MD5: e4211b40000f66ce9ee4725536ed9b00
Transpilation MD5: 0a0995518f7eb5b0fe0a4f11aa703077
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-07-20 19:24:56
Source code size: 298 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 107 / 175
Version history: 4 change(s)
Referenced in: [show references]