[Bug 81] PrinterJob.PageDialog null pointer exception

bugzilla-daemon at icedtea.classpath.org bugzilla-daemon at icedtea.classpath.org
Sun Nov 25 11:32:14 PST 2007


http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=81





------- Comment #3 from neugens at limasoftware.net  2007-11-25 19:32 -------
I think that the problem is in line 2162 (5 in this snippet) of
sun.print.ServiceDialog class:

1. OrientationRequested or = (OrientationRequested)asCurrent.get(orCategory);
2. if (or == null ||
3.     !psCurrent.isAttributeValueSupported(or, docFlavor, asCurrent)) {
4.
5.     or = (OrientationRequested) psCurrent.
6.                                 getDefaultAttributeValue(orCategory);

What happens is that in line 1 "or" is correctly initialized to the supplied
value (OrientationRequested.LANDSCAPE), but then
psCurrent.isAttributeValueSupported return false, forcing to query a default
value for the OrientationRequested attribute.

getDefaultAttributeValue contains this call:

if (!isAttributeCategorySupported(category)) {
    return null;
}

So it looks to me like a circular reference, the key is not supported, so we
ask for a default value, but we don't have a default value because the key is
not supported.

I've attached a patch to workaround this, but it's not tested.

I think a better solution would be to fix this circular reference problem
adding support for OrientationRequested under linux.


-- 
Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the distro-pkg-dev mailing list