A federal judge has finalized a ruling barring enforcement of a controversial statute that gave the government power to indefinitely detain anyone it considered a terrorism suspect anywhere in the world without charge or trial. 