I believe there is a flaw in the Apache License 2.0 here. If the patent grant only covers the code in question. If this is true, then it not only reinforces software patents, but reinforces implementations too.
My understanding is, that the point is to make sure the users of the code don't have to care about patents. It's a license for the code, not for the patents.