Depends on how the sword is made, what materials are used and temperature used but yes they can shatter.
When molecules cool down they stop vibrating and moving as much and so they "shrink" and the metal of the sword becomes brittle. sometimes they shrink at different phases which cause tension in the sword if this tension is strong enough it can cause the metallic bonds to break causing the sword to shatter.
Caffeine has the following percent composition: carbon 49.48%, hydrogen 5.19%, oxygen 16.48% and nitrogen 28.85%. Its molecular weight is 194.19 g/mol.