Fix bug #45338 - JDK 1.4/1.5 issue from r673997

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@674911 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Josh Micich 2008-07-08 18:56:21 +00:00
parent 4fc756bd26
commit e9099a1cbe
1 changed files with 35 additions and 37 deletions

View File

@ -1056,15 +1056,13 @@ public class HSSFWorkbook extends POIDocument
* @param idx index number * @param idx index number
* @return HSSFFont at the index * @return HSSFFont at the index
*/ */
public HSSFFont getFontAt(short idx) {
public HSSFFont getFontAt(short idx)
{
if(fonts == null) fonts = new Hashtable(); if(fonts == null) fonts = new Hashtable();
// So we don't confuse users, give them back // So we don't confuse users, give them back
// the same object every time, but create // the same object every time, but create
// them lazily // them lazily
Short sIdx = Short.valueOf(idx); Short sIdx = new Short(idx);
if(fonts.containsKey(sIdx)) { if(fonts.containsKey(sIdx)) {
return (HSSFFont)fonts.get(sIdx); return (HSSFFont)fonts.get(sIdx);
} }