The FindBugs Blog

Monday, October 15, 2007

Thread unsafe lazy initialization

I spent some time improving the detector for thread unsafe lazy initialization.

The following code is from JDK1.6.0, sun.security.provider.certpath.KeyChecker:


private static Set supportedExts;
public Set getSupportedExtensions() {
if (supportedExts == null) {
supportedExts = new HashSet();
supportedExts.add(PKIXExtensions.KeyUsage_Id.toString());
supportedExts.add(PKIXExtensions.ExtendedKeyUsage_Id.toString());
supportedExts.add(PKIXExtensions.SubjectAlternativeName_Id.toString());
supportedExts = Collections.unmodifiableSet(supportedExts);
}
return supportedExts;
}


So if two threads called getSupportedExtensions on two different KeyCheckers, not only could one thread see an incompletely initialized set, but one of the threads could also be handled a mutable reference to the set of supported extensions, which it could then use to add or remove supported extensions.

Oops...

Bill

69 Comments:

At 1:16 PM, Blogger barb michelen said...

Hello I just entered before I have to leave to the airport, it's been very nice to meet you, if you want here is the site I told you about where I type some stuff and make good money (I work from home): here it is

 
At 3:29 PM, Blogger bernard n. shull said...

hi mate, this is the canadin pharmacy you asked me about: the link

 
At 12:04 AM, Blogger pbsl said...

you have a nice site.thanks for sharing this site. various kinds of ebooks are available here

http://feboook.blogspot.com

 
At 2:14 AM, Blogger 真新 said...

視訊聊天室視訊聊天室視訊聊天室視訊聊天室視訊聊天室視訊聊天室視訊聊天室視訊聊天室視訊聊天視訊聊天室視訊聊天室玩美女人自拍貼圖影音視訊交友後官電影主入口a片下載後宮電影微風辣妹aa片免費看080情人同志交友網

 
At 3:18 AM, Blogger 雪糕 said...

cool blog,期待更新........................................

 
At 11:45 PM, Blogger 電腦 said...

Conversation makes one what he is.........................................

 
At 4:31 AM, Blogger bf12bf23 said...

Very good share ~ message support
...................................

 
At 5:48 AM, Blogger  said...

Lets cross the bridge when we come to it........................................

 
At 7:30 AM, Blogger 筱婷筱婷 said...

生活總是起起伏伏,心情要保持快樂才好哦!!..................................................

 
At 1:51 PM, Blogger 佩昭彥怡 said...

上來打聲招呼,祝你一切平安! ........................................

 
At 2:24 AM, Blogger 于毓于毓 said...

nice job! waiting for your new artical. ........................................

 
At 11:14 PM, Blogger 怡萱 said...

我們唯一需要恐懼的事,是恐懼本身........................................

 
At 8:29 AM, Blogger 彥鈺 said...

Thx ur share........................................

 
At 6:32 AM, Blogger 原秋 said...

人必須心懷希望,才會活的快樂,日子才過得充實,有意義,有朝氣,有信心。........................................

 
At 11:12 PM, Blogger SigridNolen1祐音 said...

想要推動天下,先要發動自己。 ....................................................

 
At 12:55 AM, Blogger AshleyRe凱倫 said...

弱者等待時機,強者製造時機..................................................

 
At 12:34 AM, Blogger 志文 said...

sex貼片,姦淫小說 高雄視訊34C援交妹AIO 成人視訊jeyn 美女交友豆豆情色視訊 情色文學成人小說,情趣 av博物館 網愛交友qk176 一葉晴語音聊天網av127 hi5 tv 免費影片 173視訊聊天 777成人 硬弟弟論壇 影音交友616 聊天室13060免費 104廖家儀自拍外流 24h免費成人頻道 0204movie免費影片 s18x色網 辣妹影片直播av無碼 aio交友愛情館視訊交友90739 台北聊天交友 援助交際聊天室 嗆辣妹影音視訊聊天室 做愛影片 洪爺影城 辣妹自拍哈尼視訊 台南援交友留言 情惑用品性易購 哈尼視訊,鹹濕視訊 0401遊戲線上 sex女優王國自拍 qq 視訊交友 美女交友影音視訊聊天室 辣妹視訊網 無碼卡通,無碼a片 104自拍 部落格 遊戲區 免費視訊-美女館 34c辣妹影片直播 豆豆情色風暴視訊 給我棒棒 sexy girl,mm視訊kk視訊 85cc辣妹視訊 台灣妹色網 dudu嘟嘟成人網 成人圖片 77p2p影片區 無碼 av影片 視訊聊天 影片 寫真 080台灣名模討論區 視訊網愛聊天室 正妹牆qk176

 
At 1:37 AM, Blogger 怡潔向霖 said...

