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

17
LINES

< > BotCompany Repo | #1016839 - cleanDefunctACCsInAllSwingComponents

JavaX fragment (include)

static LS cleanDefunctACCsInAllSwingComponents_fields = ll('acc, 'inheritedAccessControlContext);

svoid cleanDefunctACCsInAllSwingComponents() {
  // TODO (possibly): follow Window.getInputContext() -> InputMethod -> awtFocussedComponent
  
  for (Component c : allAWTComponents())
   for (S field : cleanDefunctACCsInAllSwingComponents_fields) pcall {
    AccessControlContext acc = castGetOpt(c, field);
    if (acc == null) continue;
    L<S> defunctIDs = acc_defunctProgramIDs(acc);
    if (nempty(defunctIDs)) {
      S desc = shortClassName(c);
      //print("DEFUNCT ACC IN COMPONENT " + field + "! Cleaning. " + defunctIDs + ": " + desc);
      set(c, field, acc_current());
    }
  }
}

Author comment

Began life as a copy of #1016334

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: #1016839
Snippet name: cleanDefunctACCsInAllSwingComponents
Eternal ID of this version: #1016839/5
Text MD5: 756d08810bb916d78c7c85049300817d
Author: stefan
Category: javax / maintenance
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-10-29 16:19:04
Source code size: 711 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 201 / 242
Version history: 4 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1016839 & http://1016839.tinybrain.de