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

9
LINES

< > BotCompany Repo | #1031048 // checkForRedeclaredFields - return error message if class has two fields of same name (bad for persistence and reflection)

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

Libraryless. Click here for Pure Java version (2739L/16K).

sS checkForRedeclaredFields(O o) {
  new Map<S, Field> map;
  fOr (Field f : nonStaticFieldObjects(o)) {
    Field f2 = map.put(f.getName(), f);
    if (f2 != null)
      ret "Field redeclared (not good): " + f + " / " + f2;
  }
  null;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1031048
Snippet name: checkForRedeclaredFields - return error message if class has two fields of same name (bad for persistence and reflection)
Eternal ID of this version: #1031048/3
Text MD5: 5f9a3add61462466ef74ecd587f0c5f9
Transpilation MD5: 8deb6b999229d3e85fe6f71ef68cdb51
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-04-25 23:11:04
Source code size: 246 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 97 / 141
Version history: 2 change(s)
Referenced in: [show references]