code-disaster/steamworks4j

should we make every functions in the Callback interfaces have a default empty method?

XenoAmess opened this issue · 3 comments

As the current code cause adding a function into a Callback interface will make every user must change codes.

Thus might cause dependency hell.

example : https://github.com/cyanpotion/cyan_potion/runs/5523216193?check_suite_focus=true

I tried to upgrade from 1.8.0 to 1.9.0 and failed because you added a function into interface SteamUserStatsCallback.

2022-03-12T18:08:41.7062113Z [INFO] -------------------------------------------------------------
2022-03-12T18:08:41.7063614Z [ERROR] /home/runner/work/cyan_potion/cyan_potion/src/base/src/main/java/com/xenoamess/cyan_potion/base/steam/SteamCallbacks.java:[91,75] <anonymous com.xenoamess.cyan_potion.base.steam.SteamCallbacks$1> is not abstract and does not override abstract method onAuthSessionTicket(com.codedisaster.steamworks.SteamAuthTicket,com.codedisaster.steamworks.SteamResult) in com.codedisaster.steamworks.SteamUserCallback
2022-03-12T18:08:41.7067996Z [ERROR] /home/runner/work/cyan_potion/cyan_potion/src/base/src/main/java/com/xenoamess/cyan_potion/base/steam/SteamCallbacks.java:[115,90] <anonymous com.xenoamess.cyan_potion.base.steam.SteamCallbacks$2> is not abstract and does not override abstract method onNumberOfCurrentPlayersReceived(boolean,int) in com.codedisaster.steamworks.SteamUserStatsCallback

If we make default empty functions in such interfaces, then user codes would need not change.

If you are interested I can make the pr for you.

I've seen some advantage in breaking user code (so that you are aware that there's been changes in the interface after a version update), but I see your point. Had to tell the Maven project to upgrade from Java 7 to Java 8 though. 😱