private void handleClinit(JsFunction clinitFunc, JReferenceType chainTo) {
JsStatements statements = clinitFunc.getBody().getStatements();
// self-assign to the null method immediately (to prevent reentrancy)
JsExpression asg = createAssignment(clinitFunc.getName().makeRef(),
nullMethodName.makeRef());
statements.add(0, asg.makeStmt());
if (chainTo != null) {
JMethod chainToMeth = (JMethod) chainTo.methods.get(0);
JsInvocation jsInvocation = new JsInvocation();
JsNameRef qualifier = getName(chainToMeth).makeRef();
jsInvocation.setQualifier(qualifier);