1

I have an old application that seems to be written in java 1.4 or 1.3. and i am migrating ir to 1.7. The issue is that it is using HttpURLConnection kac.get(URL) while the new signature is kac.get(URL,Object). Can someone explain me how to use this method? Can i pass it kac.get(URL,URL)?

Sorry, i meant KeepAliveCache, HttpURLConnection has an instance of it.

user1249212
  • 333
  • 2
  • 5
  • 12

1 Answers1

1

KeepAliveCache is a sun.* class that shouldn't have been used in the first place, for exactly the reason you have encountered: it is an implementation-private class whose API is subject to change without notice. Just remove it and use what's provided in java.net. It does connection pooling and all that for you automatically. No need to peer under the hood. You'll improve code quality and probably fix bugs too.

user207421
  • 305,947
  • 44
  • 307
  • 483