Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 94300 invoked from network); 18 May 2007 09:35:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 May 2007 09:35:37 -0000 Received: (qmail 61113 invoked by uid 500); 18 May 2007 09:35:43 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 61018 invoked by uid 500); 18 May 2007 09:35:43 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 61003 invoked by uid 99); 18 May 2007 09:35:43 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 May 2007 02:35:43 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 May 2007 02:35:36 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 564B171406C for ; Fri, 18 May 2007 02:35:16 -0700 (PDT) Message-ID: <3785494.1179480916351.JavaMail.jira@brutus> Date: Fri, 18 May 2007 02:35:16 -0700 (PDT) From: "Elena Sayapina (JIRA)" To: commits@harmony.apache.org Subject: [jira] Updated: (HARMONY-3908) [drlvm] Drlvm crashes on Method.invoke(obj, {arg}) if arg extends Number instead of expected primitive type wrapper In-Reply-To: <28921035.1179480796416.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 [ https://issues.apache.org/jira/browse/HARMONY-3908?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Elena Sayapina updated HARMONY-3908: ------------------------------------ Attachment: invokeTest.java > [drlvm] Drlvm crashes on Method.invoke(obj, {arg}) if arg extends Number instead of expected primitive type wrapper > ------------------------------------------------------------------------------------------------------------------- > > Key: HARMONY-3908 > URL: https://issues.apache.org/jira/browse/HARMONY-3908 > Project: Harmony > Issue Type: Bug > Components: DRLVM > Reporter: Elena Sayapina > Attachments: invokeTest.java > > > Drlvm crashes in primitives support if call invoke() method with wrong argument: > Argument is object of a class extends Number instead of expected object of primitive type wrapper. > Please, consider the following code: > import java.lang.reflect.Method; > public class invokeTest { > byte b = 0; > > public static void main(String[] args) { > try { > Method method = invokeTest.class.getDeclaredMethod("test", new Class[] {Byte.TYPE}); > method.invoke(new invokeTest(), new Object[] {new N()}); > System.out.println("TEST FAILED: no exception"); > } catch(IllegalArgumentException e) { > System.out.println("TEST PASSED: " + e); > } catch(Exception e) { > System.out.println("TEST FAILED: unexpected " + e); > } > } > > public void test(byte b) { > this.b = b; > } > } > class N extends Number { > > public double doubleValue() { > return 0; > } > > public float floatValue() { > return 0; > } > public int intValue() { > return 0; > } > public long longValue() { > return 0; > } > } > Output on Harmony-r539255: > Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, > as applicable. > java version "1.5.0" > pre-alpha : not complete or compatible > svn = r539255, (May 18 2007), Windows/ia32/msvc 1310, release build > http://incubator.apache.org/harmony > Internal error:C:\BT\build\checkouts\drlvm\vm\vmcore\src\jit\primitives_support.cpp:320: Unknown type descriptor > This application has requested the Runtime to terminate it in an unusual way. > Please contact the application's support team for more information. > > Output on HotSpot: > java version "1.5.0_11" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03) > Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode) > TEST PASSED: java.lang.IllegalArgumentException: argument type mismatch > Please, NOTE that if N doesn't extend any class or extends some class other than Number the test passes. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.