Since it is Hamas that puts its own people in harms way, I disagree that it's collective punishment. In fact since you hold international law in high esteem maybe you'll look up the law on using civilians as human shields. It's Hamas that hides among the civilians(firing rockets, storing weapons, using apartments and homes as bomb/rocket factories etc.). When you take the situation out of context...which you've done...it's easy to make your case. When I put the situation in context your case evaporates. Your argument attempts to give Hamas a "safe zone" to attack Israel, so when the IDF attempt to defend its citizens it would become a crime. Sorry I'm not buying it!
Report: Iran's Culture Ministry refuses to allow Barenboim to perform in Tehran (DPA)
from the article: IDF Chief Rabbi: Troops who show mercy to enemy will be 'damned'