Better be the head of a dog than the tail of a lion...................................................

 
At 12:49 PM, Blogger AshleyRemley12俊財 said...

沒有目標而生活,恰如沒有羅盤而航行 ............................................................

 
At 3:49 AM, Blogger hernande said...

黃金千金,不如季布一諾。 ............................................................

 
At 6:27 PM, Blogger 育淑 said...

人有兩眼一舌,是為了觀察倍於說話的緣故。..................................................................

 
At 10:14 AM, Blogger 馨裕 said...

Pay somebody back in his own coin.................................................................

 
At 7:07 PM, Blogger 貞合 said...

知識可以傳授,智慧卻不行。每個人必須成為他自己。......................................................................

 
At 8:53 AM, Blogger 韋志韋志 said...

與人相處不妨多用眼睛說話,多用嘴巴思考.................................................................

 
At 8:25 PM, Blogger 怡潔怡潔 said...

人不能像動物一樣活著,而應該追求知識和美德............................................................

 
At 3:47 AM, Blogger 張怡 said...

Hello~Nice meet you~~............................................................

 
At 3:48 AM, Blogger 吳婷婷 said...

欣賞你的內容是美德~~支持你是最大回應..................................................................

 
At 6:24 AM, Blogger 吳婷婷 said...

在你一無所有的時候 是誰在陪伴你 他便是你最重要的人............................................................

 
At 8:59 AM, Blogger 許紀廷 said...

人生的「三部曲」應該是無愧的昨天,充實的今天,與充滿希望的明天。..................................................

 
At 9:58 PM, Blogger 吳婷婷 said...

馬丁路德:「即使知道明天世界即將毀滅,我仍願在今天種下一棵小樹。」............................................................

 
At 11:14 AM, Blogger 姿柯瑩柯dgdd憶曾g智曾 said...

來替你打氣,加油A_A............................................................

 
At 10:53 PM, Blogger 吳婷婷 said...

快樂,是享受工作過程的結果............................................................

 
At 10:53 PM, Blogger 香昱信張君林 said...

「仁慈」二個字,就能讓冬天三個月都溫暖。..................................................

 
At 10:54 PM, Blogger KyungBivo中如 said...

與人相處不妨多用眼睛說話,多用嘴巴思考. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

 
At 2:56 PM, Blogger 姿柯瑩柯dgdd憶曾g智曾 said...

愛情是一種發明,需要不斷改良。只是,這種發明和其他發明不一樣,它沒有專利權,隨時會被人搶走。.................................................................

 
At 6:11 AM, Blogger 曹季恩曹季恩 said...

It is easier to get than to keep it.......................................................................

 
At 7:59 AM, Blogger 玟君張 said...

Thank you very much for such useful informaion ● 3●............................................................

 
At 9:38 AM, Blogger 謝翁穎翰毓珍 said...

Joy often comes after sorrow, like morning after night.. . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

 
At 12:31 PM, Blogger 文王廷 said...

the best as always thanks............................................................

 
At 3:21 AM, Blogger 孫邦柔 said...

一棵樹除非在春天開了花,否則難望在秋天結果。..................................................

 
At 6:06 AM, Blogger 信陳定 said...

河水永遠是相同的,可是每一剎那又都是新的。............................................................

 
At 2:50 PM, Blogger 峻胡邦慧v帆 said...

u are so kind to post so good artical! i like it!..................................................................

 
At 7:17 PM, Blogger 佳張張張張燕張張張張張 said...

說「吃虧就是便宜的人」,多半不是吃虧的人。......................................................................

 
At 12:20 AM, Blogger 佳張張張張燕張張張張張 said...

培養健全孩子最好的方法是父母先成為健全的人。......................................................................

 
At 12:39 PM, Blogger 孟湖聿軒 said...

來看你囉~加油~~!!.................................[/url]...............

 
At 5:04 PM, Blogger 黃英吳思潔吳思潔邦 said...

人生中最好的禮物就是屬於自己的一部份............................................................

 
At 4:18 PM, Blogger Spineless said...

cool blog :)

 
At 5:32 AM, Blogger Steve Smith said...

Great and Useful Article.

Online Java Training

Online Java Training from India

Online Java Training

Online Java Training From India

Java Training Institutes in Chennai

Java Training in Chennai

 
At 6:39 AM, Blogger Haritha said...

This is really a great post. Thank you for taking time to provide us some of the useful and exclusive information with us. Keep on blogging!!

IOS Training in Chennai

 
At 9:24 AM, Blogger Priscilla said...

Thank you for taking the time to provide us with your valuable information. We strive

