gye
gye

Reputation: 1414

Upgrade Apache httpcomponents from 4.1.x to 4.3.x

My current java project, which is sort of old, is using Apache httpcomponents jars of version 4.1.x.

Now I would like to introduce some new features into my project, which should use version of 4.3.x.

My questions is how to upgrade the httpcomponents to new version and make sure it wouldn't break the old codes without going through the whole project. (The project is huge, and lots of places depends on old versions).

Could anyone that give ideas of how the httpcomponents APIs have changed over time?

Upvotes: 1

Views: 1263

Answers (2)

ok2c
ok2c

Reputation: 27538

All GA versions of HC 4.x are expected to be fully backward compatible. One should be able to drop 4.3 in place of 4.1 without breaking existing code (*). At the same time deprecated code tends to be regression tested much less rigorously, so it is generally recommended to migrate to non-deprecated functionality after an upgrade.

(*) Some code deprecated prior to 4.0 GA has been removed in 4.2 GA

Upvotes: 3

mkobit
mkobit

Reputation: 47259

The best thing would be to have have some good unit and integration tests that would catch any integration problems. You should also look at the release notes and see if you are dependent upon any behavior that has changed between those minor version changes. There is several sections titled "Incompatible changes" that you should check and see if you depend on the behavior there.

For example, under Release 4.2:

Incompatible changes


[Compared to release version 4.1.4]

The following methods have been deprecated for some time now and have been deleted:

org.apache.http.impl.SocketHttpServerConnection#createHttpDataReceiver(Socket, int, HttpParams) org.apache.http.impl.SocketHttpServerConnection#createHttpDataTransmitter(Socket, int, HttpParams) org.apache.http.protocol.HttpRequestHandlerRegistry#matchUriRequestPattern(String, String)

The following classes have been deprecated for some while now and have been deleted:

org.apache.http.nio.entity.ByteArrayNIOEntity org.apache.http.nio.entity.FileNIOEntity org.apache.http.nio.entity.HttpNIOEntity org.apache.http.nio.entity.StringNIOEntity org.apache.http.nio.protocol.NHttpClientHandlerBase org.apache.http.nio.protocol.NHttpServiceHandlerBase

Since it is only a minor version bump and, I believe, the project follows semantic versioning, there should only be added functionality in a backwards-compatible manner.

Upvotes: 2

Related Questions