You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Daniel John Debrunner (JIRA)" <de...@db.apache.org> on 2006/01/31 22:01:32 UTC

[jira] Created: (DERBY-902) Remove use of String(byte[]) and String(byte[], int, int) constructors in engine leading to non-portable behaviour

Remove use of String(byte[]) and String(byte[], int, int) constructors in engine leading to non-portable behaviour
------------------------------------------------------------------------------------------------------------------

         Key: DERBY-902
         URL: http://issues.apache.org/jira/browse/DERBY-902
     Project: Derby
        Type: Bug
  Components: Network Server  
    Reporter: Daniel John Debrunner
     Fix For: 10.2.0.0


These constructors use the Java default platform encoding to convert the bytes to a String, this typically leads to bugs on platforms with different encodings.

Replace with code using fixed conversion, or alternative mechanisms. 
If the call is required its use should be commented as to why it is required.

org.apache.derby.catalog.SystemProcedures

I generated this list using the Java search in eclipse for references to the constructors
String(byte[])
String(byte[],int,int) - no occurrrences in java/engine

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Re: [jira] Commented: (DERBY-902) Remove use of String(byte[]) and String(byte[], int, int) constructors in engine leading to non-portable behaviour

Posted by Myrna van Lunteren <m....@gmail.com>.
I was just composing a comment when JIRA took a breather.

This is what I wanted to say:
I've looked into this (and experimented) a bit more.

This string is only ever used within NetworkServer, so I don't see how it
could be a problem in other encodings, or am I missing something in my
understanding of how this works?

It seems to me it does not matter much what the content of the String in
question is, as long as it
1. is identical to what's assigned to SQLERRMC_MESSAGE_DELIMITER  in
java/drda/org/apache/derby/impl/drda/DRDAConnThread
2. is short (comments in DRDAConnThread indicate CCC can only handle up to
70 characters of errors concatenated with this string)
3. can never be found in any error messages.

So, there are 2 alternatives:
1. leave the string as is, and add a comment indicating it's only used
internally in network server.
2. replace the string with something else, in both classes, for instance,
      String errSeparator=":;:"

Please advise, I can make another patch with whichever alternative is
preferred.

Myrna


