Browsing 7239 questions and answers with Jon Skeet
Why does the compiled code on assembly 2 change based on a method signature that (at least I think) should be transparent? No, it shouldn't. When you don't specify an argument to correspond with an optional parameter, the default... more 4/8/2015 7:20:04 PM
After this loop: while(width>=1) width is clearly 0 or less. Next you do: int specialWidth = width-2; So specialWidth is -2 or less. You then have: while(specialWidth>=1) How would you expect to ever enter that loop? What... more 4/8/2015 5:01:32 PM
Assuming you're doing all of this in multiple threads, no, it's not thread-safe. Ignore the fact that you've accessed the TreeMap via a ConcurrentHashMap - you end up with multiple threads accessing the TreeMap at the same time, including... more 4/8/2015 12:30:09 PM
This is the problem: public class System You're creating your own class called System, so when you later use: System.out.println that's looking in your System class rather than java.lang.System. Options: Change the name of your... more 4/8/2015 12:16:32 PM
You're right: that's not what the reflection API is for. You could write code to use the reflection API to generate the "stub" of a class, e.g. the class declaration, the method declarations (etc) - but you shouldn't expect it to generate... more 4/8/2015 9:24:53 AM
This has nothing to do with putting the method in a map, as far as I can tell - you can remove the map part entirely and still face the same issue: Dog d = new Dog(); Method methods = d.getClass().getMethods(); Method a =... more 4/7/2015 8:57:24 PM
This: {edbff2886c8ca7aa1bd02b092aa03930.zip=T001.zip} isn't valid JSON to start with. You'd need quotes around the field name and the value. However, even that wouldn't be enough. From the MongoDB documentation: Field names cannot... more 4/7/2015 1:50:47 PM
I don't modify anything Yes you do - your MoveNext() modifies the state of the class. This is why you shouldn't implement both IEnumerable and IEnumerator in the same class. (The C# compiler does for iterator blocks, but that's a... more 4/7/2015 1:25:24 PM
The problem I keep having is that it says java.lang.ArrayIndexOutOfBoundsException: 165 165 is the number of values it should actually contain. Right - then index 165 is out of bounds. Arrays in Java are 0-based, so if an array... more 4/7/2015 10:52:40 AM
Even without DST changes, you can observe DateTime.Now.Ticks returning the same value multiple times, due to the granularity of the system clock. But with DST changing, if you use DateTime.Now, you will indeed see the same values... more 4/7/2015 10:11:55 AM