Alright, the statute in question is 11 U.S.C. 522 and here is a link to the whole statute: https://www.law.cornell.edu/uscode/text/11/522#. Specifically, subsection (b) is where the answer lies and I have provided (b) in full below and underlined and made some comments between the ** ** that I inserted and bolded.
**This section (b)(1) says that a debtor can use either (b)(2) the federal exemptions or (b)(3) state law exemptions, but not both.**
Notwithstanding section 541 of this title, an individual debtor may exempt from property of the estate the property listed in either paragraph (2) or, in the alternative, paragraph (3) of this subsection. In joint cases filed under section 302 of this title and individual cases filed under section301 or 303 of this title by or against debtors who are husband and wife, and whose estates are ordered to be jointly administered under Rule 1015(b) of the Federal Rules of Bankruptcy Procedure, one debtor may not elect to exempt property listed in paragraph (2) and the other debtor elect to exempt property listed in paragraph (3) of this subsection. If the parties cannot agree on the alternative to be elected, they shall be deemed to elect paragraph (2), where such election is permitted under the law of the jurisdiction where the case is filed.
** This section says that the exemptions listed in (d) which is the federal exemptions can be used unless the State law applicable to the debtor under (3)(A) does not allow it. In other words, you need to see what State law applies to you under (3)(A). **
Property listed in this paragraph is property that is specified under subsection (d), unless the State law that is applicable to the debtor under paragraph (3)(A) specifically does not so authorize.
**(3)(A) states which State laws must be used based on your domicile, which you say is Mass., so Mass is the "State law that is applicable to the debtor" in (3)(B) right above.**
(3)Property listed in this paragraph is—(A)subject to subsections (o) and (p), any property that is exempt under Federal law, other than subsection (d) of this section, or State or local law that is applicable on the date of the filing of the petition to the place in which the debtor’s domicile has been located for the 730 days immediately preceding the date of the filing of the petition or if the debtor’s domicile has not been located in a single State for such 730-day period, the place in which the debtor’s domicile was located for 180 days immediately preceding the 730-day period or for a longer portion of such 180-day period than in any other place; (B) any interest in property in which the debtor had, immediately before the commencement of the case, an interest as a tenant by the entirety or joint tenant to the extent that such interest as a tenant by the entirety or joint tenant is exempt from process under applicable nonbankruptcy law; and (C) retirement funds to the extent that those funds are in a fund or account that is exempt from taxation under section 401, 403, 408, 408A, 414, 457, or 501(a) of the Internal Revenue Code of 1986.
**Lastly in the event, under the (3)(A) domicile analysis, if no State qualified, you get to use the federal exemptions listed in 522(d).**
If the effect of the domiciliary requirement under subparagraph (A) is to render the debtor ineligible for any exemption, the debtor may elect to exempt property that is specified under subsection (d).