ClasspathFontPeer allows null transform

graydon hoare graydon@redhat.com
Wed Jan 28 20:19:00 GMT 2004


Scott Gilbertson wrote:
> I'm working on classpathifying the xlib peers so they'll work with the
> latest code in cvs. It's apparently working, but only because of a hack.

great!
> ClasspathFontPeer doesn't put anything in its "transform" field when you
> construct it with name,style,size. I therefore get a null pointer exception
> in java.awt.Font.equals, which doesn't check for a null transform in either
> or both fonts being compared.

oops, sorry.
> I guess the possible "proper" approaches are:
> 1. make java.awt.Font.equals tolerant of a null transform in either or both
> fonts
> 2. make java.awt.Font.getTransform so it returns an identity transform if
> the peer returns null
> 3. change ClasspathFontPeer so it puts an identity transform in
> "transform", rather than null
>> Got a preference?

personally? nothing aside from "whatever is most like what sun does". 
that's my tie-break rule for everything :)
-graydon


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /