A Bridgewater State University student was arrested Friday after police said he was swinging what appeared to be a long rifle back and forth “in a menacing way” before entering the school’s library. The gun turned out to be a Nerf toy gun. The student was also found to have been carrying a pocketknife, police said.