Browsing 7239 questions and answers with Jon Skeet
It's not a matter of just changing access specifier - you might change everything about the internal representation. Suppose you have three byte values as part of the state of your object. You could store them in a single int field, or... more 1/17/2015 11:22:29 AM
You can call the static Nullable.Equals method: bool isEqual = Nullable.Equals(a, b); more 1/16/2015 10:43:49 PM
You're doing far more than you need to. Personally I'd use my Noda Time project, but all of this can be done fairly easily with the BCL, using TimeZoneInfo.ConvertTime: var zone = TimeZoneInfo.FindSystemTimeZoneById("Central Standard... more 1/16/2015 9:10:08 PM
Yes - you just need to format when you print out. Currently you're just using the default toString() representation. If you're happy with the formatter you've already got, you can just use: System.out.println("LocalTime: " +... more 1/16/2015 5:33:18 PM
You should be able to just cast to ParameterizedType: Type type = field.getGenericType(); if (type instanceof ParameterizedType) { ParamterizedType pt = (ParameterizedType) type; if (pt.getRawType() == List.class && ... more 1/16/2015 5:25:15 PM
This is the problem: ....ForEach(Modify).Dump ForEach returns void. You could rewrite it as: var list = Claims.AsEnumerable() .Select((claim, no) => Populate(claim, no)) ... more 1/16/2015 4:15:36 PM
This is the problem: public EnsureCodeCoverageAwaiter<T> GetAwaiter<T>() You don't want that to be a generic method introducing a new type parameter T - you just want to use the type parameter of the type. So you... more 1/16/2015 3:14:25 PM
Two options to get to a TimeSpan: 1) Parse it as a DateTime (specifying a format), then use DateTime.TimeOfDay to get a TimeSpan var dt = DateTime.ParseExact( "14:21:34", @"HH\:mm\:ss", ... more 1/16/2015 2:37:42 PM
Yes - you can call Class.getGenericInterfaces(), which returns a Type[]. That includes type argument information. Complete example: import java.lang.reflect.Type; interface Notifier<T> { } class Foo implements... more 1/16/2015 1:57:06 PM
I don't believe it's a valid ISO-8601 (or RFC 3339) format, which is what's usually used for web services - that only appears to include time zone offsets when a time is specified as well. However, as noted in comments, it is a valid XML... more 1/16/2015 1:10:40 PM