CloneSet297


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
65240.994type_declarations
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
16635
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaTextViewer.java
26540
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/PropertiesFileViewer.java
Clone Instance
1
Line Count
66
Source Line
35
Source File
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaTextViewer.java

public class JavaTextViewer extends Viewer {

        private SourceViewer fSourceViewer;

        private Object fInput;

        JavaTextViewer(Composite parent) {
                fSourceViewer = new SourceViewer(parent, null, SWT.LEFT_TO_RIGHT|  SWT.H_SCROLL|  SWT.V_SCROLL);
                JavaTextTools tools = JavaCompareUtilities.getJavaTextTools();
                if (tools != null) {
                        IPreferenceStore store = JavaPlugin.getDefault().getCombinedPreferenceStore();
                        fSourceViewer.configure(new JavaSourceViewerConfiguration(tools.getColorManager(), store, null, null));
                }

                fSourceViewer.setEditable(false);

                String symbolicFontName = JavaMergeViewer.class .getName();
                Font font = JFaceResources.getFont(symbolicFontName);
                if (font != null)
                        fSourceViewer.getTextWidget().setFont(font);
        }


        public Control getControl() {
                return fSourceViewer.getControl();
        }

        public void setInput(Object input) {

                if (input instanceof IStreamContentAccessor) {
                        Document document = new Document(getString(input));
                        JavaCompareUtilities.setupDocument(document);
                        fSourceViewer.setDocument(document);
                }
                fInput = input;
        }

        public Object getInput() {
                return fInput;
        }

        public ISelection getSelection() {
                return null;
        }

        public void setSelection(ISelection s, boolean reveal) {
        }

        public void refresh() {
        }

        /**
         * A helper method to retrieve the contents of the given object
         * if it implements the IStreamContentAccessor interface.
         */
        private static String getString(Object input) {

                if (input instanceof IStreamContentAccessor) {
                        IStreamContentAccessor sca = (IStreamContentAccessor) input;
                        try {
                                return JavaCompareUtilities.readString(sca);
                        } catch (CoreException ex) {
                                JavaPlugin.log(ex);
                          }
                }
                return ""; //$NON-NLS-1$
        }
}




Clone Instance
2
Line Count
65
Source Line
40
Source File
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/PropertiesFileViewer.java

/**
 * Properties file viewer. 
 * 
 * @since 3.1
 */
public class PropertiesFileViewer extends Viewer {

        private SourceViewer fSourceViewer;

        private Object fInput;

        PropertiesFileViewer(Composite parent) {
                fSourceViewer = new SourceViewer(parent, null, SWT.LEFT_TO_RIGHT|  SWT.H_SCROLL|  SWT.V_SCROLL);
                JavaTextTools tools = JavaCompareUtilities.getJavaTextTools();
                if (tools != null) {
                        IPreferenceStore store = JavaPlugin.getDefault().getCombinedPreferenceStore();
                        fSourceViewer.configure(new PropertiesFileSourceViewerConfiguration(tools.getColorManager(), store, null, null));
                }

                fSourceViewer.setEditable(false);

                String symbolicFontName = PropertiesFileMergeViewer.class .getName();
                Font font = JFaceResources.getFont(symbolicFontName);
                if (font != null)
                        fSourceViewer.getTextWidget().setFont(font);
        }

        public Control getControl() {
                return fSourceViewer.getControl();
        }

        public void setInput(Object input) {

                if (input instanceof IStreamContentAccessor) {
                        Document document = new Document(getString(input));
                        JavaCompareUtilities.setupPropertiesFileDocument(document);
                        fSourceViewer.setDocument(document);
                }
                fInput = input;
        }

        public Object getInput() {
                return fInput;
        }

        public ISelection getSelection() {
                return null;
        }

        public void setSelection(ISelection s, boolean reveal) {
        }

        public void refresh() {
        }

        /**
         * A helper method to retrieve the contents of the given object
         * if it implements the IStreamContentAccessor interface.
         */
        private static String getString(Object input) {

                if (input instanceof IStreamContentAccessor) {
                        IStreamContentAccessor sca = (IStreamContentAccessor) input;
                        try {
                                return JavaCompareUtilities.readString(sca);
                        } catch (CoreException ex) {
                                JavaPlugin.log(ex);
                          }
                }
                return ""; //$NON-NLS-1$
        }
}




Clone AbstractionParameter Count: 4Parameter Bindings

/**
 * Properties file viewer. 
 * 
 * @since 3.1
 */
public class [[#variable8fdcff20]]extends Viewer {
  private SourceViewer fSourceViewer;

  private Object fInput;

   [[#variable8fdcff20]](Composite parent) {
    fSourceViewer = new SourceViewer(parent, null, SWT.LEFT_TO_RIGHT|SWT.H_SCROLL|SWT.V_SCROLL);
    JavaTextTools tools = JavaCompareUtilities.getJavaTextTools();
    if (tools != null) {
      IPreferenceStore store = JavaPlugin.getDefault().getCombinedPreferenceStore();
      fSourceViewer.configure(new [[#variablea0ec69c0]](tools.getColorManager(), store, null, null));
    }
    fSourceViewer.setEditable(false);
    String symbolicFontName = [[#variable8fdcfa20]].class .getName();
    Font font = JFaceResources.getFont(symbolicFontName);
    if (font != null)
      fSourceViewer.getTextWidget().setFont(font);
  }

  public Control getControl() {
    return fSourceViewer.getControl();
  }

  public void setInput(Object input) {
    if (input instanceof IStreamContentAccessor) {
      Document document = new Document(getString(input));
      JavaCompareUtilities. [[#variable8fdcfee0]](document);
      fSourceViewer.setDocument(document);
    }
    fInput = input;
  }

  public Object getInput() {
    return fInput;
  }

  public ISelection getSelection() {
    return null;
  }

  public void setSelection(ISelection s, boolean reveal) {
  }

  public void refresh() {
  }

  /**
           * A helper method to retrieve the contents of the given object
           * if it implements the IStreamContentAccessor interface.
           */
  private static String getString(Object input) {
    if (input instanceof IStreamContentAccessor) {
      IStreamContentAccessor sca = (IStreamContentAccessor) input;
      try {
        return JavaCompareUtilities.readString(sca);
      }
      catch (CoreException ex) {
        JavaPlugin.log(ex);
      }
    }
    return ""; //$NON-NLS-1$
  }
}


 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#8fdcff20]]
PropertiesFileViewer 
12[[#8fdcff20]]
JavaTextViewer 
21[[#a0ec69c0]]
PropertiesFileSourceViewerConfiguration 
22[[#a0ec69c0]]
JavaSourceViewerConfiguration 
31[[#8fdcfa20]]
PropertiesFileMergeViewer 
32[[#8fdcfa20]]
JavaMergeViewer 
41[[#8fdcfee0]]
setupPropertiesFileDocument 
42[[#8fdcfee0]]
setupDocument