On 2/13/06, Daniel John Debrunner (JIRA) <de...@db.apache.org> wrote:
>
>    [
> http://issues.apache.org/jira/browse/DERBY-902?page=comments#action_12366266]
>
> Daniel John Debrunner commented on DERBY-902:
> ---------------------------------------------
>
> Thanks Kathey for pointing that out, I was wrong, I saw the
>
> byte[] b = {20, 20, 20};
>
> and I mentally assumed they were 0x20, which would correspond to the space
> character.
>
> > Remove use of String(byte[]) and String(byte[], int, int) constructors
> in engine leading to non-portable behaviour
> >
> ------------------------------------------------------------------------------------------------------------------
> >
> >          Key: DERBY-902
> >          URL: http://issues.apache.org/jira/browse/DERBY-902
> >      Project: Derby
> >         Type: Bug
> >   Components: Network Server
> >     Reporter: Daniel John Debrunner
> >      Fix For: 10.2.0.0
> >  Attachments: DERBY-902_021306.stat, DERBY-902_021306_2.diff
> >
> > These constructors use the Java default platform encoding to convert the
> bytes to a String, this typically leads to bugs on platforms with different
> encodings.
> > Replace with code using fixed conversion, or alternative mechanisms.
> > If the call is required its use should be commented as to why it is
> required.
> > org.apache.derby.catalog.SystemProcedures
> > I generated this list using the Java search in eclipse for references to
> the constructors
> > String(byte[])
> > String(byte[],int,int) - no occurrrences in java/engine
>
> --
> This message is automatically generated by JIRA.
> -
> If you think it was sent incorrectly contact one of the administrators:
>   http://issues.apache.org/jira/secure/Administrators.jspa
> -
> For more information on JIRA, see:
>   http://www.atlassian.com/software/jira
>
>

Re: [jira] Commented: (DERBY-902) Remove use of String(byte[]) and String(byte[], int, int) constructors in engine leading to non-portable behaviour

Posted by Myrna van Lunteren <m....@gmail.com>.
Hi

Thx Dan, for making me double check...

I'll have another look.

Myrna


On 2/16/06, Kathey Marsden (JIRA) <de...@db.apache.org> wrote:
>
>    [
> http://issues.apache.org/jira/browse/DERBY-902?page=comments#action_12366733]
>
> Kathey Marsden commented on DERBY-902:
> --------------------------------------
>
> As I recall, the way this works is that the contents of the String do make
> it across the wire to the client, but the client just passes the contents
> back as a parameter to the SQLCAMESSAGE stored procedure, so the client
> itself does not know what the separation characters are.   (I think )
>
> Also note there are two different kinds of separators, one to separate the
> message tokens and one to separate the messages if there are multiple
> SQLExceptions.
>
> These separators have  all caused a fair amount of pain over time.  I
> think that it would be good to have  an analysis of what the situation is
> and our options for th   network server Exception handling in general in the
> context of what DRDA currently has to offer.
>
> For the patch, I am not confident that US-ASCII is the right thing
> here.    I don't fully understand the impact of option 2 either, to change
> it to ";:" .  Well,  this is an awfully long post to just still say I always
> have been and remain rather confused on this issue.   It would be a good
> first step to research and document how this all works now.
>
>
>
> > Remove use of String(byte[]) and String(byte[], int, int) constructors
> in engine leading to non-portable behaviour
> >
> ------------------------------------------------------------------------------------------------------------------
> >
> >          Key: DERBY-902
> >          URL: http://issues.apache.org/jira/browse/DERBY-902
> >      Project: Derby
> >         Type: Bug
> >   Components: Network Server
> >     Reporter: Daniel John Debrunner
> >      Fix For: 10.2.0.0
> >  Attachments: DERBY-902_021306.stat, DERBY-902_021306_2.diff
> >
> > These constructors use the Java default platform encoding to convert the
> bytes to a String, this typically leads to bugs on platforms with different
> encodings.
> > Replace with code using fixed conversion, or alternative mechanisms.
> > If the call is required its use should be commented as to why it is
> required.
> > org.apache.derby.catalog.SystemProcedures
> > I generated this list using the Java search in eclipse for references to
> the constructors
> > String(byte[])
> > String(byte[],int,int) - no occurrrences in java/engine
>
> --
> This message is automatically generated by JIRA.
> -
> If you think it was sent incorrectly contact one of the administrators:
>   http://issues.apache.org/jira/secure/Administrators.jspa
> -
> For more information on JIRA, see:
>   http://www.atlassian.com/software/jira
>
>

[jira] Commented: (DERBY-902) Remove use of String(byte[]) and String(byte[], int, int) constructors in engine leading to non-portable behaviour

Posted by "Myrna van Lunteren (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-902?page=comments#action_12366679 ] 

Myrna van Lunteren commented on DERBY-902:
------------------------------------------

The String errSeparator in class SystemProcedures is only ever used within NetworkServer, so I don't see how it could be a problem in other encodings, or am I missing something in my understanding of how this works?
 
It seems to me it does not matter much what the content of the String in question is, as long as it 
1. is identical to what's assigned to SQLERRMC_MESSAGE_DELIMITER  in java/drda/org/apache/derby/impl/drda/DRDAConnThread
2. is short (comments in DRDAConnThread indicate CCC can only handle up to 70 characters of errors concatenated with this string)  
3. can never be found in any error messages.
 
So, there are 2 alternatives:
1. leave the string as is, and add a comment indicating it's only used internally in network server.
2. replace the string with something else, in both classes, for instance, 
      String errSeparator=":;:"
 
Please advise, I can make another patch with whichever alternative is preferred. I am going back-and-forth between the two.


> Remove use of String(byte[]) and String(byte[], int, int) constructors in engine leading to non-portable behaviour
> ------------------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-902
>          URL: http://issues.apache.org/jira/browse/DERBY-902
>      Project: Derby
>         Type: Bug
>   Components: Network Server
>     Reporter: Daniel John Debrunner
>      Fix For: 10.2.0.0
>  Attachments: DERBY-902_021306.stat, DERBY-902_021306_2.diff
>
> These constructors use the Java default platform encoding to convert the bytes to a String, this typically leads to bugs on platforms with different encodings.
> Replace with code using fixed conversion, or alternative mechanisms. 
> If the call is required its use should be commented as to why it is required.
> org.apache.derby.catalog.SystemProcedures
> I generated this list using the Java search in eclipse for references to the constructors
> String(byte[])
> String(byte[],int,int) - no occurrrences in java/engine

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-902) Remove use of String(byte[]) and String(byte[], int, int) constructors in engine leading to non-portable behaviour

Posted by "Daniel John Debrunner (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-902?page=comments#action_12366690 ] 

Daniel John Debrunner commented on DERBY-902:
---------------------------------------------

I'm not sure what comment you are reacting to, but my point was that there is no need to use String.getBytes()  to generate the String we need and thus have to throw a UnsupportedEncoding exception.

The string created with the ascii encoding is the same as

char[] sepChars = { (char) 20, (char) 20, (char) 20};

new String(sepChars)

This is really the same as both your options, or a combination of them :-)

