The Rambam holds if you have something that could cause damage to one's neighbor on the boundary between oneself and his neighbor, but there is nothing there right now, he has to take it away if the neighbor puts something there that could be damaged. This is based on the Gemara Bava Batra page 22. Rava says one can't dig a hole next to the borderline and Abyee says he can. The Gemara asks on Rava from the Mishna מרחיקין את המשרה מן הירק והחרדל מן הדבורים רבי יוסי אומר עד שאתה אומר הרחק חרדלך מדבוראי הרחק דבוריך מן חרדלי שבאות ואוכלות לגלוגי חרדלי ואי לא סמיך היכא משכחת לה רב פפא אמר בלוקח from this it is clear that even to have anything by the boundary in the first place is forbidden--since the law is always like Rava except for yal kegam. But almost all Rishonim say the law is not like Rava except for digging a pit alone. still once there is something the neighbor has put there, he has to take what can cause damage away.
The Rishonim are depending on Ravina who is coming to answer either for Rava or Rav Papa and says על המזיק להרחיק את עצמו How this answers any of the above questions is unclear. But it is the statement of Ravina that makes room for all the opinions that allow one to put something there. and in fact most rihonim hold that it can stay there even after the neighbor has put something there that could be damaged because at that point, the neighbor had to have put his thing farther away.