Buggy code:
public String getHeightUnit ( ) { } public void setCookieName ( String cookieName ) { } public String getCookieName ( ) { } public void setTitle ( String title ) { } public String getTitle ( ) { } public static final class MaskType extends EnumeratedType { private static final long serialVersionUID = 1L ; public static final ModalWindow . MaskType TRANSPARENT = new ModalWindow . MaskType ( "TRANSPARENT" ) ; public static final ModalWindow . MaskType SEMI_TRANSPARENT = new ModalWindow . MaskType ( "SEMI_TRANSPARENT" ) ; public MaskType ( String name ) { } } public void setMaskType ( ModalWindow . MaskType mask ) { } public ModalWindow . MaskType getMaskType ( ) { } private Page createPage ( ) { } protected void onAttach ( ) { } protected void onComponentTag ( ComponentTag tag ) { } private Component getContent ( ) { } private boolean isCustomComponent ( ) { } public void remove ( Component component ) { } public void setContent ( Component component ) { } private class WindowClosedBehavior extends AbstractDefaultAjaxBehavior { private static final long serialVersionUID = 1L ; protected void respond ( AjaxRequestTarget target ) { } protected CharSequence getCallbackScript ( ) { } } private class CloseButtonBehavior extends AbstractDefaultAjaxBehavior { private static final long serialVersionUID = 1L ; protected void respond ( AjaxRequestTarget target ) { } protected IAjaxCallDecorator getAjaxCallDecorator ( ) { } protected CharSequence getCallbackScript ( ) { } } private String getContentMarkupId ( ) { } private String escapeQuotes ( String string ) { } private String getWindowOpenJavascript ( ) { AppendingStringBuffer buffer = new AppendingStringBuffer ( ) ; if ( ( isCustomComponent ( ) ) == true ) { buffer . append ( ( ( "var<seq2seq4repair_space>element<seq2seq4repair_space>=<seq2seq4repair_space>document.getElementById(\"" + ( getContentMarkupId ( ) ) ) + "\");\n" ) ) ; } buffer . append ( "var<seq2seq4repair_space>settings<seq2seq4repair_space>=<seq2seq4repair_space>new<seq2seq4repair_space>Object();\n" ) ; buffer . append ( ( ( "settings.minWidth=" + ( getMinimalWidth ( ) ) ) + ";\n" ) ) ; buffer . append ( ( ( "settings.minHeight=" + ( getMinimalHeight ( ) ) ) + ";\n" ) ) ; buffer . append ( ( ( "settings.className=\"" + ( getCssClassName ( ) ) ) + "\";\n" ) ) ; buffer . append ( ( ( "settings.width=\"" + ( getInitialWidth ( ) ) ) + "\";\n" ) ) ; if ( ( ( isUseInitialHeight ( ) ) == true ) || ( ( isCustomComponent ( ) ) == false ) ) buffer . append ( ( ( "settings.height=\"" + ( getInitialHeight ( ) ) ) + "\";\n" ) ) ; else buffer . append ( "settings.height=null;\n" ) ; buffer . append ( ( ( "settings.resizable=" + ( Boolean . toString ( isResizable ( ) ) ) ) + ";\n" ) ) ; if ( ( isResizable ( ) ) == false ) { buffer . append ( ( ( "settings.widthUnit=\"" + ( getWidthUnit ( ) ) ) + "\";\n" ) ) ; buffer . append ( ( ( "settings.heightUnit=\"" + ( getHeightUnit ( ) ) ) + "\";\n" ) ) ; } if ( ( isCustomComponent ( ) ) == false ) { Page page = createPage ( ) ; if ( page == null ) { throw new WicketRuntimeException ( "Error<seq2seq4repair_space>creating<seq2seq4repair_space>page<seq2seq4repair_space>for<seq2seq4repair_space>modal<seq2seq4repair_space>dialog." ) ; } buffer . append ( ( ( "settings.src=\"" + ( RequestCycle . get ( ) . urlFor ( page ) ) ) + "\";\n" ) ) ; if ( ( getPageMapName ( ) ) != null ) { buffer . append ( ( ( "settings.iframeName=\"" + ( getPageMapName ( ) ) ) + "\";\n" ) ) ; } } else { buffer . append ( "settings.element<seq2seq4repair_space>=<seq2seq4repair_space>element;\n" ) ; } if ( ( getCookieName ( ) ) != null ) { buffer . append ( ( ( "settings.cookieId=\"" + ( getCookieName ( ) ) ) + "\";\n" ) ) ; } if ( ( getTitle ( ) ) != null ) { buffer . append ( ( ( "settings.title=\"" + ( escapeQuotes ( getTitle ( ) ) ) ) + "\";\n" ) ) ; } if ( ( getMaskType ( ) ) == ( ModalWindow . MaskType . TRANSPARENT ) ) { buffer . append ( "settings.mask=\"transparent\";\n" ) ; } else if ( ( getMaskType ( ) ) == ( ModalWindow . MaskType . SEMI_TRANSPARENT ) ) { buffer . append ( "settings.mask=\"semi-transparent\";\n" ) ; } if ( ( closeButtonCallback ) != null ) { ModalWindow . CloseButtonBehavior behavior = ( ( ModalWindow . CloseButtonBehavior ) ( getBehaviors ( ModalWindow . CloseButtonBehavior . class ) . get ( 0 ) ) ) ; buffer . append ( ( ( "settings.onCloseButton<seq2seq4repair_space>=<seq2seq4repair_space>function()<seq2seq4repair_space>{<seq2seq4repair_space>" + ( behavior . getCallbackScript ( ) ) ) + "};\n" ) ) ; } <START_BUG> if ( ( ( isCustomComponent ( ) ) == false ) || ( ( windowClosedCallback ) != null ) ) { <END_BUG> ModalWindow . WindowClosedBehavior behavior = ( ( ModalWindow . WindowClosedBehavior ) ( getBehaviors ( ModalWindow . WindowClosedBehavior . class ) . get ( 0 ) ) ) ; buffer . append ( ( ( "settings.onClose<seq2seq4repair_space>=<seq2seq4repair_space>function()<seq2seq4repair_space>{<seq2seq4repair_space>" + ( behavior . getCallbackScript ( ) ) ) + "<seq2seq4repair_space>};\n" ) ) ; } buffer . append ( "Wicket.Window.create(settings).show();\n" ) ; return buffer . toString ( ) ; } private boolean deletePageMap = false ; private boolean shown = false ; private WebMarkupContainer empty ; private int minimalWidth = 200 ; private int minimalHeight = 200 ; private String cssClassName = ModalWindow . CSS_CLASS_BLUE ; private int initialWidth = 600 ; private int initialHeight = 400 ; private boolean useInitialHeight = true ; private boolean resizable = true ; private String widthUnit = "px" ; private String heightUnit = "px" ; private String cookieName ; private String title = null ; private ModalWindow . MaskType maskType = ModalWindow . MaskType . SEMI_TRANSPARENT ; private String pageMapName = "modal-dialog-pagemap" ; private ModalWindow . PageCreator pageCreator = null ; private ModalWindow . CloseButtonCallback closeButtonCallback = null ; private ModalWindow . WindowClosedCallback windowClosedCallback = null ; }

Fix:
if ( ( ( ( isCustomComponent ( ) ) == false ) && ( deletePageMap ) ) || ( ( windowClosedCallback ) != null ) ) {