Contact the schools youre applying to directly and figure out your situation. There are deadlines in declaring/switching state residency. Be aware of these things.
This is great advice and really the take home message here. I've been giving advice on this topic for 10 years here and its always the same: check with the school. The school is going to decide whether you meet residency requirements.
To address some of the earlier comments, I think that it's important to understand the entire "residency" issue. It seems confusing and unjust, and it probably is to a certain extent. If you understand how and why this all works, it may help.
First, residency, or "domicile" as we lawyers refer to it, is a matter of fact. You don't "claim" it, you don't file a paper to secure it. Domicile is determined by a person's presence within a state with the intent to remain there indefinitely. The definition of indefinite is very loose and I generally advise that if you aren't living out of a suitcase, you have the intent to stay there. There are some major exceptions. Generally, undergrads are still seen by the law as falling under their parents purview and still could hold on to their parents state of domicile. Of course, the degree of the child's independence could argue against this (e.g. marriage). The case is much less clear for graduate students; they are usually seen as changing domicile to the state of their school. Leeway is given to those taken away from by official government duties (e.g. military, state department officers).
Domicile is really a state of mind which is shown by your actions. If you grow up in Virginia and then move to Maryland and get a job (other than something brief and temporary) you can't maintain your domicile in Virginia simply because you get some mail at your parents house and keep your car registered there.
This brings me to my next issue. People often look at the tests schools use to determine domicile in the wrong way. You'll see a list of things that indicate where you are domiciled (abode, voter registration, driver's license, car registration, bank accounts). These things don't determine your domicile, you do! They merely are evidence of where your ties. It's important to note that often these indicators are incorrect. If you move to another state and get an apartment and start a job, you MUST re-register your car and get a new license. If you don't do this, you can get cited for driving without a license or driving an unregistered motor vehicle (In case you doubt this, I have personally prosecuted people for this).
Finally, this brings up the issue of why you can change your domicile so easily, yet not get the benefit of your new state of residence. Despite Article IV of the Consitution protecting you when moving amongst states, the US Supreme Court has long held that states my force you to meet certain duration requirements before qualifying for certain state benefits. This protects the states' investment in their own education system from carpetbagging. No federal "law" could fix this because those issues are determined by state law. The effect of all this is that an individual like our OP moves to a state where he has yet to achieve full benefits from California, but no longer can recieve benefits from his former home Massachusetts because he is no longer a resident.
Which returns me to my point and that of several previous posters. Although the law is relatively clear on these issues, individual school are empowered to make these decisions. They have been know to stretch the rules quite a bit in compelling cases for people who have strong ties to their state.
I hope this novella helps clear up some of the issues.
Ed