private static void checkBlockEndContext ( RenderUnitNode node , Context endContext ) { if ( ! endContext . isValidEndContextForContentKind ( MoreObjects . firstNonNull ( node . getContentKind ( ) , SanitizedContentKind . HTML ) ) ) { String msg = String . format ( "A block of kind=\"%s\" cannot end in context %s. Likely cause is %s." , node . getContentKind ( ) . asAttributeValue ( ) , endContext , endContext . getLikelyEndContextMismatchCause ( node . getContentKind ( ) ) ) ; throw SoyAutoescapeException . createWithNode ( msg , node ) ; } }
Checks that the end context of a block is compatible with its start context .