private static int index ( Object o ) { Integer i = TYPE_INDICES . get ( o ) ; if ( i == null ) { synchronized ( TYPE_INDICES ) { // check that another thread did not already update the index i = TYPE_INDICES . get ( o ) ; if ( i != null ) return i ; else { int j = TYPE_INDICES . size ( ) ; TYPE_INDICES . put ( o , j ) ; TYPES . add ( o ) ; return j ; } } } return i ; }
Returns the index for the given type creating a new index if necessary