If we don't like the use of these ASCII control characters then as you say it can be anything else.

Just to confirm, the contents of this String never make it across the wire to the client?

> Remove use of String(byte[]) and String(byte[], int, int) constructors in engine leading to non-portable behaviour
> ------------------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-902
>          URL: http://issues.apache.org/jira/browse/DERBY-902
>      Project: Derby
>         Type: Bug
>   Components: Network Server
>     Reporter: Daniel John Debrunner
>      Fix For: 10.2.0.0
>  Attachments: DERBY-902_021306.stat, DERBY-902_021306_2.diff
>
> These constructors use the Java default platform encoding to convert the bytes to a String, this typically leads to bugs on platforms with different encodings.
> Replace with code using fixed conversion, or alternative mechanisms. 
> If the call is required its use should be commented as to why it is required.
> org.apache.derby.catalog.SystemProcedures
> I generated this list using the Java search in eclipse for references to the constructors
> String(byte[])
> String(byte[],int,int) - no occurrrences in java/engine

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-902) Remove use of String(byte[]) and String(byte[], int, int) constructors in engine leading to non-portable behaviour

Posted by "Myrna van Lunteren (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-902?page=all ]

Myrna van Lunteren updated DERBY-902:
-------------------------------------

    Other Info:   (was: [Patch available])

On second thought, I'm not too certain the code does not actually make it to the client, or (if it does) cannot be influenced by encoding on the client. I'm not going to poke at this further at this time. I'm switching off the 'patch available'.

> Remove use of String(byte[]) and String(byte[], int, int) constructors in engine leading to non-portable behaviour
> ------------------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-902
>          URL: http://issues.apache.org/jira/browse/DERBY-902
>      Project: Derby
>         Type: Bug
>   Components: Network Server
>     Reporter: Daniel John Debrunner
>      Fix For: 10.2.0.0
>  Attachments: DERBY-902_021306.stat, DERBY-902_021306_2.diff
>
> These constructors use the Java default platform encoding to convert the bytes to a String, this typically leads to bugs on platforms with different encodings.
> Replace with code using fixed conversion, or alternative mechanisms. 
> If the call is required its use should be commented as to why it is required.
> org.apache.derby.catalog.SystemProcedures
> I generated this list using the Java search in eclipse for references to the constructors
> String(byte[])
> String(byte[],int,int) - no occurrrences in java/engine

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-902) Remove use of String(byte[]) and String(byte[], int, int) constructors in engine leading to non-portable behaviour

Posted by "Kathey Marsden (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-902?page=comments#action_12366231 ] 

Kathey Marsden commented on DERBY-902:
--------------------------------------

I have to say. I never understood the way the error message token separators work.  This value seems to translate into that awful non ascii character that prints in error messages ala DERBY-285.



> Remove use of String(byte[]) and String(byte[], int, int) constructors in engine leading to non-portable behaviour
> ------------------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-902
>          URL: http://issues.apache.org/jira/browse/DERBY-902
>      Project: Derby
>         Type: Bug
>   Components: Network Server
>     Reporter: Daniel John Debrunner
>      Fix For: 10.2.0.0
>  Attachments: DERBY-902_021306.stat, DERBY-902_021306_2.diff
>
> These constructors use the Java default platform encoding to convert the bytes to a String, this typically leads to bugs on platforms with different encodings.
> Replace with code using fixed conversion, or alternative mechanisms. 
> If the call is required its use should be commented as to why it is required.
> org.apache.derby.catalog.SystemProcedures
> I generated this list using the Java search in eclipse for references to the constructors
> String(byte[])
> String(byte[],int,int) - no occurrrences in java/engine

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Reopened: (DERBY-902) Remove use of String(byte[]) and String(byte[], int, int) constructors in engine leading to non-portable behaviour

