The ICJ’s decision included within it a separate declaration by the US justice Buergenthal. In it, he literally says:
”Paragraph 6 of Article 49 of the Fourth Geneva Convention also does not admit for exceptions on grounds of military or security exigencies. It provides that “the Occupying Power shall not deport or transfer parts of its own civilian population into the territory it occupies”. I agree that this provision applies to the Israeli settlements in the West Bank and that their existence violates Article 49, paragraph 6. It follows that the segments of the wall being built by Israel to protect the settlements are ipso facto in violation of international humanitarian law. Moreover, given the demonstrable great hardship to which the affected Palestinian population is being subjected in and around the enclaves created by those segments of the wall, I seriously doubt that the wall would here satisfy the proportionality requirement to qualify as a legitimate measure of self-defence.”
It is a logical impossibility to separate what Israel is allowed to do regarding the settlements and with the occupied territories. Again, this all traces back to the Partition Resolution/Green lines and all that wonderful stuff. There is no provision in international law that legitimizes permanent military occupation in those territories. That’s the thing about occupations: they’re temporary. They are supposed to end. When they do not end, they are not occupations. When they do not end, they are annexations. Occupations, as I said before, do become illegal when it’s been determined that the occupier isn’t making good faith efforts to resolve the issue. Israel has made no such effort to the Palestinians since June 4 1967. They were forced to with Egypt, and Egypt has since ceased all hostilities. Gee, I wonder why.
Regarding what you said about signing a treaty not affecting international law, that’s true but it has nothing to do with the real world. Such a treaty would be a mutual proposition and mutual alterations to territorial integrity is certainly valid. But that’s not what’s happening here. The competing claims that the two parties have are that 1) there’s what the Palestinians are entitled to under current existing law (which is the partition resolution) and 2) there’s also what Israel wants. In a legal arena, even one as screwy as international law, what one party is entitled to trumps what another party wants if they’re talking about the same things (pieces of land in this case).