Do I have to recompile my application when I upgrade a third party jar?

后端 未结 5 1121
深忆病人
深忆病人 2020-12-19 21:38

I have a java application that uses some third party API. The third party jar files change fairly frequently because of all kinds of patches, but the API itself does not cha

5条回答
  •  情话喂你
    2020-12-19 22:25

    Another case where a recompilation is theoretically necessary is constants. The value of a constant is literally compiled into the bytecode of classes that use it. If the value is changed in a new version of the API, anything compiled against the old version will continue using the old value, which may lead to different behaviour and very difficult to diagnose bugs.

    Of course, no API designer with an ounce of brain will change the values of public constants if he can avoid it, but there may be cases where it is necessary.

提交回复
热议问题