private void addRecord(int section, int index, DnsRecord record) { checkQuestion(section, record); final Object records = sectionAt(section); if (records == null) { if (index != 0) { throw new IndexOutOfBoundsException("index: " + index + " (expected: 0)"); } setSection(section, record); return; } if (records instanceof DnsRecord) { final List<DnsRecord> recordList; if (index == 0) { recordList = newRecordList(); recordList.add(record); recordList.add(castRecord(records)); } else if (index == 1) { recordList = newRecordList(); recordList.add(castRecord(records)); recordList.add(record); } else { throw new IndexOutOfBoundsException("index: " + index + " (expected: 0 or 1)"); } setSection(section, recordList); return; } @SuppressWarnings("unchecked") final List<DnsRecord> recordList = (List<DnsRecord>) records; recordList.add(index, record); }
private void addRecord(int section, DnsRecord record) { checkQuestion(section, record); final Object records = sectionAt(section); if (records == null) { setSection(section, record); return; } if (records instanceof DnsRecord) { final List<DnsRecord> recordList = newRecordList(); recordList.add(castRecord(records)); recordList.add(record); setSection(section, recordList); return; } @SuppressWarnings("unchecked") final List<DnsRecord> recordList = (List<DnsRecord>) records; recordList.add(record); }
private void addRecord(int section, int index, DnsRecord record) { checkQuestion(section, record); final Object records = sectionAt(section); if (records == null) { if (index != 0) { throw new IndexOutOfBoundsException("index: " + index + " (expected: 0)"); } setSection(section, record); return; } if (records instanceof DnsRecord) { final List<DnsRecord> recordList; if (index == 0) { recordList = newRecordList(); recordList.add(record); recordList.add(castRecord(records)); } else if (index == 1) { recordList = newRecordList(); recordList.add(castRecord(records)); recordList.add(record); } else { throw new IndexOutOfBoundsException("index: " + index + " (expected: 0 or 1)"); } setSection(section, recordList); return; } @SuppressWarnings("unchecked") final List<DnsRecord> recordList = (List<DnsRecord>) records; recordList.add(index, record); }
private void addRecord(int section, DnsRecord record) { checkQuestion(section, record); final Object records = sectionAt(section); if (records == null) { setSection(section, record); return; } if (records instanceof DnsRecord) { final List<DnsRecord> recordList = newRecordList(); recordList.add(castRecord(records)); recordList.add(record); setSection(section, recordList); return; } @SuppressWarnings("unchecked") final List<DnsRecord> recordList = (List<DnsRecord>) records; recordList.add(record); }
private void addRecord(int section, int index, DnsRecord record) { checkQuestion(section, record); final Object records = sectionAt(section); if (records == null) { if (index != 0) { throw new IndexOutOfBoundsException("index: " + index + " (expected: 0)"); } setSection(section, record); return; } if (records instanceof DnsRecord) { final List<DnsRecord> recordList; if (index == 0) { recordList = newRecordList(); recordList.add(record); recordList.add(castRecord(records)); } else if (index == 1) { recordList = newRecordList(); recordList.add(castRecord(records)); recordList.add(record); } else { throw new IndexOutOfBoundsException("index: " + index + " (expected: 0 or 1)"); } setSection(section, recordList); return; } @SuppressWarnings("unchecked") final List<DnsRecord> recordList = (List<DnsRecord>) records; recordList.add(index, record); }
private void addRecord(int section, int index, DnsRecord record) { checkQuestion(section, record); final Object records = sectionAt(section); if (records == null) { if (index != 0) { throw new IndexOutOfBoundsException("index: " + index + " (expected: 0)"); } setSection(section, record); return; } if (records instanceof DnsRecord) { final List<DnsRecord> recordList; if (index == 0) { recordList = newRecordList(); recordList.add(record); recordList.add(castRecord(records)); } else if (index == 1) { recordList = newRecordList(); recordList.add(castRecord(records)); recordList.add(record); } else { throw new IndexOutOfBoundsException("index: " + index + " (expected: 0 or 1)"); } setSection(section, recordList); return; } @SuppressWarnings("unchecked") final List<DnsRecord> recordList = (List<DnsRecord>) records; recordList.add(index, record); }
private void addRecord(int section, int index, DnsRecord record) { checkQuestion(section, record); final Object records = sectionAt(section); if (records == null) { if (index != 0) { throw new IndexOutOfBoundsException("index: " + index + " (expected: 0)"); } setSection(section, record); return; } if (records instanceof DnsRecord) { final List<DnsRecord> recordList; if (index == 0) { recordList = newRecordList(); recordList.add(record); recordList.add(castRecord(records)); } else if (index == 1) { recordList = newRecordList(); recordList.add(castRecord(records)); recordList.add(record); } else { throw new IndexOutOfBoundsException("index: " + index + " (expected: 0 or 1)"); } setSection(section, recordList); return; } @SuppressWarnings("unchecked") final List<DnsRecord> recordList = (List<DnsRecord>) records; recordList.add(index, record); }
private void addRecord(int section, DnsRecord record) { checkQuestion(section, record); final Object records = sectionAt(section); if (records == null) { setSection(section, record); return; } if (records instanceof DnsRecord) { final List<DnsRecord> recordList = newRecordList(); recordList.add(castRecord(records)); recordList.add(record); setSection(section, recordList); return; } @SuppressWarnings("unchecked") final List<DnsRecord> recordList = (List<DnsRecord>) records; recordList.add(record); }
private void addRecord(int section, DnsRecord record) { checkQuestion(section, record); final Object records = sectionAt(section); if (records == null) { setSection(section, record); return; } if (records instanceof DnsRecord) { final List<DnsRecord> recordList = newRecordList(); recordList.add(castRecord(records)); recordList.add(record); setSection(section, recordList); return; } @SuppressWarnings("unchecked") final List<DnsRecord> recordList = (List<DnsRecord>) records; recordList.add(record); }
private void addRecord(int section, DnsRecord record) { checkQuestion(section, record); final Object records = sectionAt(section); if (records == null) { setSection(section, record); return; } if (records instanceof DnsRecord) { final List<DnsRecord> recordList = newRecordList(); recordList.add(castRecord(records)); recordList.add(record); setSection(section, recordList); return; } @SuppressWarnings("unchecked") final List<DnsRecord> recordList = (List<DnsRecord>) records; recordList.add(record); }