to provide our candidates with excellent care.As always, we appreciate your

confidence and trust in us..SAP Training in chennai

 
At 5:36 AM, Blogger Dhiya Ram said...

It's interesting that many of the bloggers your tips helped to clarify a few things for me as well as giving.. very specific niche content. And tell people specific ways to live their lives.Sometimes you just have to yell at people and give them a good shake to get your point across.

SEO Training in Chennai

 
At 4:41 AM, Blogger Saki R said...

This blog explains the details of most popular technological details. This helps to learn about what are all the different method is there. And the working methods all of that are explained here. Informative blog.
PHP Training in Chennai Mylapore

 
At 6:09 AM, Blogger Sathya G said...


Thanks for this selfless act. really feel very happy about sharing your useful update with us.
ROI Services in Chennai

 
At 1:57 AM, Blogger Aasha said...

wow really superb you had posted one nice information through this. Definitely it will be useful for many people. So please keep update like this.

Email Marketing Chennai

 
At 6:05 AM, Blogger Abiya Carol said...

Hey, good day
Thanks for sharing such valuable information.I want more these type of informative blogs, and really thankful.If you want to get more information to share these followig links.

PPC Services in Chennai

 
At 2:37 AM, Blogger Sowmiya said...


This idea is mind blowing. I think everyone should know such information like you have described on this post. Thank you for sharing this explanation.
Your final conclusion was good. We are sowing seeds and need to be patiently wait till it blossoms.

Best Informatica Training Institute in Chennai

 
At 1:39 AM, Blogger deeksha said...

This blog is having a wonderful talk. The technology are discussed and provide a great knowledge to all. This helps to learn more details about technology. All this details are important for this technology. Thank you for this blog.

Best Android Training Institute in Chennai

 
At 6:44 AM, Blogger Pricilla Prasanth said...

I have own car so now I am back out there trying to show him how to do car repairs. Your blog is an excellent source of info, thanks.

bike spa services in mumbai
house cleaning services in mumbai
car wash services in mumbai

 
At 11:14 PM, Blogger Jeffy said...


Thank you for sharing such a nice and interesting blog with us. Hope it might be much useful for us. keep on updating...!!
seo company in india
digital marketing company in india
seo company in chennai
digital marketing company in chennai

 
At 2:07 AM, Blogger Shalini said...

Superb. I really enjoyed very much with this article here. Really it is an amazing article I had ever read. I hope it will help a lot for all. Thank you so much for this amazing posts and please keep update like this excellent article.thank you for sharing such a great blog with us. expecting for your.

seo company in india

 
At 5:08 AM, Blogger vinu priya said...

Learning new technolgy would help oneself at hard part of their career. And staying updated is the only way to survive in current position. Your content tells the same. Thanks for sharing this information in here. Keep blogging like this.
iOS App Development Company in India

 
At 6:22 AM, Blogger karthik anu said...

This article is very much helpful and i hope this will be an useful information for the needed one. Keep on updating these kinds of informative things...
iOS Training in Chennai
Android Training in Chennai
php Training in Chennai

 
At 3:04 AM, Blogger vinu priya said...

This information is impressive; I am inspired with your post writing style & how continuously you describe this topic. After reading your post, thanks for taking the time to discuss this, I feel happy about it and I love learning more about this topic. Android App Development Company in Chennai

 
At 5:55 AM, Blogger bavana princy said...


This blog giving the details of technology. This gives the details about working with the business processes and change the way. Here explains think different and work different then provide the better output. Thanks for this blog.
Back to Original Services Private Limited

 
At 1:22 AM, Blogger sathya said...

Great post! I am actually getting ready to across this information, is very helpful my friend. Also great blog here with all of the valuable information you have Keep up the good work you are doing here.Well, got a good knowledge.

SEO Company in India

 
At 10:41 PM, Blogger Shalini said...

Very nice post here thanks for it .I always like and such a super contents of these post.Excellent and very cool idea and great content of different kinds of the valuable information's.

Digital Marketing Company in Chennai

 
At 12:30 AM, Blogger tessa tessa said...

Helpful as always. Every post you write produce a massive value to your readers that is the only reason it is so popular and has great authority.

SEO Company in India

 
At 11:08 PM, Blogger Navya Kumar said...

Wonderful bloggers like yourself who would positively reply encouraged me to be more open and engaging in commenting.So know it's helpful.
Digital Marketing Company in India

 
At 10:27 AM, Blogger Merlin Maarit said...


It is very helpful for me. Keep blogging like this.


Healthcare Analytics Company

Finance Analytics Company

Telecom Analytics Company

Retail Analytics Company

Analytics Company

US IT Staffing Agency

 

Post a Comment

<< Home