Skip to content

Files

Latest commit

 

History

History
17 lines (10 loc) · 452 Bytes

GStringAsMapKey.md

File metadata and controls

17 lines (10 loc) · 452 Bytes

Pattern: GString as map key

Issue: -

Description

A GString should not be used as a map key since its hashcode is not guaranteed to be stable. Consider calling key.toString().

Here is an example of code that produces a violation:

Map map = ["${someRef}" : 'invalid' ]       // violation

Further Reading