This is more of a change request than a bug. It would be nice if setters across the board could return "this". By changing the code this way instead of doing: Cell myCell = row.createCell(); myCell.setCellStyle( myStyle ); RichTextString rts = createHelper.createRichTextString( "hello ); rts.applyFont( boldFont ); myCell.setCellFont( rts ); I could do: Cell myCell = row.createCell() .setCellStyle( myStyle ) .setCellFont( createHelper.createRichTextString( "hello" ) .applyFont( boldFont ) ); The previous code would continue to work but if you prefer a more compact version with fewer intermediate variables a change from void setters would allow this.
Unfortunately we cannot change setters to return "this" becasue POI must be binary-compatible wuth existing code. If we make this change then the old code would work ONLY if you re-compile it against the latest build of POI. If you simply change the return type and replace the POI jar then Java will not be able to find the new methods and throw NoSuchMethodError. Yegor