Buggy code:
protected static final String DEFAULT_OTHER_COLOR = "0,0,0" ; protected static final String DEFAULT_SYSTEM_COLOR = "0,0,255" ; protected static final String DEFAULT_HIGHLIGHT_COLOR = "255,0,0" ; protected static final String DEFAULT_DATE_COLOR = "0,0,0" ; protected static final String DEFAULT_TIME_FORMAT = "HH:mm:ss" ; protected static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd" ; protected static final int DEFAULT_INPUT_HEIGHT = 25 ; protected static final int DEFAULT_INPUT_SEPARATOR = 5 ; private Composite mainComp = null ; private SimpleLinkTextViewer readText = null ; private Text writeText = null ; private CTabFolder tabFolder = null ; private ChatRoomManagerView . Manager rootChatRoomTabItem = null ; private IWorkbenchBrowserSupport browserSupport = PlatformUI . getWorkbench ( ) . getBrowserSupport ( ) ; IChatRoomViewCloseListener closeListener = null ; IChatRoomMessageSender messageSender = null ; IChatRoomContainer chatRoomContainer = null ; IChatRoomManager chatRoomManager = null ; private Color otherColor = null ; private Color systemColor = null ; private Color dateColor = null ; private Color highlightColor = null ; Action outputClear = null ; Action outputCopy = null ; Action outputPaste = null ; Action outputSelectAll = null ; boolean disposed = false ; private ID chatHostID ; private String userName = "<user>" ; private String hostName = "<host>" ; private boolean enabled = false ; class Manager { SashForm fullChat ; CTabItem tabItem ; SashForm rightSash ; KeyListener keyListener ; SimpleLinkTextViewer textOutput ; Text textInput ; ListViewer listViewer ; Manager ( CTabFolder parent , String name ) { } Manager ( boolean withParticipantsList , CTabFolder parent , String name , KeyListener keyListener ) { } protected void setTabName ( String name ) { } protected Text getTextInput ( ) { } protected SimpleLinkTextViewer getTextOutput ( ) { } protected void setKeyListener ( KeyListener listener ) { } protected ListViewer getListViewer ( ) { } } public void createPartControl ( Composite parent ) { } public void initialize ( final IChatRoomViewCloseListener parent , final IChatRoomContainer container , final IChatRoomManager chatRoomManager , final ID targetID , final IChatRoomMessageSender sender ) { } protected void setEnabled ( boolean enabled ) { } public boolean isEnabled ( ) { } protected void clearInput ( ) { } protected void handleCommands ( String line , String [ ] tokens ) { } protected void sendMessageLine ( String line ) { } public void disconnected ( ) { } protected void doQuit ( ) { } protected void doJoin ( String target , String key ) { } class ChatRoom implements IParticipantListener , IChatRoomInvitationListener , KeyListener { IChatRoomContainer container ; ChatRoomManagerView . Manager tabUI ; Text inputText ; SimpleLinkTextViewer outputText ; IChatRoomMessageSender channelMessageSender ; private List otherUsers = Collections . synchronizedList ( new ArrayList ( ) ) ; IUser localUser ; private ListViewer memberViewer = null ; private ArrayList options ; private int maximumCyclingOptions = 5 ; private int prefixLength ; private int choice = 0 ; private int nickRemainder ; private int caret ; private char nickCompletionSuffix = ':' ; private boolean isCycling = false ; private boolean isAtStart = false ; ChatRoom ( IChatRoomContainer container , ChatRoomManagerView . Manager tabItem ) { } public void handleMessage ( final ID fromID , final String messageBody ) { } public void handleInvitationReceived ( ID roomID , ID from , String subject , String body ) { } public void keyPressed ( KeyEvent e ) { } public void keyReleased ( KeyEvent e ) { } protected void handleKeyPressed ( KeyEvent evt ) { } protected void handleKeyReleased ( KeyEvent evt ) { } protected void handleTextInput ( String text ) { } protected void handleInputLine ( String line ) { } protected void handleCommands ( String line , String [ ] tokens ) { } protected void doPartChannel ( ) { } protected void clearInput ( ) { } protected void sendMessageLine ( String line ) { } public void handlePresence ( final ID fromID , final IPresence presence ) { <START_BUG> Display . getDefault ( ) . syncExec ( new Runnable ( ) { <END_BUG> public void run ( ) { if ( disposed ) return ; boolean isAdd = presence . getType ( ) . equals ( AVAILABLE ) ; ChatRoomManagerView . Participant p = new ChatRoomManagerView . Participant ( fromID ) ; if ( isAdd ) { if ( ( ( localUser ) == null ) && ( ! ( otherUsers . contains ( fromID ) ) ) ) { localUser = p ; } addParticipant ( p ) ; } else { removeParticipant ( p ) ; if ( isLocalUser ( fromID ) ) removeLocalUser ( ) ; } } } ) ; } public void disconnected ( ) { } protected void addParticipant ( IUser p ) { } protected boolean isLocalUser ( ID id ) { } protected void removeLocalUser ( ) { } protected void removeParticipant ( IUser p ) { } protected void removeAllParticipants ( ) { } public void handleJoin ( ID user ) { } public void handleLeave ( ID user ) { } } protected void handleInputLine ( String line ) { } protected void handleTextInput ( String text ) { } protected void handleEnter ( ) { } protected void handleKeyPressed ( KeyEvent evt ) { } protected void handleKeyReleased ( KeyEvent evt ) { } public void setFocus ( ) { } protected void setUsernameAndHost ( ID chatHostID ) { } public void joinRoom ( final String room ) { } public void dispose ( ) { } protected String getMessageString ( ID fromID , String text ) { } public void handleMessage ( final ID fromID , final String messageBody ) { } private String trimUserID ( ID userID ) { } class Participant implements IUser { private static final long serialVersionUID = 2008114088656711572L ; ID id ; public Participant ( ID id ) { } public ID getID ( ) { } public String getName ( ) { } public boolean equals ( Object other ) { } public int hashCode ( ) { } public String toString ( ) { }

Fix:
Display . getDefault ( ) . asyncExec ( new Runnable ( ) {