CloneSet585


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
25260.980class_body_declaration
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
125596
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/fix/CleanUpRefactoringWizard.java
22545
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/formatter/CompilationUnitPreview.java
Clone Instance
1
Line Count
25
Source Line
596
Source File
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/fix/CleanUpRefactoringWizard.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);
                                  }
                        }


Clone Instance
2
Line Count
25
Source Line
45
Source File
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/formatter/CompilationUnitPreview.java

    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);
                  }
    }


Clone AbstractionParameter Count: 6Parameter Bindings

 [[#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 Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#9df696c0]]
protected 
12[[#9df696c0]]
private 
21[[#9df69660]]
doFormatPreview 
22[[#9df69660]]
format 
31[[#b18c3500]]
() 
32[[#b18c3500]]
(String text) 
41[[#b18c3580]]
fPreviewText 
42[[#b18c3580]]
text 
51[[#a0756d40]]
FormatterMessages 
52[[#a0756d40]]
MultiFixMessages 
61[[#9df69580]]
JavaPreview_formatter_exception 
62[[#9df69580]]
CleanUpRefactoringWizard_formatterException_errorMessage