harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ilya Okomin (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-1543) [classlib][awt]Compatibility: awt.Font.getFamily(Locale) with null Locale returns family on Harmony and throws NPE on RI
Date Fri, 22 Sep 2006 11:24:23 GMT
[classlib][awt]Compatibility: awt.Font.getFamily(Locale) with null Locale returns family on
Harmony and throws NPE on RI

                 Key: HARMONY-1543
                 URL: http://issues.apache.org/jira/browse/HARMONY-1543
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Ilya Okomin
            Priority: Minor

awt.Font.getFamily(Locale) with null Locale parameter returns "Dialog" family name on Harmony
and throws NPE on RI.
Note: there is nothing said about Exceptions in the spec.

Next test case passes on RI and fails on Harmony:

import java.awt.*;
import java.awt.font.TextAttribute;
import java.util.*;

import junit.framework.TestCase;

public class test extends TestCase {

    public static void main(String[] args) {

    protected void setUp() throws Exception {
    public void testRun() {
            Font fnt = Font.getFont((Map<? extends TextAttribute, ?>)Collections.EMPTY_MAP);
            fail("NullPointerException expected!");
        } catch (NullPointerException e) {
            // expected

Output RI: 

java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
BEA WebLogic JRockit(R) (build dra-38972-20041208-2001-win-ia32, R25.0.0-75, GC: System optimized
over throughput (initial strategy singleparpar))

Time: 0.15

OK (1 test)

Output Harmony:  
java version "1.5.0" 
pre-alpha : not complete or compatible
svn = r431938, (Aug 16 2006), Windows/ia32/msvc 1310, release build

Time: 0.37
There was 1 failure:
1) testRun(test)junit.framework.AssertionFailedError: NullPointerException expected!
	at test.testRun(Test9741_1.java:23)
	at java.lang.reflect.VMReflection.invokeMethod()
	at test.main(Test9741_1.java:12)

Tests run: 1,  Failures: 1,  Errors: 0

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


View raw message