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

12
LINES

< > BotCompany Repo | #1029589 // test_getTypeArgumentAsClass (OK)

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

Libraryless. Click here for Pure Java version (2719L/17K).

1  
svoid test_getTypeArgumentAsClass() {
2  
  class X {
3  
    LS bla;
4  
    L x;
5  
    LLS y;
6  
  }
7  
  
8  
  Type type = genericFieldType(X.class, 'bla);
9  
  assertEqualsVerbose(S.class, getTypeArgumentAsClass(type));
10  
  assertEqualsVerbose(L.class, getTypeArgumentAsClass(genericFieldType(X.class, 'y)));
11  
  assertEqualsVerbose(null, getTypeArgumentAsClass(genericFieldType(X.class, 'x)));
12  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1029589
Snippet name: test_getTypeArgumentAsClass (OK)
Eternal ID of this version: #1029589/5
Text MD5: 700a0d8a76796082824f3c3d8038315f
Transpilation MD5: 0f7ffc249100e87ce5b94ce90164a2f2
Author: stefan
Category: javax / reflection
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-08-27 13:22:48
Source code size: 381 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 163 / 244
Version history: 4 change(s)
Referenced in: [show references]