I had a trade route using the military starbase I had built instead of using the nearby economic starbase. When I tried to move my military fleet on the military starbase position in order to defend it from an approaching fleet, I was given the message that if I attack the freighter, it will be a war declaration on the race that owns this freighter.
I answered No to the declaration of war and my ship didn't move on the starbase space. I don't see why my military can't occupy the same space as that freighter as other ships sometimes stack there. After the No answer it should just move on the space and not attack the freighter.