You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by Ken Krugler <ke...@krugler.org> on 2010/08/11 01:24:22 UTC

Re: MediaType.getParameters return type

Hi Tika developers,

On Jul 15, 2010, at 2:59pm, Ken Krugler wrote:

> We ran into an issue recently, where some Bixo code built against  
> Tika 0.7 broke when we tried to use it with Tika 0.8
>
> The problem is that MediaType.getParameters was changed to return a  
> SortedMap versus a Map, so the routine that Bixo is trying to call  
> doesn't exist. We could fix this by building two different versions  
> of Bixo, one for Tika 0.7 and one for Tika 0.8 (snapshot), but  
> that's a bit painful.
>
> I didn't see any callers of getParameters() that depended on keys  
> being in sorted order, so I'm curious why this change was made.

I haven't heard anything back on this, so I'll open an issue to change  
the code to (once again) return just a regular Map vs. a SortedMap.

Thanks,

-- Ken

--------------------------------------------
<http://ken-blog.krugler.org>
+1 530-265-2225





Re: MediaType.getParameters return type

Posted by Ken Krugler <kk...@transpac.com>.
Thanks Jukka!

-- Ken

On Aug 11, 2010, at 1:07am, Jukka Zitting wrote:

> Hi,
>
> On Wed, Aug 11, 2010 at 9:53 AM, Jukka Zitting <jukka.zitting@gmail.com 
> > wrote:
>> I also changed the return type of getParameters() to give a better
>> hint of the kind of map that was being returned. I didn't realize  
>> that
>> this breaks binary compatibility of the method, so it's obviously a
>> good idea to change the return type back to a Map and perhaps add a
>> note in the javadoc that the returned map is guaranteed to be sorted.
>
> Done in revision 984321.
>
> BR,
>
> Jukka Zitting

--------------------------------------------
Ken Krugler
+1 530-210-6378
http://bixolabs.com
e l a s t i c   w e b   m i n i n g





Re: MediaType.getParameters return type

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On Wed, Aug 11, 2010 at 9:53 AM, Jukka Zitting <ju...@gmail.com> wrote:
> I also changed the return type of getParameters() to give a better
> hint of the kind of map that was being returned. I didn't realize that
> this breaks binary compatibility of the method, so it's obviously a
> good idea to change the return type back to a Map and perhaps add a
> note in the javadoc that the returned map is guaranteed to be sorted.

Done in revision 984321.

BR,

Jukka Zitting

Re: MediaType.getParameters return type

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On Wed, Aug 11, 2010 at 5:05 AM, Mattmann, Chris A (388J)
<ch...@jpl.nasa.gov> wrote:
> Thanks Ken. Jukka, WDYT?

