posted 14 years ago
No, I'd say the code is pretty broken. It looks like it connects twice, no matter what.
The methods that make the connection and do the processing should be refactored, since they're exactly the same, except for the URL.
You also check the statusCode for a specific value (using a constant, which is good), but then try to use it in a switch statement that has values other than that which you just compared it to (using non-constants, which is bad), which makes no sense.
That's what sticks out at me the most.