I'd replace this whole block with :
```
RegExp localeRegex = RegExp.compile("facebooklocale=(.*)", "i");

NodeList<Element> metas = Document.get().getElementsByTagName("meta");
for (int i = 0; i < metas.getLength(); i++) {
    MetaElement m = MetaElement.as(metas.getItem(i));
    if ("gwt:property".equals(m.getName())) {
        MatchResult matchResult = localeRegex.exec(m.getContent());
        if (matchResult != null) {
            locale = matchResult.getGroup(1);
        }
    }
}
```