Buggy code:
public class BBCodeEditor extends VerticalPanel implements HasValidators { public interface BBCodeEditorPlugin { Button getButton ( ) { } void setTextArea ( SelectableTextArea textArea ) { } } private static final List < BBCodeEditor . BBCodeEditorPlugin > pluggedInButtons = new ArrayList < BBCodeEditor . BBCodeEditorPlugin > ( ) ; private TabPanel tabPanel = new TabPanel ( ) ; private VerticalPanel rawPanel = new VerticalPanel ( ) ; private Frame preview = new Frame ( ) ; private HorizontalPanel buttonPanel = new HorizontalPanel ( ) ; private SelectableTextArea rawEditor = new SelectableTextArea ( ) ; private BBCodeServiceAsync bbCodeService = GWT . create ( BBCodeService . class ) ; private boolean required ; private CommonMessages messages = GWT . create ( CommonMessages . class ) ; private Label errorMessage = new Label ( ) ; public BBCodeEditor ( String value , boolean required ) { } public BBCodeEditor ( ) { } private void initButtons ( ) { <START_BUG> Button buttonBold = new Button ( "Bold<seq2seq4repair_space>2" ) ; <END_BUG> buttonBold . addClickHandler ( new ClickHandler ( ) { @ Override public void onClick ( ClickEvent event ) { SelectedText selectedText = rawEditor . getSelectedTextObj ( ) ; selectedText . text = ( "[b]" + ( selectedText . text ) ) + "[//b]" ; rawEditor . setSelectedText ( selectedText ) ; } } ) ; buttonPanel . add ( buttonBold ) ; Button buttonItalic = new Button ( "Italic" ) ; buttonItalic . addClickHandler ( new ClickHandler ( ) { @ Override public void onClick ( ClickEvent event ) { SelectedText selectedText = rawEditor . getSelectedTextObj ( ) ; selectedText . text = ( "[i]" + ( selectedText . text ) ) + "[//i]" ; rawEditor . setSelectedText ( selectedText ) ; } } ) ; buttonPanel . add ( buttonItalic ) ; Button buttonImg = new Button ( "Bild" ) ; buttonImg . addClickHandler ( new ClickHandler ( ) { @ Override public void onClick ( ClickEvent event ) { ImagePickerPopup imagePicker = new ImagePickerPopup ( 800 , 800 , false ) ; imagePicker . center ( ) ; imagePicker . show ( ) ; imagePicker . addSaveHandler ( new ImagePickerPopup . SaveHandler ( ) { public void saved ( String value ) { SelectedText selectedText = rawEditor . getSelectedTextObj ( ) ; selectedText . text = ( "[img]" + value ) + "[//img]" ; rawEditor . setSelectedText ( selectedText ) ; } } ) ; } } ) ; buttonPanel . add ( buttonImg ) ; Button buttonUrl = new Button ( "Url" ) ; buttonUrl . addClickHandler ( new ClickHandler ( ) { @ Override public void onClick ( ClickEvent event ) { BBUrlPanel urlPanel = new BBUrlPanel ( rawEditor ) ; urlPanel . show ( ) ; } } ) ; buttonPanel . add ( buttonUrl ) ; Button buttonYoutube = new Button ( "Youtube" ) ; buttonYoutube . addClickHandler ( new ClickHandler ( ) { @ Override public void onClick ( ClickEvent event ) { BBYoutubePanel youtubePanel = new BBYoutubePanel ( rawEditor ) ; youtubePanel . show ( ) ; } } ) ; buttonPanel . add ( buttonYoutube ) ; for ( BBCodeEditor . BBCodeEditorPlugin plugin : BBCodeEditor . pluggedInButtons ) { plugin . setTextArea ( rawEditor ) ; buttonPanel . add ( plugin . getButton ( ) ) ; } errorMessage . setStyleName ( "validationError" ) ; errorMessage . setVisible ( false ) ; rawPanel . add ( errorMessage ) ; rawPanel . add ( buttonPanel ) ; rawPanel . add ( rawEditor ) ; preview . setSize ( "960px" , "700px" ) ; rawEditor . setSize ( "960px" , "700px" ) ; tabPanel . setSize ( "960px" , "700px" ) ; tabPanel . add ( rawPanel , "RAW" ) ; tabPanel . add ( preview , "Preview" ) ; tabPanel . selectTab ( 0 ) ; tabPanel . addBeforeSelectionHandler ( new com . google . gwt . event . logical . shared . BeforeSelectionHandler < Integer > ( ) { @ Override public void onBeforeSelection ( BeforeSelectionEvent < Integer > event ) { bbCodeService . generateBBCodePreview ( rawEditor . getText ( ) , new com . google . gwt . user . client . rpc . AsyncCallback < String > ( ) { @ Override public void onSuccess ( String key ) { preview . setUrl ( ( "//burrito//bbCodePreview?key=" + key ) ) ; } @ Override public void onFailure ( Throwable caught ) { Window . alert ( ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>create<seq2seq4repair_space>preview!<seq2seq4repair_space>" + ( caught . getMessage ( ) ) ) ) ; } } ) ; } } ) ; add ( tabPanel ) ; } @ Override protected void onLoad ( ) { } public static void addPlugin ( BBCodeEditor . BBCodeEditorPlugin plugin ) { } public void setText ( String value ) { } public String getText ( ) { } @ Override public void addInputFieldValidator ( InputFieldValidator validator ) { } @ Override public boolean validate ( ) { } @ Override public void setValidationError ( String validationMessage ) { } }

Fix:
Button buttonBold = new Button ( "Bold" ) ;