Visual studio feeds

All Visual Studio blogs in one place

Subscribe

Enter your email address:

Delivered by FeedBurner

Increase your website traffic with Attracta.com

Google+

Contact

Email:
Subject:
Message:
Anti-spam: How many eyes has a typical person?

Follow us on FB

Search

Challenge: This code should never hit production

AddThis Social Bookmark Button
This code should never have the chance to go to production, it is horribly broken in a rather subtle way, do you see it? public ISet GetTerms(string index, string field) { if(field == null) throw new ArgumentNullException("field"); if(index == null) throw new ArgumentNullException("index");
var result = new HashSet(); var currentIndexSearcher = database.IndexStorage.GetCurrentIndexSearcher(index); IndexSearcher searcher; using(currentIndexSearcher.Use(out searcher)) { var termEnum = searcher.GetIndexReader().Terms(new Term(field)); while (field.Equals(termEnum.Term().Field())) ...(Read whole news on source site)

Home : Blog List : VibrantCode : Challenge: This code should never hit production