Skip to content

Commit 4c6d19c

Browse files
oschwaldclaude
andcommitted
Fix incorrect type names and descriptions in Javadoc
Correct several @return tags that named nonexistent or wrong types: ConnectTypeResponse -> ConnectionTypeResponse, IPRiskResponse -> IpRiskResponse, and IspResponse -> AsnResponse on the GeoLite ASN lookup methods. Also fix the fileMode() Javadoc, which referred to initializing the Builder with a URL rather than an InputStream, and remove stray return-value text from a tryIsp() @param description. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 211330c commit 4c6d19c

2 files changed

Lines changed: 12 additions & 11 deletions

File tree

src/main/java/com/maxmind/geoip2/DatabaseProvider.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ IpRiskResponse ipRisk(InetAddress ipAddress) throws IOException,
9797
* Look up an IP address in a GeoIP IP Risk database.
9898
*
9999
* @param ipAddress IPv4 or IPv6 address to lookup.
100-
* @return an IPRiskResponse for the requested IP address or empty if it is not in the DB.
100+
* @return an IpRiskResponse for the requested IP address or empty if it is not in the DB.
101101
* @throws com.maxmind.geoip2.exception.GeoIp2Exception if there is an error looking up the IP
102102
* @throws java.io.IOException if there is an IO error
103103
*/
@@ -108,7 +108,7 @@ Optional<IpRiskResponse> tryIpRisk(InetAddress ipAddress) throws IOException,
108108
* Look up an IP address in a GeoLite ASN database.
109109
*
110110
* @param ipAddress IPv4 or IPv6 address to lookup.
111-
* @return an IspResponse for the requested IP address.
111+
* @return an AsnResponse for the requested IP address.
112112
* @throws com.maxmind.geoip2.exception.GeoIp2Exception if there is an error looking up the IP
113113
* @throws java.io.IOException if there is an IO error
114114
*/
@@ -119,7 +119,7 @@ AsnResponse asn(InetAddress ipAddress) throws IOException,
119119
* Look up an IP address in a GeoLite ASN database.
120120
*
121121
* @param ipAddress IPv4 or IPv6 address to lookup.
122-
* @return an IspResponse for the requested IP address or empty if it is not in the DB.
122+
* @return an AsnResponse for the requested IP address or empty if it is not in the DB.
123123
* @throws com.maxmind.geoip2.exception.GeoIp2Exception if there is an error looking up the IP
124124
* @throws java.io.IOException if there is an IO error
125125
*/
@@ -130,7 +130,7 @@ Optional<AsnResponse> tryAsn(InetAddress ipAddress) throws IOException,
130130
* Look up an IP address in a GeoIP Connection Type database.
131131
*
132132
* @param ipAddress IPv4 or IPv6 address to lookup.
133-
* @return a ConnectTypeResponse for the requested IP address.
133+
* @return a ConnectionTypeResponse for the requested IP address.
134134
* @throws com.maxmind.geoip2.exception.GeoIp2Exception if there is an error looking up the IP
135135
* @throws java.io.IOException if there is an IO error
136136
*/
@@ -141,7 +141,8 @@ ConnectionTypeResponse connectionType(InetAddress ipAddress)
141141
* Look up an IP address in a GeoIP Connection Type database.
142142
*
143143
* @param ipAddress IPv4 or IPv6 address to lookup.
144-
* @return a ConnectTypeResponse for the requested IP address or empty if it is not in the DB.
144+
* @return a ConnectionTypeResponse for the requested IP address or empty if it
145+
* is not in the DB.
145146
* @throws com.maxmind.geoip2.exception.GeoIp2Exception if there is an error looking up the IP
146147
* @throws java.io.IOException if there is an IO error
147148
*/
@@ -206,7 +207,7 @@ IspResponse isp(InetAddress ipAddress) throws IOException,
206207
/**
207208
* Look up an IP address in a GeoIP ISP database.
208209
*
209-
* @param ipAddress IPv4 or IPv6 address to look up or empty if it is not in the DB.
210+
* @param ipAddress IPv4 or IPv6 address to look up.
210211
* @return an IspResponse for the requested IP address.
211212
* @throws com.maxmind.geoip2.exception.GeoIp2Exception if there is an error looking up the IP
212213
* @throws java.io.IOException if there is an IO error

src/main/java/com/maxmind/geoip2/DatabaseReader.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,9 @@ public Builder withCache(NodeCache cache) {
214214
/**
215215
* @param val The file mode used to open the GeoIP database
216216
* @return Builder object
217-
* @throws java.lang.IllegalArgumentException if you initialized the Builder with a URL,
218-
* which uses {@link FileMode#MEMORY}, but you
219-
* provided a different FileMode to this method.
217+
* @throws java.lang.IllegalArgumentException if you initialized the Builder
218+
* with an InputStream, which uses {@link FileMode#MEMORY}, but you
219+
* provided a different FileMode to this method.
220220
*/
221221
public Builder fileMode(FileMode val) {
222222
if (this.stream != null && FileMode.MEMORY != val) {
@@ -410,7 +410,7 @@ public Optional<AnonymousPlusResponse> tryAnonymousPlus(InetAddress ipAddress)
410410
* Look up an IP address in a GeoIP IP Risk database.
411411
*
412412
* @param ipAddress IPv4 or IPv6 address to lookup.
413-
* @return a IPRiskResponse for the requested IP address.
413+
* @return an IpRiskResponse for the requested IP address.
414414
* @throws GeoIp2Exception if there is an error looking up the IP
415415
* @throws IOException if there is an IO error
416416
*/
@@ -454,7 +454,7 @@ public Optional<AsnResponse> tryAsn(InetAddress ipAddress) throws IOException,
454454
* Look up an IP address in a GeoIP Connection Type database.
455455
*
456456
* @param ipAddress IPv4 or IPv6 address to lookup.
457-
* @return a ConnectTypeResponse for the requested IP address.
457+
* @return a ConnectionTypeResponse for the requested IP address.
458458
* @throws GeoIp2Exception if there is an error looking up the IP
459459
* @throws IOException if there is an IO error
460460
*/

0 commit comments

Comments
 (0)