Buggy code:
public class TextFigure extends AttributeFigure implements FigureChangeListener , TextHolder { private int fOriginX ; private int fOriginY ; private transient boolean fSizeIsDirty = true ; private transient int fWidth ; private transient int fHeight ; private String fText ; private Font fFont ; private boolean fIsReadOnly ; private Figure fObservedFigure = null ; private OffsetLocator fLocator = null ; private static String fgCurrentFontName = "Helvetica" ; private static int fgCurrentFontSize = 12 ; private static int fgCurrentFontStyle = Font . PLAIN ; private static final long serialVersionUID = 4599820785949456124L ; private int textFigureSerializedDataVersion = 1 ; public TextFigure ( ) { } public void moveBy ( int x , int y ) { } protected void basicMoveBy ( int x , int y ) { } public void basicDisplayBox ( Point newOrigin , Point newCorner ) { } public Rectangle displayBox ( ) { } public Rectangle textDisplayBox ( ) { } public boolean readOnly ( ) { } public void setReadOnly ( boolean isReadOnly ) { } public Font getFont ( ) { } public Figure getRepresentingFigure ( ) { } public void setFont ( Font newFont ) { } public void changed ( ) { } public Object getAttribute ( String name ) { } public Object getAttribute ( FigureAttributeConstant attributeConstant ) { } public void setAttribute ( String name , Object value ) { } public void setAttribute ( FigureAttributeConstant attributeConstant , Object value ) { Font font = getFont ( ) ; if ( attributeConstant . equals ( FONT_SIZE ) ) { Integer s = ( ( Integer ) ( value ) ) ; setFont ( new Font ( font . getName ( ) , font . getStyle ( ) , s . intValue ( ) ) ) ; } else if ( attributeConstant . equals ( FONT_STYLE ) ) { Integer s = ( ( Integer ) ( value ) ) ; int style = font . getStyle ( ) ; if ( ( s . intValue ( ) ) == ( Font . PLAIN ) ) { <START_BUG> style = font . PLAIN ; <END_BUG> } else { style = style ^ ( s . intValue ( ) ) ; } setFont ( new Font ( font . getName ( ) , style , font . getSize ( ) ) ) ; } else if ( attributeConstant . equals ( FONT_NAME ) ) { String n = ( ( String ) ( value ) ) ; setFont ( new Font ( n , font . getStyle ( ) , font . getSize ( ) ) ) ; } else { super . setAttribute ( attributeConstant , value ) ; } } public String getText ( ) { } public void setText ( String newText ) { } public boolean acceptsTyping ( ) { } public void drawBackground ( Graphics g ) { } public void drawFrame ( Graphics g ) { } protected Dimension textExtent ( ) { } protected void markDirty ( ) { } public int overlayColumns ( ) { } public HandleEnumeration handles ( ) { } public void write ( StorableOutput dw ) { } public void read ( StorableInput dr ) throws IOException { } private void readObject ( ObjectInputStream s ) throws IOException , ClassNotFoundException { } public void connect ( Figure figure ) { } public void figureChanged ( FigureChangeEvent e ) { } public void figureRemoved ( FigureChangeEvent e ) { } public void figureRequestRemove ( FigureChangeEvent e ) { } public void figureInvalidated ( FigureChangeEvent e ) { } public void figureRequestUpdate ( FigureChangeEvent e ) { } protected void updateLocation ( ) { } public void release ( ) { } public void disconnect ( Figure disconnectFigure ) { } protected void setObservedFigure ( Figure newObservedFigure ) { } public Figure getObservedFigure ( ) { } protected void setLocator ( OffsetLocator newLocator ) { } protected OffsetLocator getLocator ( ) { } public TextHolder getTextHolder ( ) { } public static Font createCurrentFont ( ) { } public static void setCurrentFontName ( String name ) { } public static void setCurrentFontSize ( int size ) { } public static void setCurrentFontStyle ( int style ) { } }

Fix:
style = Font . PLAIN ;