| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 65 | 2 | 4 | 0.994 | type_declarations |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 66 | 35 | plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaTextViewer.java |
| 2 | 65 | 40 | plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/PropertiesFileViewer.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$
}
}
|
| ||||
/**
* 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$
}
}
|
| |||
/**
* 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 Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#8fdcff20]] | PropertiesFileViewer |
| 1 | 2 | [[#8fdcff20]] | JavaTextViewer |
| 2 | 1 | [[#a0ec69c0]] | PropertiesFileSourceViewerConfiguration |
| 2 | 2 | [[#a0ec69c0]] | JavaSourceViewerConfiguration |
| 3 | 1 | [[#8fdcfa20]] | PropertiesFileMergeViewer |
| 3 | 2 | [[#8fdcfa20]] | JavaMergeViewer |
| 4 | 1 | [[#8fdcfee0]] | setupPropertiesFileDocument |
| 4 | 2 | [[#8fdcfee0]] | setupDocument |