Posted by "Andrew McIntyre (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-902?page=all ]
     
Andrew McIntyre reopened DERBY-902:
-----------------------------------


> Remove use of String(byte[]) and String(byte[], int, int) constructors in engine leading to non-portable behaviour
> ------------------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-902
>          URL: http://issues.apache.org/jira/browse/DERBY-902
>      Project: Derby
>         Type: Bug

>   Components: Network Server
>     Versions: 10.1.2.3
>     Reporter: Daniel John Debrunner
>      Fix For: 10.1.2.4, 10.1.3.0
>  Attachments: DERBY-902_021306.stat, DERBY-902_021306_2.diff
>
> These constructors use the Java default platform encoding to convert the bytes to a String, this typically leads to bugs on platforms with different encodings.
> Replace with code using fixed conversion, or alternative mechanisms. 
> If the call is required its use should be commented as to why it is required.
> org.apache.derby.catalog.SystemProcedures
> I generated this list using the Java search in eclipse for references to the constructors
> String(byte[])
> String(byte[],int,int) - no occurrrences in java/engine

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-902) Remove use of String(byte[]) and String(byte[], int, int) constructors in engine leading to non-portable behaviour

Posted by "Daniel John Debrunner (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-902?page=comments#action_12366220 ] 

Daniel John Debrunner commented on DERBY-902:
---------------------------------------------

A simpler patch is just to have a string constant of three spaces, since that is what the code does:

here's more context to the patch

 		byte[] b = {20, 20, 20};
-		String errSeparator = new String(b);
+		String errSeparator = new String(b, "US-ASCII");
 
Not sure the original code was so complex, it really is:

  String errSeparator = "   ";



> Remove use of String(byte[]) and String(byte[], int, int) constructors in engine leading to non-portable behaviour
> ------------------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-902
>          URL: http://issues.apache.org/jira/browse/DERBY-902
>      Project: Derby
>         Type: Bug
>   Components: Network Server
>     Reporter: Daniel John Debrunner
>      Fix For: 10.2.0.0
>  Attachments: DERBY-902_021306.stat, DERBY-902_021306_2.diff
>
> These constructors use the Java default platform encoding to convert the bytes to a String, this typically leads to bugs on platforms with different encodings.
> Replace with code using fixed conversion, or alternative mechanisms. 
> If the call is required its use should be commented as to why it is required.
> org.apache.derby.catalog.SystemProcedures
> I generated this list using the Java search in eclipse for references to the constructors
> String(byte[])
> String(byte[],int,int) - no occurrrences in java/engine

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-902) Remove use of String(byte[]) and String(byte[], int, int) constructors in engine leading to non-portable behaviour

Posted by "Kathey Marsden (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-902?page=comments#action_12366733 ] 

Kathey Marsden commented on DERBY-902:
--------------------------------------

As I recall, the way this works is that the contents of the String do make it across the wire to the client, but the client just passes the contents back as a parameter to the SQLCAMESSAGE stored procedure, so the client itself does not know what the separation characters are.   (I think )

Also note there are two different kinds of separators, one to separate the message tokens and one to separate the messages if there are multiple SQLExceptions.

These separators have  all caused a fair amount of pain over time.  I think that it would be good to have  an analysis of what the situation is and our options for th   network server Exception handling in general in the context of what DRDA currently has to offer. 

For the patch, I am not confident that US-ASCII is the right thing here.    I don't fully understand the impact of option 2 either, to change it to ";:" .  Well,  this is an awfully long post to just still say I always have been and remain rather confused on this issue.   It would be a good first step to research and document how this all works now.



> Remove use of String(byte[]) and String(byte[], int, int) constructors in engine leading to non-portable behaviour
> ------------------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-902
>          URL: http://issues.apache.org/jira/browse/DERBY-902
>      Project: Derby
>         Type: Bug
>   Components: Network Server
>     Reporter: Daniel John Debrunner
>      Fix For: 10.2.0.0
>  Attachments: DERBY-902_021306.stat, DERBY-902_021306_2.diff
>
> These constructors use the Java default platform encoding to convert the bytes to a String, this typically leads to bugs on platforms with different encodings.
> Replace with code using fixed conversion, or alternative mechanisms. 
> If the call is required its use should be commented as to why it is required.
> org.apache.derby.catalog.SystemProcedures
> I generated this list using the Java search in eclipse for references to the constructors
> String(byte[])
> String(byte[],int,int) - no occurrrences in java/engine

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-902) Remove use of String(byte[]) and String(byte[], int, int) constructors in engine leading to non-portable behaviour

Posted by "Myrna van Lunteren (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-902?page=all ]

Myrna van Lunteren updated DERBY-902:
-------------------------------------

    Version: 10.1.2.3

> Remove use of String(byte[]) and String(byte[], int, int) constructors in engine leading to non-portable behaviour
> ------------------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-902
>          URL: http://issues.apache.org/jira/browse/DERBY-902
>      Project: Derby
>         Type: Bug

>   Components: Network Server
>     Versions: 10.1.2.3
>     Reporter: Daniel John Debrunner
>      Fix For: 10.2.0.0
>  Attachments: DERBY-902_021306.stat, DERBY-902_021306_2.diff
>
> These constructors use the Java default platform encoding to convert the bytes to a String, this typically leads to bugs on platforms with different encodings.
> Replace with code using fixed conversion, or alternative mechanisms. 
> If the call is required its use should be commented as to why it is required.
> org.apache.derby.catalog.SystemProcedures
> I generated this list using the Java search in eclipse for references to the constructors
> String(byte[])
> String(byte[],int,int) - no occurrrences in java/engine

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-902) Remove use of String(byte[]) and String(byte[], int, int) constructors in engine leading to non-portable behaviour

Posted by "Myrna van Lunteren (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-902?page=all ]

Myrna van Lunteren updated DERBY-902:
-------------------------------------

    Other Info: [Patch available]

> Remove use of String(byte[]) and String(byte[], int, int) constructors in engine leading to non-portable behaviour
> ------------------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-902
>          URL: http://issues.apache.org/jira/browse/DERBY-902
>      Project: Derby
>         Type: Bug
>   Components: Network Server
>     Reporter: Daniel John Debrunner
>      Fix For: 10.2.0.0
>  Attachments: DERBY-902_021306.stat, DERBY-902_021306_2.diff
>
> These constructors use the Java default platform encoding to convert the bytes to a String, this typically leads to bugs on platforms with different encodings.
> Replace with code using fixed conversion, or alternative mechanisms. 
> If the call is required its use should be commented as to why it is required.
> org.apache.derby.catalog.SystemProcedures
> I generated this list using the Java search in eclipse for references to the constructors
> String(byte[])
> String(byte[],int,int) - no occurrrences in java/engine

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (DERBY-902) Remove use of String(byte[]) and String(byte[], int, int) constructors in engine leading to non-portable behaviour

Posted by "Myrna van Lunteren (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-902?page=all ]
     
Myrna van Lunteren closed DERBY-902:
------------------------------------

    Fix Version: 10.1.2.4
                     (was: 10.2.0.0)
     Resolution: Fixed

fixed in revision 394205 for main, and 394223 for 10.1with patch-1 for DERBY-901.

> Remove use of String(byte[]) and String(byte[], int, int) constructors in engine leading to non-portable behaviour
> ------------------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-902
>          URL: http://issues.apache.org/jira/browse/DERBY-902
>      Project: Derby
>         Type: Bug

>   Components: Network Server
>     Versions: 10.1.2.3
>     Reporter: Daniel John Debrunner
>      Fix For: 10.1.2.4
>  Attachments: DERBY-902_021306.stat, DERBY-902_021306_2.diff
>
> These constructors use the Java default platform encoding to convert the bytes to a String, this typically leads to bugs on platforms with different encodings.
> Replace with code using fixed conversion, or alternative mechanisms. 
> If the call is required its use should be commented as to why it is required.
> org.apache.derby.catalog.SystemProcedures
> I generated this list using the Java search in eclipse for references to the constructors
> String(byte[])
> String(byte[],int,int) - no occurrrences in java/engine

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-902) Remove use of String(byte[]) and String(byte[], int, int) constructors in engine leading to non-portable behaviour

