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

9
LINES

< > BotCompany Repo | #1026437 // closeAll

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

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

svoid closeAll(Iterable<? extends AutoCloseable> l) {
  if (l == null) ret;
  for (AutoCloseable c : l) pcall { close(c); }
}

svoid closeAll(AutoCloseable... l) {
  if (l == null) ret;
  for (AutoCloseable c : l) pcall { close(c); }
}

Author comment

Began life as a copy of #1026413

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: #1026437
Snippet name: closeAll
Eternal ID of this version: #1026437/2
Text MD5: f9403340715772e97cae99e527134391
Transpilation MD5: 9faf9464a2a0208ec935e26a4a16531f
Author: stefan
Category: javax / stefan's os
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-09-16 13:43:55
Source code size: 243 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 215 / 303
Version history: 1 change(s)
Referenced in: [show references]