remulasce / metroapp

Realtime arrival notification utility for LA Metro
2 stars 0 forks source link

Why is StrictMode permitAll set in NotifyService? #241

Closed remulasce closed 9 years ago

remulasce commented 9 years ago

Line 76 public void run() { StrictMode.ThreadPolicy policy = new StrictMode. ThreadPolicy.Builder().permitAll().build(); StrictMode.setThreadPolicy(policy);

Noticed by WillowTree interview code review.

remulasce commented 9 years ago

At one point I was enabling strictmode on the main thread to do actual strictmode testing.

I don't know why this would need to be set, though.

Commenting it out doesn't appear to immediately break anything, but I want to know why it was there in the first place.

remulasce commented 9 years ago

Searching the git logs reveals that StrictMode was enabled in the initial commit to Git, 7 months ago. Since then the NotifyService has been multithreaded and a ton of stuff changed.

So it may be totally unnecessary cruft.

remulasce commented 9 years ago

Reading through log files and testing it out with strictmode commented out suggests the line is unnecessary.

I'm going to remove these lines and commit to the qa branch for testing.