List of usage examples for org.apache.commons.jrcs.diff.myers MyersDiff diff
public Revision diff(Object[] orig, Object[] rev) throws DifferentiationFailedException
From source file:uk.ac.cam.caret.sakai.rwiki.tool.bean.GenericDiffBean.java
/** * initialise the bean. To be called after the leftContent and rightContent * have been set./* w w w.j a v a 2s. c o m*/ */ public void init() { MyersDiff diffAlgorithm = new MyersDiff(); try { objectifiedLeft = leftContent.split("\n"); objectifiedRight = rightContent.split("\n"); difference = diffAlgorithm.diff(objectifiedLeft, objectifiedRight); } catch (DifferentiationFailedException e) { // Quite why JRCS has this I don't know! throw new RuntimeException("DifferentiationFailedException occured: " + "This should never happen!", e); } }