private void apportionTypeAnnotations ( JCLambda tree , Supplier < List < Attribute . TypeCompound > > source , Consumer < List < Attribute . TypeCompound > > owner , Consumer < List < Attribute . TypeCompound > > lambda ) { ListBuffer < Attribute . TypeCompound > ownerTypeAnnos = new ListBuffer <> ( ) ; ListBuffer < Attribute . TypeCompound > lambdaTypeAnnos = new ListBuffer <> ( ) ; for ( Attribute . TypeCompound tc : source . get ( ) ) { if ( tc . position . onLambda == tree ) { lambdaTypeAnnos . append ( tc ) ; } else { ownerTypeAnnos . append ( tc ) ; } } if ( lambdaTypeAnnos . nonEmpty ( ) ) { owner . accept ( ownerTypeAnnos . toList ( ) ) ; lambda . accept ( lambdaTypeAnnos . toList ( ) ) ; } }
Reassign type annotations from the source that should really belong to the lambda