@@ -206,12 +206,12 @@ record = this.readNode(buffer, record, bit);
206206 * SkipAliasedNetworks option.
207207 *
208208 * @return Networks The Networks iterator.
209- * @throws BadVersionException Exception for using an IPv6 network in ipv4-only database.
209+ * @throws InvalidNetworkException Exception for using an IPv6 network in ipv4-only database.
210210 * @throws ClosedDatabaseException Exception for a closed databased.
211211 * @throws InvalidDatabaseException Exception for an invalid database.
212212 */
213213 public Networks networks () throws
214- BadVersionException , ClosedDatabaseException , InvalidDatabaseException {
214+ InvalidNetworkException , ClosedDatabaseException , InvalidDatabaseException {
215215 return this .networks (true );
216216 }
217217
@@ -224,12 +224,12 @@ public Networks networks() throws
224224 *
225225 * @param skipAliasedNetworks Enable skipping aliased networks.
226226 * @return Networks The Networks iterator.
227- * @throws BadVersionException Exception for using an IPv6 network in ipv4-only database.
227+ * @throws InvalidNetworkException Exception for using an IPv6 network in ipv4-only database.
228228 * @throws ClosedDatabaseException Exception for a closed databased.
229229 * @throws InvalidDatabaseException Exception for an invalid database.
230230 */
231231 public Networks networks (boolean skipAliasedNetworks ) throws
232- BadVersionException , ClosedDatabaseException , InvalidDatabaseException {
232+ InvalidNetworkException , ClosedDatabaseException , InvalidDatabaseException {
233233 try {
234234 InetAddress ipv4 = InetAddress .getByAddress (new byte [4 ]);
235235 InetAddress ipv6 = InetAddress .getByAddress (new byte [16 ]);
@@ -289,15 +289,15 @@ private int findIpV4StartNode(ByteBuffer buffer)
289289 * @param network Specifies the network to be iterated.
290290 * @param skipAliasedNetworks Boolean for skipping aliased networks.
291291 * @return Networks
292- * @throws BadVersionException Exception for using an IPv6 network in ipv4-only database.
292+ * @throws InvalidNetworkException Exception for using an IPv6 network in ipv4-only database.
293293 * @throws ClosedDatabaseException Exception for a closed databased.
294294 * @throws InvalidDatabaseException Exception for an invalid database.
295295 */
296296 public <T > Networks <T > networksWithIn (Network network , boolean skipAliasedNetworks )
297- throws BadVersionException , ClosedDatabaseException , InvalidDatabaseException {
297+ throws InvalidNetworkException , ClosedDatabaseException , InvalidDatabaseException {
298298 InetAddress networkAddress = network .getNetworkAddress ();
299299 if (this .metadata .getIpVersion () == 4 && networkAddress instanceof Inet6Address ) {
300- throw new BadVersionException (networkAddress );
300+ throw new InvalidNetworkException (networkAddress );
301301 }
302302
303303 byte [] ipBytes = networkAddress .getAddress ();
0 commit comments