BOSTON — Massachusetts highest court has ruled that a judge must consider a defendant’s financial resources when setting bail.

Friday’s decision follows an appeal by Jahmal Brangan, who has been held at the Hampden County jail since January, 2014 because he’s been unable to post the bail ordered by a Superior Court judge.

Brangan was arrested and indicted for armed robbery.

The Massachusetts Supreme Judicial Court ruled a judge must consider a defendant’s financial resources when setting bail but isn’t required to set bail in an amount affordable to the defendant if the higher bail is needed to ensure the individual’s appearance at trail.

The court also ruled that in such cases a judge must provide “written or orally recorded findings of fact and a statement of reasons for the bail decision.”