@ SuppressWarnings ( "unchecked" ) < T extends JCExpression , Z extends ArgumentType < T > > void processArg ( T that , Function < T , Z > argumentTypeFactory ) { UniquePos pos = new UniquePos ( that ) ; processArg ( that , ( ) -> { T speculativeTree = ( T ) deferredAttr . attribSpeculative ( that , env , attr . new MethodAttrInfo ( ) { @ Override protected boolean needsArgumentAttr ( JCTree tree ) { return ! new UniquePos ( tree ) . equals ( pos ) ; } } ) ; return argumentTypeFactory . apply ( speculativeTree ) ; } ) ; }
Process a method argument ; this method takes care of performing a speculative pass over the argument tree and calling a well - defined entry point to build the argument type associated with such tree .