Source:
<code>private static IFolder getOutputFolder( EObject eobj ) { String projectName = ProjectUtils.getProjectName( eobj ); projectName = projectName + "_CDTProject"; IWorkspaceRoot workspace = ResourcesPlugin.getWorkspace().getRoot(); String rootPath = workspace.getLocation().toOSString(); IProject project = workspace.getProject( projectName ); if (project.exists()) { if (regenerate) { try { project.delete( true, true, null ); } catch (CoreException e) <START> { <END> } } } if (!project.exists()) { boolean result = new CppProjectGenerator().generate( rootPath, projectName ); if (!result) { CodeGenPlugin.error( "Failed to create output project" ); return null; } try { IProjectDescription description = ResourcesPlugin .getWorkspace() .loadProjectDescription( new org.eclipse.core.runtime.Path( rootPath + "/" + projectName + "/.project" ) ); project = ResourcesPlugin.getWorkspace().getRoot() .getProject( description.getName() ); project.create( description, null ); } catch (CoreException e1) { CodeGenPlugin.error( "Failed to create output project" ); } } if (!project.isOpen()) { try { project.open( new NullProgressMonitor() ); } catch (CoreException e) { CodeGenPlugin.error( "Failed to open project" ); } } IFolder folder = project.getFolder( "src" ); try { folder.refreshLocal( IResource.DEPTH_ZERO, null ); } catch (CoreException e) { CodeGenPlugin.error( "could not refresh output folder", e ); } if (!folder.exists()) try { folder.create( true, true, null ); } catch (CoreException e) { CodeGenPlugin.error( "could not create output folder", e ); } return folder; }</code><technical_language>log this exception. is OK continue, error log</technical_language>

Target:
private static IFolder getOutputFolder( EObject eobj ) { String projectName = ProjectUtils.getProjectName( eobj ); projectName = projectName + "_CDTProject"; IWorkspaceRoot workspace = ResourcesPlugin.getWorkspace().getRoot(); String rootPath = workspace.getLocation().toOSString(); IProject project = workspace.getProject( projectName ); if (project.exists()) { if (regenerate) { try { project.delete( true, true, null ); } catch (CoreException e) { CodeGenPlugin.error( "Failed to delete the previously generated project" ); } } } if (!project.exists()) { boolean result = new CppProjectGenerator().generate( rootPath, projectName ); if (!result) { CodeGenPlugin.error( "Failed to create output project" ); return null; } try { IProjectDescription description = ResourcesPlugin .getWorkspace() .loadProjectDescription( new org.eclipse.core.runtime.Path( rootPath + "/" + projectName + "/.project" ) ); project = ResourcesPlugin.getWorkspace().getRoot() .getProject( description.getName() ); project.create( description, null ); } catch (CoreException e1) { CodeGenPlugin.error( "Failed to create output project" ); } } if (!project.isOpen()) { try { project.open( new NullProgressMonitor() ); } catch (CoreException e) { CodeGenPlugin.error( "Failed to open project" ); } } IFolder folder = project.getFolder( "src" ); try { folder.refreshLocal( IResource.DEPTH_ZERO, null ); } catch (CoreException e) { CodeGenPlugin.error( "could not refresh output folder", e ); } if (!folder.exists()) try { folder.create( true, true, null ); } catch (CoreException e) { CodeGenPlugin.error( "could not create output folder", e ); } return folder; }