Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
25 | 2 | 6 | 0.980 | class_body_declaration |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 25 | 596 | plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/fix/CleanUpRefactoringWizard.java |
2 | 25 | 45 | plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/formatter/CompilationUnitPreview.java |
| ||||
private void format(String text) { if (text == null) { fPreviewDocument.set(""); //$NON-NLS-1$ return; } fPreviewDocument.set(text); fSourceViewer.setRedraw(false); final IFormattingContext context = new CommentFormattingContext(); try { final IContentFormatter formatter = fViewerConfiguration.getContentFormatter(fSourceViewer); if (formatter instanceof IContentFormatterExtension) { final IContentFormatterExtension extension = (IContentFormatterExtension) formatter; context.setProperty(FormattingContextProperties.CONTEXT_PREFERENCES, fWorkingValues); context.setProperty(FormattingContextProperties.CONTEXT_DOCUMENT, Boolean.valueOf(true)); extension.format(fPreviewDocument, context); } else formatter.format(fPreviewDocument, new Region(0, fPreviewDocument.getLength())); } catch (Exception e) { final IStatus status = new Status(IStatus.ERROR, JavaPlugin.getPluginId(), IJavaStatusConstants.INTERNAL_ERROR, MultiFixMessages.CleanUpRefactoringWizard_formatterException_errorMessage, e); JavaPlugin.log(status); } finally { context.dispose(); fSourceViewer.setRedraw(true); } } |
| ||||
protected void doFormatPreview() { if (fPreviewText == null) { fPreviewDocument.set(""); //$NON-NLS-1$ return; } fPreviewDocument.set(fPreviewText); fSourceViewer.setRedraw(false); final IFormattingContext context = new CommentFormattingContext(); try { final IContentFormatter formatter = fViewerConfiguration.getContentFormatter(fSourceViewer); if (formatter instanceof IContentFormatterExtension) { final IContentFormatterExtension extension = (IContentFormatterExtension) formatter; context.setProperty(FormattingContextProperties.CONTEXT_PREFERENCES, fWorkingValues); context.setProperty(FormattingContextProperties.CONTEXT_DOCUMENT, Boolean.valueOf(true)); extension.format(fPreviewDocument, context); } else formatter.format(fPreviewDocument, new Region(0, fPreviewDocument.getLength())); } catch (Exception e) { final IStatus status = new Status(IStatus.ERROR, JavaPlugin.getPluginId(), IJavaStatusConstants.INTERNAL_ERROR, FormatterMessages.JavaPreview_formatter_exception, e); JavaPlugin.log(status); } finally { context.dispose(); fSourceViewer.setRedraw(true); } } |
| |||
[[#variable9df696c0]]void [[#variable9df69660]] [[#variableb18c3500]]{ if ( [[#variableb18c3580]]== null) { fPreviewDocument.set(""); //$NON-NLS-1$ return; } fPreviewDocument.set( [[#variableb18c3580]]); fSourceViewer.setRedraw(false); final IFormattingContext context = new CommentFormattingContext(); try { final IContentFormatter formatter = fViewerConfiguration.getContentFormatter(fSourceViewer); if (formatter instanceof IContentFormatterExtension) { final IContentFormatterExtension extension = (IContentFormatterExtension) formatter; context.setProperty(FormattingContextProperties.CONTEXT_PREFERENCES, fWorkingValues); context.setProperty(FormattingContextProperties.CONTEXT_DOCUMENT, Boolean.valueOf(true)); extension.format(fPreviewDocument, context); } else formatter.format(fPreviewDocument, new Region(0, fPreviewDocument.getLength())); } catch (Exception e) { final IStatus status = new Status(IStatus.ERROR, JavaPlugin.getPluginId(), IJavaStatusConstants.INTERNAL_ERROR, [[#variablea0756d40]]. [[#variable9df69580]], e); JavaPlugin.log(status); } finally { context.dispose(); fSourceViewer.setRedraw(true); } } |
CloneAbstraction |
Parameter Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#9df696c0]] | protected |
1 | 2 | [[#9df696c0]] | private |
2 | 1 | [[#9df69660]] | doFormatPreview |
2 | 2 | [[#9df69660]] | format |
3 | 1 | [[#b18c3500]] | () |
3 | 2 | [[#b18c3500]] | (String text) |
4 | 1 | [[#b18c3580]] | fPreviewText |
4 | 2 | [[#b18c3580]] | text |
5 | 1 | [[#a0756d40]] | FormatterMessages |
5 | 2 | [[#a0756d40]] | MultiFixMessages |
6 | 1 | [[#9df69580]] | JavaPreview_formatter_exception |
6 | 2 | [[#9df69580]] | CleanUpRefactoringWizard_formatterException_errorMessage |