String packageName = getPackageName(x.getName());
JsExpression rhs;
if (packageName != null) {
// use "com.example.foo." + "Foo"
JsName name = (JsName) packageNames.get(packageName);
rhs = new JsBinaryOperation(JsBinaryOperator.ADD, name.makeRef(),
jsProgram.getStringLiteral(className));
} else {
// no package name could be split, just use the full name
rhs = jsProgram.getStringLiteral(x.getName());
}