Buggy code:
@ Singleton public class SpaceInstManager { @ Inject private ComponentInstManager componentInstManager ; @ Inject private SpaceProfileInstManager spaceProfileInstManager ; @ Inject private SpaceEventNotifier notifier ; public SpaceInstManager ( ) { } public SpaceInst copy ( SpaceInst spaceInstToCopy ) { } public void createSpaceInst ( SpaceInst spaceInst , DomainDriverManager ddManager ) throws AdminException { } public SpaceInst getSpaceInstById ( DomainDriverManager ddManager , int spaceInstLocalId ) throws AdminException { try { ddManager . getOrganizationSchema ( ) ; SpaceRow space = ddManager . getOrganization ( ) . space . getSpace ( spaceInstLocalId ) ; if ( space == null ) { SilverTrace . error ( "admin" , "SpaceInstManager.getSpaceInstById" , "admin.EX_ERR_SPACE_NOT_FOUND" , ( "spaceId<seq2seq4repair_space>=<seq2seq4repair_space>" + spaceInstLocalId ) ) ; return null ; } SpaceInst spaceInst = spaceRow2SpaceInst ( space ) ; List < SpaceRow > asSubSpaces = ddManager . getOrganization ( ) . space . getDirectSubSpaces ( spaceInstLocalId ) ; List < SpaceInst > spaceInsts = new java . util . ArrayList ( asSubSpaces . size ( ) ) ; for ( SpaceRow spaceRow : asSubSpaces ) { <START_BUG> spaceInsts . add ( spaceRow2SpaceInst ( space ) ) ; <END_BUG> } spaceInst . setSubSpaces ( spaceInsts ) ; String [ ] asCompoIds = ddManager . getOrganization ( ) . instance . getAllComponentInstanceIdsInSpace ( spaceInstLocalId ) ; if ( asCompoIds != null ) { for ( String componentId : asCompoIds ) { ComponentInst componentInst = componentInstManager . getComponentInst ( ddManager , idAsInt ( componentId ) , spaceInstLocalId ) ; spaceInst . addComponentInst ( componentInst ) ; } } String [ ] asProfIds = ddManager . getOrganization ( ) . spaceUserRole . getAllSpaceUserRoleIdsOfSpace ( spaceInstLocalId ) ; if ( asProfIds != null ) { for ( String profileId : asProfIds ) { SpaceProfileInst spaceProfileInst = spaceProfileInstManager . getSpaceProfileInst ( ddManager , profileId , spaceInstLocalId ) ; spaceInst . addSpaceProfileInst ( spaceProfileInst ) ; } } spaceInst . setLanguage ( space . lang ) ; SpaceI18N translation = new SpaceI18N ( space . lang , space . name , space . description ) ; spaceInst . addTranslation ( translation ) ; List < SpaceI18NRow > translations = ddManager . getOrganization ( ) . spaceI18N . getTranslations ( spaceInstLocalId ) ; for ( int t = 0 ; ( translations != null ) && ( t < ( translations . size ( ) ) ) ; t ++ ) { SpaceI18NRow row = translations . get ( t ) ; spaceInst . addTranslation ( new SpaceI18N ( row ) ) ; } return spaceInst ; } catch ( Exception e ) { throw new AdminException ( "SpaceInstManager.getSpaceInstById" , SilverpeasException . ERROR , "admin.EX_ERR_SET_SPACE" , ( ( "spaceId<seq2seq4repair_space>:<seq2seq4repair_space>'" + spaceInstLocalId ) + "'" ) , e ) ; } finally { ddManager . releaseOrganizationSchema ( ) ; } } public SpaceInst getPersonalSpace ( DomainDriverManager ddManager , String userId ) throws AdminException { } private SpaceInst spaceRow2SpaceInst ( SpaceRow space ) { } public SpaceInstLight getSpaceInstLightById ( DomainDriverManager ddManager , int spaceLocalId ) throws AdminException { } public void updateSpaceOrder ( DomainDriverManager ddManager , int spaceLocalId , int orderNum ) throws AdminException { } private int getSpaceLevel ( int spaceId ) { } public String [ ] getAllRootSpaceIds ( DomainDriverManager ddManager ) throws AdminException { } public String [ ] getAllSpaceIds ( DomainDriverManager ddManager ) throws AdminException { } public List < SpaceInstLight > getRemovedSpaces ( DomainDriverManager ddManager ) throws AdminException { } public List < SpaceInstLight > getSubSpaces ( DomainDriverManager ddManager , int spaceLocalId ) throws AdminException { } public List < Integer > getRootSpaceIds ( ) throws AdminException { } private void setTranslations ( DomainDriverManager ddManager , SpaceInstLight space , SpaceRow row ) { } private List < SpaceInstLight > spaceRows2SpaceInstLights ( DomainDriverManager ddManager , SpaceRow [ ] spaceRows ) { } public String [ ] getAllSpaceProfileIds ( DomainDriverManager ddManager , int spaceLocalId ) throws AdminException { } public String [ ] getAllSubSpaceIds ( DomainDriverManager ddManager , int sDomainFatherId ) throws AdminException { } public void deleteSpaceInst ( SpaceInst spaceInst , DomainDriverManager ddManager ) throws AdminException { } public void sendSpaceToBasket ( DomainDriverManager ddManager , int spaceLocalId , String newSpaceName , String userId ) throws AdminException { } public void removeSpaceFromBasket ( DomainDriverManager ddManager , int spaceLocalId ) throws AdminException { } public void moveSpace ( DomainDriverManager ddManager , int spaceId , int fatherId ) throws AdminException { } public void updateSpaceInst ( DomainDriverManager ddManager , SpaceInst spaceInstNew ) throws AdminException { } private void isValidSpace ( SpaceInst spaceInst ) throws AdminException { } public boolean isSpaceInstExist ( DomainDriverManager ddManager , int spaceLocalId ) throws AdminException { } public List < SpaceInstLight > getAllSpaces ( DomainDriverManager ddManager ) throws AdminException { } public List < Integer > getManageableSpaceIds ( String userId , List < String > groupIds ) throws AdminException { } private SpaceRow makeSpaceRow ( SpaceInst spaceInst ) { } private int idAsInt ( String id ) { } private static String idAsString ( int id ) { } }

Fix:
spaceInsts . add ( spaceRow2SpaceInst ( spaceRow ) ) ;