Kristian Waagan <[EMAIL PROTECTED]> writes:
> Hello,
>
> While fiddling around in the source code, I came across the following
> piece of code in iapi.types.SQLChar:
>
> protected void copyState(SQLChar other) {
>
> this.value = other.value;
> this.rawData = other.rawData;
> this.rawLength = other.rawLength;
> this.cKey = other.cKey;
> this.stream = other.stream;
> this.intArray = intArray;
> this.intLength = intLength;
> this.localeFinder = localeFinder;
> }
>
>
> Note that the three last assignments are assignments to self.
> Is this a bug, or is it intentional?
I don't know if it's intentional, but the last three variables will be
derived from the other variables or the context if they haven't been
initialized, so I don't think it's a bug. Since the method seems to be
used to create a string value with territory-based collation from a
string value with UCS_BASIC collation, and intArray contains the
collation elements, I think it would be wrong to copy intArray and
intLength. I think it would be OK to copy localeFinder, but it's not
required since getLocaleFinder() will get it from the DatabaseContext if
it is null.
> If it is intentional, my opinion is that the lines should be deleted
> and replaced by a comment (or at least commented out and be
> accompanied by a suitable text comment).
+1
--
Knut Anders