IJavaProject javaProject = compilationUnit.getJavaProject();
CodeGenerationSettings settings = JavaPreferencesSettings.getCodeGenerationSettings(javaProject);
MethodDeclaration methodDecl = createNewConstructor(typeDecl, ast);
IMethodBinding constructorBinding = ASTNodes.getMethodBinding(methodDecl.getName());
ITypeBinding typeBinding = ASTNodes.getTypeBinding(typeDecl.getName());
ImportRewriteContext context = new ContextSensitiveImportRewriteContext(typeDecl, importRewrite);
MethodDeclaration stub = StubUtility2.createConstructorStub(compilationUnit, astRewrite, importRewrite,
context, typeBinding, constructorBinding, this.variableBindings, Modifier.PUBLIC, settings);
if (stub != null) {