if (rr != null && rr.length > 0) {
records = new ArrayList<String>();
for (int i = 0; i < rr.length; i++) {
switch (rr[i].getType()) {
case Type.TXT:
TXTRecord txt = (TXTRecord) rr[i];
if (txt.getStrings().size() == 1) {
// This was required until dnsjava 2.0.6 because dnsjava
// was escaping
// the result like it was doublequoted (JDKIM-7).
// records.add(((String)txt.getStrings().get(0)).replaceAll("\\\\",
// ""));
records.add(((String) txt.getStrings().get(0)));
} else {
StringBuilder sb = new StringBuilder();
for (Iterator<String> it = txt.getStrings()
.iterator(); it.hasNext();) {
String k = it.next();
// This was required until dnsjava 2.0.6 because
// dnsjava was escaping
// the result like it was doublequoted (JDKIM-7).