final OtpErlangTuple listElementTuple = (OtpErlangTuple) object;
final OtpErlangList duplicateCodeList = (OtpErlangList) listElementTuple
.elementAt(0);
final LinkedHashMap<IFile, List<DuplicatedCodeInstanceElement>> values = new LinkedHashMap<IFile, List<DuplicatedCodeInstanceElement>>();
final OtpErlangString suggestion = (OtpErlangString) listElementTuple
.elementAt(3);
final String suggStr = suggestion.stringValue();
final OtpErlangObject[] elements = duplicateCodeList.elements();
for (int i = 0; i < elements.length; ++i) {
OtpErlangTuple elementPair = (OtpErlangTuple) elements[i];
String replicationFunction = "";
final OtpErlangTuple checkable = (OtpErlangTuple) elementPair.elementAt(0);
if (checkable.elementAt(0) instanceof OtpErlangTuple) {
final OtpErlangString repFunStr = (OtpErlangString) elementPair
.elementAt(1);
replicationFunction = repFunStr.stringValue();
elementPair = checkable;
}
final OtpErlangTuple firstElement = (OtpErlangTuple) elementPair.elementAt(0);
final OtpErlangTuple secondElement = (OtpErlangTuple) elementPair
.elementAt(1);
final OtpErlangString fileName = (OtpErlangString) firstElement.elementAt(0);
final OtpErlangLong startLine = (OtpErlangLong) firstElement.elementAt(1);
final OtpErlangLong startCol = (OtpErlangLong) firstElement.elementAt(2);
final OtpErlangLong endLine = (OtpErlangLong) secondElement.elementAt(1);
final OtpErlangLong endCol = (OtpErlangLong) secondElement.elementAt(2);
final String fileNameStr = fileName.stringValue();
final IFile file = WranglerUtils.getFileFromPath(fileNameStr);
final DuplicatedCodeInstanceElement instance = new DuplicatedCodeInstanceElement(
file, startLine.intValue(), startCol.intValue(), endLine.intValue(),
endCol.intValue() + 1);
instance.setSuggestedCode(suggStr);