Libraryless. Click here for Pure Java version (4583L/27K).
transient new CloseablesHolder resources; <A extends AutoCloseable> A ownResource(A resource) { resources?.add(resource); ret resource; } void ownResources(IResourceHolder holder) { assertNotNull(resources); if (holder == null) ret; resources.addAll(holder.takeAll()); } close { resources?.close(); }
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1033023 |
Snippet name: | Resources mix-in |
Eternal ID of this version: | #1033023/5 |
Text MD5: | a950447a546e1c36a1bd3c899496466b |
Transpilation MD5: | 10ce2dfbf9e86766eeedbff4271ec707 |
Author: | stefan |
Category: | javax / opus |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-10-11 12:21:49 |
Source code size: | 319 bytes / 11 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 155 / 389 |
Version history: | 4 change(s) |
Referenced in: | [show references] |