private < E , F > void displayInlineDiff ( UnifiedDiffElement < E , F > previous , UnifiedDiffElement < E , F > next , UnifiedDiffConfiguration < E , F > config ) { try { List < F > previousSubElements = config . getSplitter ( ) . split ( previous . getValue ( ) ) ; List < F > nextSubElements = config . getSplitter ( ) . split ( next . getValue ( ) ) ; DiffResult < F > diffResult = this . diffManager . diff ( previousSubElements , nextSubElements , config ) ; List < InlineDiffChunk < F > > chunks = this . inlineDisplayer . display ( diffResult ) ; previous . setChunks ( new ArrayList < InlineDiffChunk < F > > ( ) ) ; next . setChunks ( new ArrayList < InlineDiffChunk < F > > ( ) ) ; for ( InlineDiffChunk < F > chunk : chunks ) { if ( ! chunk . isAdded ( ) ) { previous . getChunks ( ) . add ( chunk ) ; } if ( ! chunk . isDeleted ( ) ) { next . getChunks ( ) . add ( chunk ) ; } } } catch ( DiffException e ) { // Do nothing. } }
Computes the changes between two versions of an element by splitting the element into sub - elements and displays the result using the in - line format .