Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-swt-dev] Application crashes on solaris when tried to create an instance of StyledText

Hi,

We are using SWT of Eclipse 3.0 in our application. Its not an IDE or
RCP. Application is crashing on Solaris 5.8 with following trace for
one of our clients. Working fine on our machines.

Application is crashing while creating an instance of StyledText.

java.lang.NullPointerException
at org.eclipse.swt.custom.StyledTextRenderer.getFontData(StyledTextRenderer.java:231)
at org.eclipse.swt.custom.StyledTextRenderer.getFont(StyledTextRenderer.java:218)
at org.eclipse.swt.custom.StyledTextRenderer.calculateLineHeight(StyledTextRenderer.java:54)
at org.eclipse.swt.custom.DisplayRenderer.<init>(DisplayRenderer.java:38)
at org.eclipse.swt.custom.StyledText.initializeRenderer(StyledText.java:5325)
at org.eclipse.swt.custom.StyledText.<init>(StyledText.java:1607)
at com.appperfect.common.ui.swt.l.new(SWTUIUtilities.java:1332)

After going through the SWT code I think the problem is coming because
Font.getFontData()  is returning NULL.
It is documented in the code that it returns NULL when font data can
not be constructed.

What is the solution for this problem?

Also looked into 3.1 code, now it is not returning NULL but calling 
SWT.error (SWT.ERROR_INVALID_FONT);
which in turns throws an SWTError.
So I think, it wont make any difference if replace the jars with latest one.

Should I file this as bug?

Thanks,
Sudhan


Back to the top