Posted by "Daniel John Debrunner (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-902?page=comments#action_12366266 ] 

Daniel John Debrunner commented on DERBY-902:
---------------------------------------------

Thanks Kathey for pointing that out, I was wrong, I saw the

byte[] b = {20, 20, 20}; 

and I mentally assumed they were 0x20, which would correspond to the space character.

> Remove use of String(byte[]) and String(byte[], int, int) constructors in engine leading to non-portable behaviour
> ------------------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-902
>          URL: http://issues.apache.org/jira/browse/DERBY-902
>      Project: Derby
>         Type: Bug
>   Components: Network Server
>     Reporter: Daniel John Debrunner
>      Fix For: 10.2.0.0
>  Attachments: DERBY-902_021306.stat, DERBY-902_021306_2.diff
>
> These constructors use the Java default platform encoding to convert the bytes to a String, this typically leads to bugs on platforms with different encodings.
> Replace with code using fixed conversion, or alternative mechanisms. 
> If the call is required its use should be commented as to why it is required.
> org.apache.derby.catalog.SystemProcedures
> I generated this list using the Java search in eclipse for references to the constructors
> String(byte[])
> String(byte[],int,int) - no occurrrences in java/engine

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-902) Remove use of String(byte[]) and String(byte[], int, int) constructors in engine leading to non-portable behaviour

Posted by "Myrna van Lunteren (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-902?page=all ]

Myrna van Lunteren updated DERBY-902:
-------------------------------------

    Attachment: DERBY-902_021306.stat
                DERBY-902_021306_2.diff

I ran derbyall with jdk15 with insane jars with the changes of this patch, 
and in addition I needed it to ensure I had correctly fixed DERBY-903.

I would appreciate feedback on this patch.

changed:
-		String errSeparator = new String(b);
+		String errSeparator = new String(b, "US-ASCII");
 
which then needed the method to throw or handle an UnsupportedEncodingException, I made the
method throw it.


> Remove use of String(byte[]) and String(byte[], int, int) constructors in engine leading to non-portable behaviour
> ------------------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-902
>          URL: http://issues.apache.org/jira/browse/DERBY-902
>      Project: Derby
>         Type: Bug
>   Components: Network Server
>     Reporter: Daniel John Debrunner
>      Fix For: 10.2.0.0
>  Attachments: DERBY-902_021306.stat, DERBY-902_021306_2.diff
>
> These constructors use the Java default platform encoding to convert the bytes to a String, this typically leads to bugs on platforms with different encodings.
> Replace with code using fixed conversion, or alternative mechanisms. 
> If the call is required its use should be commented as to why it is required.
> org.apache.derby.catalog.SystemProcedures
> I generated this list using the Java search in eclipse for references to the constructors
> String(byte[])
> String(byte[],int,int) - no occurrrences in java/engine

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (DERBY-902) Remove use of String(byte[]) and String(byte[], int, int) constructors in engine leading to non-portable behaviour

Posted by "Andrew McIntyre (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-902?page=all ]
     
Andrew McIntyre closed DERBY-902:
---------------------------------

    Fix Version: 10.1.3.0
     Resolution: Fixed

> Remove use of String(byte[]) and String(byte[], int, int) constructors in engine leading to non-portable behaviour
> ------------------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-902
>          URL: http://issues.apache.org/jira/browse/DERBY-902
>      Project: Derby
>         Type: Bug

>   Components: Network Server
>     Versions: 10.1.2.3
>     Reporter: Daniel John Debrunner
>      Fix For: 10.1.2.4, 10.1.3.0
>  Attachments: DERBY-902_021306.stat, DERBY-902_021306_2.diff
>
> These constructors use the Java default platform encoding to convert the bytes to a String, this typically leads to bugs on platforms with different encodings.
> Replace with code using fixed conversion, or alternative mechanisms. 
> If the call is required its use should be commented as to why it is required.
> org.apache.derby.catalog.SystemProcedures
> I generated this list using the Java search in eclipse for references to the constructors
> String(byte[])
> String(byte[],int,int) - no occurrrences in java/engine

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira