Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 9364 invoked from network); 19 Jun 2006 11:15:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 19 Jun 2006 11:15:00 -0000 Received: (qmail 18711 invoked by uid 500); 19 Jun 2006 11:11:54 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 18567 invoked by uid 500); 19 Jun 2006 11:11:53 -0000 Mailing-List: contact harmony-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-commits@incubator.apache.org Received: (qmail 14075 invoked by uid 99); 19 Jun 2006 10:11:52 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Jun 2006 03:11:52 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Jun 2006 03:11:51 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 9D031410006 for ; Mon, 19 Jun 2006 10:10:30 +0000 (GMT) Message-ID: <28958244.1150711830640.JavaMail.jira@brutus> Date: Mon, 19 Jun 2006 10:10:30 +0000 (GMT+00:00) From: "Paulex Yang (JIRA)" To: harmony-commits@incubator.apache.org Subject: [jira] Commented: (HARMONY-618) [classlib][nio]java.nio.channels.nio.SelectorProvider should not use thread's context classloader to load provider class defined in property file In-Reply-To: <9108812.1150703849770.JavaMail.jira@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 X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/HARMONY-618?page=comments#action_12416730 ] Paulex Yang commented on HARMONY-618: ------------------------------------- looks fine, thank you, Tim. > [classlib][nio]java.nio.channels.nio.SelectorProvider should not use thread's context classloader to load provider class defined in property file > ------------------------------------------------------------------------------------------------------------------------------------------------- > > Key: HARMONY-618 > URL: http://issues.apache.org/jira/browse/HARMONY-618 > Project: Harmony > Type: Bug > Components: Classlib > Reporter: Paulex Yang > Assignee: Tim Ellison > Priority: Minor > Attachments: Harmony-618.diff > > SelectorProvider.provider() should not use the Thread.currentThread().getContextClassLoader() to load the provider class defined in property file, test shows RI doesn't uses it. > Run the test below, and > RI prints: pass > while Harmony prints: fail > public class SelectorProviderTest { > private static final Class CLASS1 = MockSelectorProvider1.class; > private static final Class CLASS2 = MockSelectorProvider2.class; > private static final String KEY = "java.nio.channels.spi.SelectorProvider"; > public static void main(String[] args) { > System.setProperty(KEY, CLASS1.getName()); > Thread.currentThread().setContextClassLoader(new MockClassLoader()); > SelectorProvider provider = SelectorProvider.provider(); > if (provider.getClass() == CLASS1) { > System.out.println("pass"); > } else { > System.out.println("fail"); > } > } > private static class MockClassLoader extends ClassLoader { > public Class loadClass(String name) throws ClassNotFoundException { > return CLASS2; > } > } > > public static class MockSelectorProvider2 extends SelectorProvider{ > public DatagramChannel openDatagramChannel() throws IOException { > return null; > } > public Pipe openPipe() throws IOException { > return null; > } > public AbstractSelector openSelector() throws IOException { > return null; > } > public ServerSocketChannel openServerSocketChannel() throws IOException { > return null; > } > public SocketChannel openSocketChannel() throws IOException { > return null; > } > } > public static class MockSelectorProvider1 extends SelectorProvider{ > public DatagramChannel openDatagramChannel() throws IOException { > return null; > } > public Pipe openPipe() throws IOException { > return null; > } > public AbstractSelector openSelector() throws IOException { > return null; > } > public ServerSocketChannel openServerSocketChannel() throws IOException { > return null; > } > public SocketChannel openSocketChannel() throws IOException { > return null; > } > } > } -- 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