Buggy code:
public class XMPPChatRoomManager implements IChatRoomManager { private static final String PROP_XMPP_SUBJECT = "subject" ; public static final String PROP_XMPP_CONFERENCE = "conference" ; private ID containerID = null ; private Namespace connectNamespace = null ; private List invitationListeners = new ArrayList ( ) ; private ECFConnection ecfConnection = null ; private List chatrooms = new ArrayList ( ) ; private ID connectedID = null ; private IChatRoomInvitationSender invitationSender = new IChatRoomInvitationSender ( ) { public void sendInvitation ( ID room , ID targetUser , String subject , String body ) throws ECFException { } } ; public XMPPChatRoomManager ( ID containerID ) { } protected void sendInvitation ( ID room , ID targetUser , String subject , String body ) throws ECFException { } protected void addChat ( XMPPChatRoomContainer container ) { } protected void removeChat ( XMPPChatRoomContainer container ) { } protected XMPPChatRoomContainer getChatRoomContainer ( ID roomID ) { } protected ID createRoomIDFromName ( String from ) { } protected ID createUserIDFromName ( String name ) { } public void setConnection ( Namespace connectNamespace , ID connectedID , ECFConnection connection ) { } protected void disposeChatRooms ( ) { } public void dispose ( ) { } class ECFRoomInfo implements IChatRoomInfo { RoomInfo info ; XMPPRoomID roomID ; ID connectedID ; public ECFRoomInfo ( XMPPRoomID roomID , RoomInfo info , ID connectedID ) { } public String getDescription ( ) { } public String getSubject ( ) { } public ID getRoomID ( ) { } public int getParticipantsCount ( ) { } public String getName ( ) { } public boolean isPersistent ( ) { } public boolean requiresPassword ( ) { } public boolean isModerated ( ) { } public ID getConnectedID ( ) { } public Object getAdapter ( Class clazz ) { } public IChatRoomContainer createChatRoomContainer ( ) throws ContainerCreateException { } public String toString ( ) { } } public IChatRoomManager [ ] getChildren ( ) { } protected ID createIDFromHostedRoom ( HostedRoom room ) { } public IChatRoomContainer findReceiverChatRoom ( ID toID ) { } protected ID [ ] getChatRooms ( ) { } protected IChatRoomInfo getChatRoomInfo ( ID roomID ) { } public IChatRoomInfo getChatRoomInfo ( String roomname ) { } public IChatRoomInfo [ ] getChatRoomInfos ( ) { ID [ ] chatRooms = getChatRooms ( ) ; if ( chatRooms == null ) <START_BUG> return null ; <END_BUG> IChatRoomInfo [ ] res = new IChatRoomInfo [ chatRooms . length ] ; int count = 0 ; for ( int i = 0 ; i < ( chatRooms . length ) ; i ++ ) { IChatRoomInfo infoResult = getChatRoomInfo ( chatRooms [ i ] ) ; if ( infoResult != null ) { res [ ( count ++ ) ] = infoResult ; } } IChatRoomInfo [ ] results = new IChatRoomInfo [ count ] ; for ( int i = 0 ; i < count ; i ++ ) { results [ i ] = res [ i ] ; } return results ; } public Object getAdapter ( Class adapter ) { } public void addInvitationListener ( IChatRoomInvitationListener listener ) { } public void removeInvitationListener ( IChatRoomInvitationListener listener ) { } protected void fireInvitationReceived ( ID roomID , ID fromID , ID toID , String subject , String body ) { } public IChatRoomManager getParent ( ) { } public IChatRoomInfo createChatRoom ( String roomname , Map properties ) throws ChatRoomCreateException { } protected boolean checkRoom ( String conference , String room ) throws XMPPException { } protected IHistoryManager chatRoomHistoryManager = new IHistoryManager ( ) { public IHistory getHistory ( ID chatRoomID , Map options ) { } public boolean isActive ( ) { } public void setActive ( boolean active ) { } public Object getAdapter ( Class adapter ) { } } ; public IHistoryManager getHistoryManager ( ) { } public IChatRoomInvitationSender getInvitationSender ( ) { } }

Fix:
return new IChatRoomInfo [ 0 ] ;