Skip to content

Commit 02ef4bf

Browse files
oschwaldclaude
andcommitted
Remove serialVersionUID from all exception classes
Exception serialization is rarely needed in client libraries and explicit serialVersionUID creates maintenance burden. Let Java auto-generate appropriate values when serialization is actually needed. This follows modern Java practices where most standard library exceptions also don't include explicit serialVersionUID values. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 64c8435 commit 02ef4bf

File tree

7 files changed

+2
-6
lines changed

7 files changed

+2
-6
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ CHANGELOG
2323
* Updated project to use Java 17 language features including switch expressions
2424
and modern collection factories.
2525
* Updated GitHub Actions workflow to test on Java 17, 21, 22, and 23.
26+
* **BREAKING:** Removed explicit `serialVersionUID` from all exception classes.
27+
Java will auto-generate serialVersionUID when needed, following modern practices.
2628

2729
4.4.0
2830
------------------

src/main/java/com/maxmind/geoip2/exception/AddressNotFoundException.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
*/
77
public final class AddressNotFoundException extends GeoIp2Exception {
88

9-
private static final long serialVersionUID = -639962574626980783L;
109

1110
/**
1211
* @param message A message explaining the cause of the error.

src/main/java/com/maxmind/geoip2/exception/AuthenticationException.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
*/
66
public final class AuthenticationException extends GeoIp2Exception {
77

8-
private static final long serialVersionUID = 2255398691576141427L;
98

109
/**
1110
* @param message A message explaining the cause of the error.

src/main/java/com/maxmind/geoip2/exception/GeoIp2Exception.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
*/
77
public class GeoIp2Exception extends Exception {
88

9-
private static final long serialVersionUID = -1923104535309628719L;
109

1110
/**
1211
* @param message A message describing the reason why the exception was thrown.

src/main/java/com/maxmind/geoip2/exception/HttpException.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
* GeoIp2Exception.
1010
*/
1111
public final class HttpException extends IOException {
12-
private static final long serialVersionUID = -8301101841509056974L;
1312
private final int httpStatus;
1413
private final URI uri;
1514

src/main/java/com/maxmind/geoip2/exception/InvalidRequestException.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
* but the request sent was invalid in some way.
99
*/
1010
public final class InvalidRequestException extends GeoIp2Exception {
11-
private static final long serialVersionUID = 8662062420258379643L;
1211
private final String code;
1312
private final URI uri;
1413

src/main/java/com/maxmind/geoip2/exception/OutOfQueriesException.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
* remaining for the called service.
66
*/
77
public final class OutOfQueriesException extends GeoIp2Exception {
8-
private static final long serialVersionUID = 3843736987256336967L;
98

109
/**
1110
* @param message A message explaining the cause of the error.

0 commit comments

Comments
 (0)