Nedarim, Chapter Four, Mishnah Five
During the sabbatical (seventh) year, the produce that a persons fields grow is legally ownerless and therefore anyone can enter anyone elses fields and eat what he wishes.
Our mishnah teaches about prohibitive vows and the sabbatical year.
1) He who is forbidden by vow to benefit from his neighbor, [if the vow was imposed] before the seventh year, may not enter his field, nor eat produce that hangs over [from the others property].
2) If [the vow was imposed] in the seventh year, he may not enter his field, but may eat of the produce that hangs over [from the others property].
3) If he was forbidden [merely] in respect of food, [and the vow was imposed] before the seventh year, he may enter his field, but may not eat of its fruits.
4) But [if it was imposed] in the seventh year, he may enter [his field] and eat [of its fruits].
Section one: If Reuven takes a vow that Shimon shall not benefit from his property before the seventh year, Shimon may not enter Reuvens field, because as we learned in mishnah one, when one is forbidden by vow to benefit from another, even walking in his field is forbidden. He may also not eat of the produce that hangs over from the field, even when in the seventh year. Although this produce is now ownerless, and Shimon is not benefiting from Reuven, since this produce was prohibited to Shimon, the seventh year does not make it permitted.
Section two: If the vow was imposed in the seventh year, then Shimon still cannot go onto Reuvens property. However, he may eat of the produce that hangs over the property line since Reuven did not own the produce when the vow was taken, such that he could forbidden it to Shimon.
Section three: If the vow was not prohibitive of all benefit, but just of food, then Shimon may enter Reuvens property. However, if the vow was taken before the sabbatical year, then Shimon may still not eat the food.
Section four: If the vow which only prohibited food was taken on the sabbatical year, Shimon may enter Reuvens property and eat, for the produce was not Reuvens to prohibit.