From: Kocik, W. <wk...@ve...> - 2010-07-22 16:12:18
|
Hi - In the course of working with DNSJava I¹ve encountered two issues which are addressed by the patch below my signature: 1. LOCRecord.java a LOC record with a negative altitude would cause a NumberFormatException from parseFixedPoint() when reading a zone file, because it used a regular expression that did not account for the potential presence of a -¹ character at the beginning of the number 2. ExtendedResolver.java sendAsync() was not using its multiple resolvers to send a message, only the first one on the array. Hopefully my fixes are acceptable, but if they aren¹t I¹ll gladly help find more appropriate solutions. -- Bill Index: org/xbill/DNS/LOCRecord.java =================================================================== --- org/xbill/DNS/LOCRecord.java (revision 205) +++ org/xbill/DNS/LOCRecord.java (revision 207) @@ -76,9 +76,9 @@ private double parseFixedPoint(String s) { - if (s.matches("^\\d+$")) + if (s.matches("^-{0,1}\\d+$")) return Integer.parseInt(s); - else if (s.matches("^\\d+\\.\\d*$")) { + else if (s.matches("^-{0,1}\\d+\\.\\d*$")) { String [] parts = s.split("\\."); double value = Integer.parseInt(parts[0]); double fraction = Integer.parseInt(parts[1]); Index: org/xbill/DNS/ExtendedResolver.java =================================================================== --- org/xbill/DNS/ExtendedResolver.java (revision 205) +++ org/xbill/DNS/ExtendedResolver.java (revision 207) @@ -132,7 +132,9 @@ public void startAsync(ResolverListener listener) { this.listener = listener; - send(0); + for(int i = 0;i < this.resolvers.length;i++) { + send(i); + } } /* |