commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <>
Subject [ALL] source compatibility - changes to throws clauses
Date Fri, 01 Apr 2011 01:30:57 GMT
Just discovered that Clirr does not complain if the throws clause of a
method or constructor is changed to add a new Exception.
Seemed like a bug at first, but it's not, because throws clauses are
only checked at compile-time.

So e.g. adding "throws IOException" to a method will not break binary
compatibilty, but of course anyone recompiling against the updated
binary code will get a compiler error (if they don't already handle
the error).

[This is perhaps why some incompatibilities in Math 2.x were not
discovered by Clirr]

The Commons versioning rules require that changes to method signatures
necessitate a major release, so changes to throws clauses mean a major
release is required.

Since this does not affect binary compatibility, AFAICT there is no
technical reason to require a package name change.

A major release generally means that the user will want to make code
changes anyway to take advantage of new features, so I don't see this
as a big problem.
But we should try do document such changes.

Clirr is not sufficient to detect whether a major version change is
required, so perhaps we need some other tool to detect such changes.
(Does anyone know of one?)

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message