Source:
protected void parseInfo(Variant variant, String fileId, String studyId, String info, int numAllele)throws NotAVariantException { VariantSourceEntry file = variant.getSourceEntry(fileId, studyId); for (String var : info.split(";")) { String[] splits = var.split("="); if (splits.length == 2) { switch (splits[0]) { case "ACC": String[] ids = splits[1].split(","); file.addAttribute(splits[0], ids[numAllele]); break; case "AC": String[] counts = splits[1].split(","); file.addAttribute(splits[0], counts[numAllele]); break; case "AF": if(splits[1].eqals("0")) { throw new NotAVariantException; } else { String[] frequencies = splits[1].split(","); file.addAttribute(splits[0], frequencies[numAllele]); } break; case "AN": if(splits[1].eqals("0")) { throw new NotAVariantException; } case "NS": file.addAttribute(splits[0], String.valueOf(file.getSamplesData().size())); break; case "DP": int dp = 0; for (Map<String, String> sampleData : file.getSamplesData()) { String sampleDp = sampleData.get("DP"); if (StringUtils.isNumeric(sampleDp)) { dp += Integer.parseInt(sampleDp); } } file.addAttribute(splits[0], String.valueOf(dp)); break; case "MQ": case "MQ0": int mq = 0; int mq0 = 0; for (Map<String, String> sampleData : file.getSamplesData()) { String sampleGq = sampleData.get("GQ"); if (StringUtils.isNumeric(sampleGq)) { int gq = Integer.parseInt(sampleGq); mq += gq * gq; if (gq == 0) { mq0++; } } } file.addAttribute("MQ", String.valueOf(mq)); file.addAttribute("MQ0", String.valueOf(mq0)); break; default: file.addAttribute(splits[0], splits[1]); break; } } else { variant.getSourceEntry(fileId, studyId).addAttribute(splits[0], ""); } } }

Target:
protected void parseInfo(Variant variant, String fileId, String studyId, String info, int numAllele) throws NotAVariantException { VariantSourceEntry file = variant.getSourceEntry(fileId, studyId); for (String var : info.split(";")) { String[] splits = var.split("="); if (splits.length == 2) { switch (splits[0]) { case "ACC": String[] ids = splits[1].split(","); file.addAttribute(splits[0], ids[numAllele]); break; case "AC": String[] counts = splits[1].split(","); file.addAttribute(splits[0], counts[numAllele]); break; case "AF": if (splits[1].equals("0")) { throw new NotAVariantException("The value of the AF INFO field can't be zero"); } else{ String[] frequencies = splits[1].split(","); file.addAttribute(splits[0], frequencies[numAllele]); } break; case "AN": if (splits[1].equals("0")) { throw new NotAVariantException("The value of the AN INFO field can't be zero"); } case "NS": file.addAttribute(splits[0], String.valueOf(file.getSamplesData().size())); break; case "DP": int dp = 0; for (Map<String, String> sampleData : file.getSamplesData()) { String sampleDp = sampleData.get("DP"); if (StringUtils.isNumeric(sampleDp)) { dp += Integer.parseInt(sampleDp); } } file.addAttribute(splits[0], String.valueOf(dp)); break; case "MQ": case "MQ0": int mq = 0; int mq0 = 0; for (Map<String, String> sampleData : file.getSamplesData()) { String sampleGq = sampleData.get("GQ"); if (StringUtils.isNumeric(sampleGq)) { int gq = Integer.parseInt(sampleGq); mq += gq * gq; if (gq == 0) { mq0++; } } } file.addAttribute("MQ", String.valueOf(mq)); file.addAttribute("MQ0", String.valueOf(mq0)); break; default: file.addAttribute(splits[0], splits[1]); break; } } else { variant.getSourceEntry(fileId, studyId).addAttribute(splits[0], ""); } } }