Hi All.

A patch to BasePeer.java (both t2 and torque) is attached.  It's a
response to a thread from turbine-user which is quoted below.  I'd
appreciate your review before I commit 'em.


BasePeer calls string.indexOf('.') in various places to parse column
names of the TABLE.COLUMN form.  But the User object builds Criteria
objects with COLUMN.  This causes StringIndexOutOfBoundsExceptions
when performing various operations on Users.  This patch adds checks
for the assumption that the column names are TABLE.COLUMN and throws
exceptions if that is not the case.

Specific questions for your review:  is Exception the right exception
to be throwing in this case?  This patch does not log the exception,
should it?

Thanks for taking a look.
-Eric


Attachment: t2-BasePeer.patch
Description: Binary data

Attachment: torque-BasePeer.patch
Description: Binary data




On Tuesday, February 19, 2002, at 11:50  AM, Will Glass-Husain wrote:

> Bug report--
>
> Without using the full column name (as above), I was getting an 
> exception on
> line 1030 of BasePeer:
>
>       java.lang.StringIndexOutOfBoundsException: String index out of 
> range: -1
>
> Looking at the code, BasePeer does
>       orderByColumn.indexOf('.')
>
> in a number of places without checking to see if the period actually 
> exists.
> Hence this problem.  This also occurs if you try to do other operations
> (e.g. a join) on the username.
>
>> -----Original Message-----
>> From: Kevin Rutherford [mailto:[EMAIL PROTECTED]]
>> Sent: Monday, February 18, 2002 11:19 AM
>> To: 'Turbine Users List'
>> Subject: RE: Sorting a list of users -- exception
>>
>>
>> I believe the problem is that addAscendingOrderByColumn() is
>> expecting a
>> full table/column name, but the User and UserPeer abstraction
>> classes do not
>> include the table name (intentionally, I think).

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to