Prior to 1940, how were Japanese Americans treated by the legal system?

Were they discriminated against? How?