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

23
LINES

< > BotCompany Repo | #1005033 // Find all inner classes of main in running program

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (1156L/8K/27K).

1  
!752
2  
3  
static class Holladiho {
4  
  class Cheerio {}
5  
}
6  
7  
p {
8  
  ClassLoader loader = myClassLoader();
9  
  L<File> files = cast getOpt(loader, "files");
10  
  if (files == null)
11  
    fail("No classes info (please run #1001639!)");
12  
  new L<S> classes;
13  
  for (File dir : files) {
14  
    if (dir.isDirectory()) {
15  
      for (File f : listFiles(dir)) {
16  
        S s = f.getName();
17  
        if (s.endsWith(".class") && s.startsWith("main$"))
18  
          classes.add(dropPrefix("main$", dropSuffix(".class", s)));
19  
      }
20  
    }
21  
  }
22  
  printStructure(classes);
23  
}

Author comment

Began life as a copy of #1005032

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1005033
Snippet name: Find all inner classes of main in running program
Eternal ID of this version: #1005033/1
Text MD5: 7fd6e1b5f4540a2e2c69d1c123056eb5
Transpilation MD5: 0b3541e7eab26f1c54fed77dbfafbc83
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-09-29 01:25:58
Source code size: 555 bytes / 23 lines
Pitched / IR pitched: No / No
Views / Downloads: 428 / 453
Referenced in: [show references]