Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 4697 invoked from network); 23 Jan 2007 10:46:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 Jan 2007 10:46:17 -0000 Received: (qmail 83822 invoked by uid 500); 23 Jan 2007 10:46:18 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 83763 invoked by uid 500); 23 Jan 2007 10:46:17 -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 83640 invoked by uid 99); 23 Jan 2007 10:46:17 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Jan 2007 02:46:17 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= 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; Tue, 23 Jan 2007 02:46:10 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 04C717142FA for ; Tue, 23 Jan 2007 02:45:50 -0800 (PST) Message-ID: <782046.1169549150016.JavaMail.jira@brutus> Date: Tue, 23 Jan 2007 02:45:50 -0800 (PST) From: "Alexei Zakharov (JIRA)" To: commits@harmony.apache.org Subject: [jira] Updated: (HARMONY-2610) [classlib][awt] Compatibility: java.awt.GraphicsDevice.getDisplayMode() on RI throws unspecified NPE while Harmony doesn't In-Reply-To: <15540896.1165849701112.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-2610?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Alexei Zakharov updated HARMONY-2610: ------------------------------------- Component/s: (was: Classlib) Non-bug differences from RI > [classlib][awt] Compatibility: java.awt.GraphicsDevice.getDisplayMode() on RI throws unspecified NPE while Harmony doesn't > -------------------------------------------------------------------------------------------------------------------------- > > Key: HARMONY-2610 > URL: https://issues.apache.org/jira/browse/HARMONY-2610 > Project: Harmony > Issue Type: Bug > Components: Non-bug differences from RI > Reporter: Ilya Okomin > Assigned To: Alexei Zakharov > Priority: Minor > > Harmony for java.awt.GraphicsDevice.getDisplayMode() does not throw unspecified NPE while RI does. > Test case for reproducing: > ------------------ test.java ----------------- > import junit.framework.TestCase; > import junit.textui.TestRunner; > import java.awt.GraphicsDevice; > import java.awt.GraphicsConfiguration; > public class test extends TestCase { > public static void main(String args[]) { > TestRunner.run(test.class); > } > private static class TestGraphicsDevice extends GraphicsDevice { > public int getType() { > return GraphicsDevice.TYPE_IMAGE_BUFFER; > } > public String getIDstring() { > return "A"; > } > public GraphicsConfiguration[] getConfigurations() { > return new GraphicsConfiguration[0]; > } > public GraphicsConfiguration getDefaultConfiguration() { > return null; > } > } > public void testRun() { > TestGraphicsDevice localTestGraphicsDevice = new TestGraphicsDevice(); > try { > System.out.println("Display mode = " + localTestGraphicsDevice.getDisplayMode()); > fail("NPE Expected!"); > } catch (NullPointerException e) { > e.printStackTrace(); > } > } > } > ---------------------------------- > Output RI: > ======== > .java.lang.NullPointerException > at java.awt.GraphicsDevice.getDisplayMode(GraphicsDevice.java:271) > at test.testRun(test.java:37) > at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source) > at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source) > at junit.framework.TestCase.runTest(TestCase.java:154) > at junit.framework.TestCase.runBare(TestCase.java:127) > at junit.framework.TestResult$1.protect(TestResult.java:106) > at junit.framework.TestResult.runProtected(TestResult.java:124) > at junit.framework.TestResult.run(TestResult.java:109) > at junit.framework.TestCase.run(TestCase.java:118) > at junit.framework.TestSuite.runTest(TestSuite.java:208) > at junit.framework.TestSuite.run(TestSuite.java:203) > at junit.textui.TestRunner.doRun(TestRunner.java:116) > at junit.textui.TestRunner.doRun(TestRunner.java:109) > at junit.textui.TestRunner.run(TestRunner.java:72) > at junit.textui.TestRunner.run(TestRunner.java:57) > at test.main(test.java:12) > Time: 0,04 > OK (1 test) > Output Harmony: > ============= > .Display mode = java.awt.DisplayMode@2079f204 > F > Time: 0.04 > There was 1 failure: > 1) testRun(test)junit.framework.AssertionFailedError: NPE Expected! > at test.testRun(test.java:36) > at java.lang.reflect.VMReflection.invokeMethod(Native Method) > at test.main(test.java:10) > FAILURES!!! > Tests run: 1, Failures: 1, Errors: 0 > IMO this bug can be marked as non-bug difference, since Harmony creates DisplayMode object with default parameters and RI throws unspecified exception. Any thoughts? -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.