Yeah, sorry for not reacting to this earlier (I was on vacation in
July and didn't pay too much attention to email).

The internal parameter map inside MediaType is a SortedMap for
increased consistency when accessing the parameters (no need to worry
about the ordering). In revision 956017 I made that map unmodifiable
to better enforce the immutable nature of MediaType.

I also changed the return type of getParameters() to give a better
hint of the kind of map that was being returned. I didn't realize that
this breaks binary compatibility of the method, so it's obviously a
good idea to change the return type back to a Map and perhaps add a
note in the javadoc that the returned map is guaranteed to be sorted.

BR,

Jukka Zitting

Re: MediaType.getParameters return type

Posted by "Mattmann, Chris A (388J)" <ch...@jpl.nasa.gov>.
Thanks Ken. Jukka, WDYT?

Cheers,
Chris


On 8/10/10 7:58 PM, "Ken Krugler" <kk...@transpac.com> wrote:



On Aug 10, 2010, at 7:53pm, Mattmann, Chris A (388J) wrote:

> Hi Ken,
>
> No objection from me. Do you know who it was that changed it to use
> a SortedMap?

Looks like Jukka (rev 956017 on June 18th, 2010) for TIKA-89.

-- Ken

> On 8/10/10 4:24 PM, "Ken Krugler" <ke...@krugler.org> wrote:
>
> Hi Tika developers,
>
> On Jul 15, 2010, at 2:59pm, Ken Krugler wrote:
>
>> We ran into an issue recently, where some Bixo code built against
>> Tika 0.7 broke when we tried to use it with Tika 0.8
>>
>> The problem is that MediaType.getParameters was changed to return a
>> SortedMap versus a Map, so the routine that Bixo is trying to call
>> doesn't exist. We could fix this by building two different versions
>> of Bixo, one for Tika 0.7 and one for Tika 0.8 (snapshot), but
>> that's a bit painful.
>>
>> I didn't see any callers of getParameters() that depended on keys
>> being in sorted order, so I'm curious why this change was made.
>
> I haven't heard anything back on this, so I'll open an issue to change
> the code to (once again) return just a regular Map vs. a SortedMap.
>
> Thanks,
>
> -- Ken

--------------------------------------------
Ken Krugler
+1 530-210-6378
http://bixolabs.com
e l a s t i c   w e b   m i n i n g







++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Chris Mattmann, Ph.D.
Senior Computer Scientist
NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
Office: 171-266B, Mailstop: 171-246
Email: Chris.Mattmann@jpl.nasa.gov
WWW:   http://sunset.usc.edu/~mattmann/
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adjunct Assistant Professor, Computer Science Department
University of Southern California, Los Angeles, CA 90089 USA
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


Re: MediaType.getParameters return type

Posted by Ken Krugler <kk...@transpac.com>.
On Aug 10, 2010, at 7:53pm, Mattmann, Chris A (388J) wrote:

> Hi Ken,
>
> No objection from me. Do you know who it was that changed it to use  
> a SortedMap?

Looks like Jukka (rev 956017 on June 18th, 2010) for TIKA-89.

-- Ken

> On 8/10/10 4:24 PM, "Ken Krugler" <ke...@krugler.org> wrote:
>
> Hi Tika developers,
>
> On Jul 15, 2010, at 2:59pm, Ken Krugler wrote:
>
>> We ran into an issue recently, where some Bixo code built against
>> Tika 0.7 broke when we tried to use it with Tika 0.8
>>
>> The problem is that MediaType.getParameters was changed to return a
>> SortedMap versus a Map, so the routine that Bixo is trying to call
>> doesn't exist. We could fix this by building two different versions
>> of Bixo, one for Tika 0.7 and one for Tika 0.8 (snapshot), but
>> that's a bit painful.
>>
>> I didn't see any callers of getParameters() that depended on keys
>> being in sorted order, so I'm curious why this change was made.
>
> I haven't heard anything back on this, so I'll open an issue to change
> the code to (once again) return just a regular Map vs. a SortedMap.
>
> Thanks,
>
> -- Ken

--------------------------------------------
Ken Krugler
+1 530-210-6378
http://bixolabs.com
e l a s t i c   w e b   m i n i n g





Re: MediaType.getParameters return type

Posted by "Mattmann, Chris A (388J)" <ch...@jpl.nasa.gov>.
Hi Ken,

No objection from me. Do you know who it was that changed it to use a SortedMap?

Cheers,
Chris


On 8/10/10 4:24 PM, "Ken Krugler" <ke...@krugler.org> wrote:

Hi Tika developers,

On Jul 15, 2010, at 2:59pm, Ken Krugler wrote:

> We ran into an issue recently, where some Bixo code built against
> Tika 0.7 broke when we tried to use it with Tika 0.8
>
> The problem is that MediaType.getParameters was changed to return a
> SortedMap versus a Map, so the routine that Bixo is trying to call
> doesn't exist. We could fix this by building two different versions
> of Bixo, one for Tika 0.7 and one for Tika 0.8 (snapshot), but
> that's a bit painful.
>
> I didn't see any callers of getParameters() that depended on keys
> being in sorted order, so I'm curious why this change was made.

I haven't heard anything back on this, so I'll open an issue to change
the code to (once again) return just a regular Map vs. a SortedMap.

Thanks,

-- Ken

--------------------------------------------
<http://ken-blog.krugler.org>
+1 530-265-2225







++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Chris Mattmann, Ph.D.
Senior Computer Scientist
NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
Office: 171-266B, Mailstop: 171-246
Email: Chris.Mattmann@jpl.nasa.gov
WWW:   http://sunset.usc.edu/~mattmann/
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adjunct Assistant Professor, Computer Science Department
University of Southern California, Los Angeles, CA 90089 USA
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++