Browsing 7239 questions and answers with Jon Skeet
It is documented to behave in this way - is there a reason for this? Yup - it's basically very hard to determine zone equality in a general way. Suppose we have two BclDateTimeZone instances which wrap two distinct TimeZoneInfo... more 11/12/2014 5:40:11 PM
Yes, it's treating that as a call using varargs and int[] as the type argument, i.e. List<int[]> list = Arrays.<int[]>asList(new int[][] { arr }); The alternative would be to infer T=int... which is impossible, as Java... more 11/12/2014 5:33:15 PM
dasblinkenlight's approach is probably the best if you're happy to restrict yourself to collections where you know the length beforehand. If you don't, you might want to add an extension method like this (untested): public static... more 11/12/2014 4:55:44 PM
The problem is that the compile-time type of your newObject variable is shape. That means the only members that the compiler knows about are the ones in shape, and that doesn't include f(). If you want to use members which are specific to... more 11/12/2014 2:58:08 PM
Yes - it blocks until one of the follow conditions is satisfied: A character is read The end of the underlying stream is reached The underlying stream throws an exception more 11/12/2014 2:49:02 PM
I think you've misunderstood how async and await works. If DoSomething() is a long-running method which isn't designed for asynchrony, you probably just want to do it in a different thread, e.g. by starting a separate... more 11/12/2014 2:40:29 PM
I think in this confined case, it is OK to have this kind of naming. Well, personally I disagree. It's generally bad for readability when the same name means different things within a program - it's even worse (IMO) when those two... more 11/12/2014 2:17:53 PM
You could test that getConfigValue returned the values loaded from the file, basically. Just because you test setConfigValue/getConfigValue in other tests doesn't mean that you can't use them in the test for loadConfigFile. As an aside,... more 11/12/2014 12:58:25 PM
Could someone explain this behaviour? Sure - extension methods aren't considered until after the compiler has failed to find a normal instance method to call. They're not part of the normal candidate set. If you do something that... more 11/12/2014 11:07:11 AM
You need two formats: one to parse, and one to format. You need to parse from String to Date with one DateFormat, then format that Date into a String with the other format. Currently, your single SimpleDateFormat is half way between -... more 11/12/2014 8:52:25 AM