Source:
<code>public static FontData getFontData(CSS2FontProperties fontProperties, FontData oldFontData) { FontData newFontData = new FontData(); CSSPrimitiveValue cssFontFamily = fontProperties.getFamily(); FontData[] fontDataByDefinition = new FontData[0]; boolean fontDefinitionAsFamily = cssFontFamily != null && cssFontFamily.getStringValue().startsWith(FONT_DEFINITION_MARKER); if (fontDefinitionAsFamily) { fontDataByDefinition = findFontDataByDefinition(cssFontFamily); if (fontDataByDefinition.length > 0) { newFontData.setName(fontDataByDefinition[0].getName()); } } else if (cssFontFamily != null) { newFontData.setName(cssFontFamily.getStringValue()); } <START> boolean fontFamilySet = newFontData.getName() != null && !newFontData.getName().trim().isEmpty(); <END> if (!fontFamilySet && oldFontData != null) { newFontData.setName(oldFontData.getName()); } CSSPrimitiveValue cssFontStyle = fontProperties.getStyle(); if (fontDefinitionAsFamily && fontDataByDefinition.length > 0 && isValueFromDefinition(cssFontStyle)) { newFontData.setStyle(fontDataByDefinition[0].getStyle()); } else { newFontData.setStyle(getSWTStyle(fontProperties, oldFontData)); } CSSPrimitiveValue cssFontSize = fontProperties.getSize(); boolean fontHeightSet = false; if (isValueFromDefinition(cssFontSize)) { if (fontDefinitionAsFamily && fontDataByDefinition.length > 0) { newFontData.setHeight(fontDataByDefinition[0].getHeight()); fontHeightSet = true; } } else if (cssFontSize != null) { newFontData.setHeight((int) (cssFontSize).getFloatValue(CSSPrimitiveValue.CSS_PT)); fontHeightSet = true; } if (!fontHeightSet && oldFontData != null) { newFontData.setHeight(oldFontData.getHeight()); } return newFontData; }</code><technical_language>isEmpty() is valid in J2SE-1.5. Please set JREs, 1.5-1.7 (and a 1.4 request specially)</technical_language>

Target:
public static FontData getFontData(CSS2FontProperties fontProperties, FontData oldFontData) { FontData newFontData = new FontData(); CSSPrimitiveValue cssFontFamily = fontProperties.getFamily(); FontData[] fontDataByDefinition = new FontData[0]; boolean fontDefinitionAsFamily = cssFontFamily != null && cssFontFamily.getStringValue().startsWith(FONT_DEFINITION_MARKER); if (fontDefinitionAsFamily) { fontDataByDefinition = findFontDataByDefinition(cssFontFamily); if (fontDataByDefinition.length > 0) { newFontData.setName(fontDataByDefinition[0].getName()); } } else if (cssFontFamily != null) { newFontData.setName(cssFontFamily.getStringValue()); } boolean fontFamilySet = newFontData.getName() != null && newFontData.getName().trim().length() > 0; if (!fontFamilySet && oldFontData != null) { newFontData.setName(oldFontData.getName()); } CSSPrimitiveValue cssFontStyle = fontProperties.getStyle(); if (fontDefinitionAsFamily && fontDataByDefinition.length > 0 && isValueFromDefinition(cssFontStyle)) { newFontData.setStyle(fontDataByDefinition[0].getStyle()); } else { newFontData.setStyle(getSWTStyle(fontProperties, oldFontData)); } CSSPrimitiveValue cssFontSize = fontProperties.getSize(); boolean fontHeightSet = false; if (isValueFromDefinition(cssFontSize)) { if (fontDefinitionAsFamily && fontDataByDefinition.length > 0) { newFontData.setHeight(fontDataByDefinition[0].getHeight()); fontHeightSet = true; } } else if (cssFontSize != null) { newFontData.setHeight((int) (cssFontSize).getFloatValue(CSSPrimitiveValue.CSS_PT)); fontHeightSet = true; } if (!fontHeightSet && oldFontData != null) { newFontData.setHeight(oldFontData.getHeight()); } return newFontData; }