title: Date parsing problem with Jackson 1.8.5
body: <p>Recently (in the last couple hours or so) I started getting this exception stack:</p>
  
  <pre><code>org.codehaus.jackson.JsonParseException: Numeric value (1316835995324) out of range of int
   at [Source: java.io.StringReader@5b082d45; line: 1, column: 642]
      at org.codehaus.jackson.JsonParser._constructError(JsonParser.java:1291)
      at org.codehaus.jackson.impl.JsonParserMinimalBase._reportError(JsonParserMinimalBase.java:385)
      at org.codehaus.jackson.impl.JsonNumericParserBase.convertNumberToInt(JsonNumericParserBase.java:462)
      at org.codehaus.jackson.impl.JsonNumericParserBase.getIntValue(JsonNumericParserBase.java:257)
      at org.codehaus.jackson.map.deser.StdDeserializer._parseInteger(StdDeserializer.java:237)
      at org.codehaus.jackson.map.deser.StdDeserializer$IntegerDeserializer.deserialize(StdDeserializer.java:838)
      at org.codehaus.jackson.map.deser.StdDeserializer$IntegerDeserializer.deserialize(StdDeserializer.java:825)
      at org.codehaus.jackson.map.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:252)
      at org.codehaus.jackson.map.deser.SettableBeanProperty$MethodProperty.deserializeAndSet(SettableBeanProperty.java:356)
      at org.codehaus.jackson.map.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:494)
      at org.codehaus.jackson.map.deser.BeanDeserializer.deserialize(BeanDeserializer.java:350)
      at org.codehaus.jackson.map.deser.CollectionDeserializer.deserialize(CollectionDeserializer.java:120)
      at org.codehaus.jackson.map.deser.CollectionDeserializer.deserialize(CollectionDeserializer.java:97)
      at org.codehaus.jackson.map.deser.CollectionDeserializer.deserialize(CollectionDeserializer.java:26)
      at org.codehaus.jackson.map.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:252)
      at org.codehaus.jackson.map.deser.SettableBeanProperty$FieldProperty.deserializeAndSet(SettableBeanProperty.java:499)
      at org.codehaus.jackson.map.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:494)
      at org.codehaus.jackson.map.deser.BeanDeserializer.deserialize(BeanDeserializer.java:350)
      at org.codehaus.jackson.map.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:252)
      at org.codehaus.jackson.map.deser.SettableBeanProperty$FieldProperty.deserializeAndSet(SettableBeanProperty.java:499)
      at org.codehaus.jackson.map.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:494)
      at org.codehaus.jackson.map.deser.BeanDeserializer.deserialize(BeanDeserializer.java:350)
      at org.codehaus.jackson.map.deser.CollectionDeserializer.deserialize(CollectionDeserializer.java:120)
      at org.codehaus.jackson.map.deser.CollectionDeserializer.deserialize(CollectionDeserializer.java:97)
      at org.codehaus.jackson.map.deser.CollectionDeserializer.deserialize(CollectionDeserializer.java:26)
      at org.codehaus.jackson.map.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:252)
      at org.codehaus.jackson.map.deser.SettableBeanProperty$FieldProperty.deserializeAndSet(SettableBeanProperty.java:499)
      at org.codehaus.jackson.map.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:494)
      at org.codehaus.jackson.map.deser.BeanDeserializer.deserialize(BeanDeserializer.java:350)
      at org.codehaus.jackson.map.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:252)
      at org.codehaus.jackson.map.deser.SettableBeanProperty$FieldProperty.deserializeAndSet(SettableBeanProperty.java:499)
      at org.codehaus.jackson.map.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:494)
      at org.codehaus.jackson.map.deser.BeanDeserializer.deserialize(BeanDeserializer.java:350)
      at org.codehaus.jackson.map.deser.CollectionDeserializer.deserialize(CollectionDeserializer.java:120)
      at org.codehaus.jackson.map.deser.CollectionDeserializer.deserialize(CollectionDeserializer.java:97)
      at org.codehaus.jackson.map.deser.CollectionDeserializer.deserialize(CollectionDeserializer.java:26)
      at org.codehaus.jackson.map.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:252)
      at org.codehaus.jackson.map.deser.SettableBeanProperty$FieldProperty.deserializeAndSet(SettableBeanProperty.java:499)
      at org.codehaus.jackson.map.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:494)
      at org.codehaus.jackson.map.deser.BeanDeserializer.deserialize(BeanDeserializer.java:350)
      at org.codehaus.jackson.map.ObjectReader._bindAndClose(ObjectReader.java:477)
      at org.codehaus.jackson.map.ObjectReader.readValue(ObjectReader.java:253)
  </code></pre>
  
  <p>This is happening while deserializing a <code>java.util.Date</code>. The interesing part is that there are other similar <code>Date</code>s in the input stream before this one and they do not cause any problems. In addition, I did not change the fields of the object that is being serialized and deserialized.</p>
  
  <p>Does anyone have any idea why Jackson is trying to deserialize this particular <code>Date</code> value into an <code>int</code> (and not into a <code>long</code>)?</p>
  
  <p>Thanks in advance for any insight.</p>
  
  <p>EDIT: I debugged this a little and it looks like this is the first <code>Date</code> that Jackson is trying to process, even though it still comes later in the stream. I also saw that Jackson is trying to force this number into an <code>int</code>, even though earlier in the processing it is detected properly as a <code>long</code>.</p>
  
  <p>EDIT 2: I debugged this more and figured out the following: Serialization/deserialization works fine as long as I do not have a setter that takes an input parameter, like this:</p>
  
  <pre><code>public void setSomeValue(int param)
  {
      // stuff
      this.date = &lt;result_value&gt;
  }
  </code></pre>
  
  <p>The moment I introduce this setter, Jackson executes a different code path and ends up in the block where it tries to put a <code>long</code> (the <code>java.util.Date</code>) into an <code>int</code>.</p>
  
  <p>EDIT 3: Changing the setter name to something unrelated to the field name works around the problem. I would still prefer to know if the original way is working as intended (if so, what is the idea behind it) or a bug.</p>