Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 68531 invoked from network); 6 Nov 2008 22:16:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Nov 2008 22:16:18 -0000 Received: (qmail 54584 invoked by uid 500); 6 Nov 2008 22:16:24 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 54561 invoked by uid 500); 6 Nov 2008 22:16:24 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 54550 invoked by uid 99); 6 Nov 2008 22:16:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Nov 2008 14:16:24 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Nov 2008 22:15:03 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 4F5EC234C280 for ; Thu, 6 Nov 2008 14:15:45 -0800 (PST) Message-ID: <1433908022.1226009745323.JavaMail.jira@brutus> Date: Thu, 6 Nov 2008 14:15:45 -0800 (PST) From: "Myrna van Lunteren (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-1256) Remove usage of non-portable methods in derby code In-Reply-To: <82055298.1146076142966.JavaMail.root@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DERBY-1256?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12645602#action_12645602 ] Myrna van Lunteren commented on DERBY-1256: ------------------------------------------- I just noticed that org.apache.derbyTesting.functionTests.test.replicationTests.ReplicationRun, which is inherited by a number of the replication tests, uses InputStreamReader(InputStream). (e.g. processOutput). Not sure it's ok in this case and I can't verify this running ok with other encodings right now, but it should get checked into. > Remove usage of non-portable methods in derby code > -------------------------------------------------- > > Key: DERBY-1256 > URL: https://issues.apache.org/jira/browse/DERBY-1256 > Project: Derby > Issue Type: Bug > Components: Network Server, SQL, Store, Test > Reporter: Sunitha Kambhampati > > Remove usage of non portable methods that use native encoding as they could potentially lead 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. > I went through the classes in java.io package in jdk1.4.2 and have come up with a list of methods, constructors in the java.io.* classes that use native encoding and did a java search on eclipse for the code in java/engine, java/testing, java/drda, java/client. > 1)ByteArrayOutputStream.toString() > testing - DerbyNetNewServer: > System.out.println( bos.toString()); > server- NetworkServerCtrlInfo.getCLSSysInfo, getNetSysInfo, > 2)DataInputStream.readLine() > ArrayInputStream - org.apache.derby.iapi.services.io - java/engine > readLine() > CorruptRandomAccessFile - org.apache.derbyTesting.functionTests.util.corruptio - java/testing > readLine() > 3)InputStreamReader(InputStream) > StatementDuration - org.apache.derby.diag - java/engine - > next() > ImportReadData - org.apache.derby.impl.load - java/engine - > realOpenFile() > ErrorLogReader - org.apache.derby.diag - java/engine - > next() > UCode_CharStream - org.apache.derby.impl.sql.compile - java/engine - > ReInit(InputStream, int, int, int) > xmlBinding - org.apache.derbyTesting.functionTests.tests.lang - java/testing - > insertDocWithDTD(Connection, String, String, String, int) > BaseMonitor - org.apache.derby.impl.services.monitor - java/engine - > dumpTempWriter(boolean) > DbFile - org.apache.derbyTesting.functionTests.util - java/testing - > stringFromFile(InputStream) > HandleResult - org.apache.derbyTesting.functionTests.harness - java/testing - > handleResult(int, InputStream, InputStream, PrintWriter, String) (2 matches) > ProcessStreamResult - org.apache.derbyTesting.functionTests.harness - java/testing - > run() > FileCompare - org.apache.derbyTesting.functionTests.harness - java/testing - > doSysDiff(InputStream, String, String, File, PrintWriter) > exec(String, File, PrintWriter, String, String, String, int, boolean, boolean, String, String, String) > UCode_CharStream(InputStream, int, int, int) > insertFiles(Connection, String, String, int) (2 matches) > 4) OuputStreamWriter(OutputStream) > ExportWriteData - org.apache.derby.impl.load - java/engine > openFile() > ProcessStreamResult - org.apache.derbyTesting.functionTests.harness - java/testing > ProcessStreamResult(InputStream, BufferedOutputStream, String, String) > RawStore - org.apache.derby.impl.store.raw - java/engine > run() > 5) RandomAccessFile.readLine() > ArrayInputStream - org.apache.derby.iapi.services.io - java/engine - > readLine() > CorruptRandomAccessFile - org.apache.derbyTesting.functionTests.util.corruptio - java/testing - > readLine() > DerbyNetAutoStart - org.apache.derbyTesting.functionTests.tests.derbynet - java/testing - > checkLog(RandomAccessFile, String[]) > PrintStream and PrintWriter , print methods uses platforms default charset encoding. > ============= > There are also non portable methods in String class > new String(byte[]) > new String(byte[],int,int) > String.getBytes(). There are jira entries already for these- DERBY-900, DERBY-901,DERBY-902,DERBY-903. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.