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

7
LINES

< > BotCompany Repo | #1032508 // threadLocalWithDefault

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

Libraryless. Click here for Pure Java version (32L/1K).

static <A> ThreadLocal<A> threadLocalWithDefault(A defaultValue) {
  ret new ThreadLocal<A> {
    public A initialValue() {
      ret defaultValue;
    }
  };
}

Author comment

Began life as a copy of #1012803

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx

No comments. add comment

Snippet ID: #1032508
Snippet name: threadLocalWithDefault
Eternal ID of this version: #1032508/1
Text MD5: 23f5d91c812a49107171bb0044fcc1c5
Transpilation MD5: 2e8c0a7a27b9f22a0ec8f5611b7ff4a9
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-09-12 04:27:24
Source code size: 166 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 90 / 133
Referenced in: [show references]