public FragmentBuilder getFragmentBuilder ( ) { FragmentBuilder builder = builders . get ( ) ; if ( builder == null ) { if ( log . isLoggable ( Level . FINEST ) ) { log . finest ( "Creating new FragmentBuilder" ) ; } builder = new FragmentBuilder ( ) ; builders . set ( builder ) ; int currentCount = threadCounter . incrementAndGet ( ) ; int builderCount = builder . incrementThreadCount ( ) ; if ( log . isLoggable ( Level . FINEST ) ) { log . finest ( "Associate Thread with FragmentBuilder(1): Total Thread Count = " + currentCount + " : Fragment Thread Count = " + builderCount ) ; synchronized ( threadNames ) { threadNames . add ( Thread . currentThread ( ) . getName ( ) ) ; } } } return builder ; }
This method returns the appropriate fragment builder for the current thread .