Software is both patentable and copyrightable, so there's no blurry line here. You are trying to say it's blurry, but it's quite clear.
Ultimately, the problem for Oracle is that the APIs are too functional to be eligible for copyright protection, too abstract to be eligible for patent protection, and too generic to be eligible for trademark protection. But that doesn't stop them from trying to get the best features from all the above.