| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 52 | 2 | 1 | 0.999 | class_body_declarations[2] |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 52 | 341 | plugins/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/DetailFormatterDialog.java |
| 2 | 52 | 776 | plugins/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/EditLogicalStructureDialog.java |
| ||||
/**
* Use the Java search engine to find the type which corresponds
* to the given name.
*/
private void findCorrespondingType() {
if (fTypeSearched) {
return;
}
fType = null;
fTypeSearched = true;
final String pattern = fTypeNameText.getText().trim().replace('$', '.');
if (pattern == null || "".equals(pattern)) { //$NON-NLS-1$
return;
}
final IProgressMonitor monitor = new NullProgressMonitor();
final SearchRequestor collector = new SearchRequestor() {
private boolean fFirst = true;
public void endReporting() {
checkValues();
}
public void acceptSearchMatch(SearchMatch match) throws CoreException {
Object enclosingElement = match.getElement();
if ( !fFirst) {
return;
}
fFirst = false;
if (enclosingElement instanceof IType) {
fType = (IType) enclosingElement;
}
// cancel once we have one match
monitor.setCanceled(true);
}
};
SearchEngine engine = new SearchEngine(JavaCore.getWorkingCopies(null));
SearchPattern searchPattern = SearchPattern.createPattern(pattern, IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_EXACT_MATCH| SearchPattern.R_CASE_SENSITIVE);
IJavaSearchScope scope = SearchEngine.createWorkspaceScope();
SearchParticipant[] participants = new SearchParticipant[] {
SearchEngine.getDefaultSearchParticipant()
};
try {
engine.search(searchPattern, participants, scope, collector, monitor);
} catch (CoreException e) {
JDIDebugUIPlugin.log(e);
}
catch (OperationCanceledException e) {
}
}
/**
* Return the type object which corresponds to the given name.
*/
public IType getType() {
if ( !fTypeSearched) {
findCorrespondingType();
}
return fType;
}
|
| ||||
/**
* Use the Java search engine to find the type which corresponds
* to the given name.
*/
private void findCorrespondingType() {
if (fTypeSearched) {
return;
}
fType = null;
fTypeSearched = true;
final String pattern = fQualifiedTypeNameText.getText().trim().replace('$', '.');
if (pattern == null || "".equals(pattern)) { //$NON-NLS-1$
return;
}
final IProgressMonitor monitor = new NullProgressMonitor();
final SearchRequestor collector = new SearchRequestor() {
private boolean fFirst = true;
public void endReporting() {
checkValues();
}
public void acceptSearchMatch(SearchMatch match) throws CoreException {
Object enclosingElement = match.getElement();
if ( !fFirst) {
return;
}
fFirst = false;
if (enclosingElement instanceof IType) {
fType = (IType) enclosingElement;
}
// stop after we find one
monitor.setCanceled(true);
}
};
SearchEngine engine = new SearchEngine(JavaCore.getWorkingCopies(null));
SearchPattern searchPattern = SearchPattern.createPattern(pattern, IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_EXACT_MATCH| SearchPattern.R_CASE_SENSITIVE);
IJavaSearchScope scope = SearchEngine.createWorkspaceScope();
SearchParticipant[] participants = new SearchParticipant[] {
SearchEngine.getDefaultSearchParticipant()
};
try {
engine.search(searchPattern, participants, scope, collector, monitor);
} catch (CoreException e) {
JDIDebugUIPlugin.log(e);
}
catch (OperationCanceledException e) {
}
}
/**
* Return the type object which corresponds to the given name.
*/
public IType getType() {
if ( !fTypeSearched) {
findCorrespondingType();
}
return fType;
}
|
| |||
/**
* Use the Java search engine to find the type which corresponds
* to the given name.
*/
private void findCorrespondingType() {
if (fTypeSearched) {
return;
}
fType = null;
fTypeSearched = true;
final String pattern = [[#variablea53b87c0]].getText().trim().replace('$', '.');
if (pattern == null || "".equals(pattern)) { //$NON-NLS-1$
return;
}
final IProgressMonitor monitor = new NullProgressMonitor();
final SearchRequestor collector = new SearchRequestor() {
private boolean fFirst = true;
public void endReporting() {
checkValues();
}
public void acceptSearchMatch(SearchMatch match) throws CoreException {
Object enclosingElement = match.getElement();
if ( !fFirst) {
return;
}
fFirst = false;
if (enclosingElement instanceof IType) {
fType = (IType) enclosingElement;
}
// cancel once we have one match
// stop after we find one
monitor.setCanceled(true);
}
};
SearchEngine engine = new SearchEngine(JavaCore.getWorkingCopies(null));
SearchPattern searchPattern = SearchPattern.createPattern(pattern, IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_EXACT_MATCH|SearchPattern.R_CASE_SENSITIVE);
IJavaSearchScope scope = SearchEngine.createWorkspaceScope();
SearchParticipant[] participants = new SearchParticipant[] {
SearchEngine.getDefaultSearchParticipant()
};
try {
engine.search(searchPattern, participants, scope, collector, monitor);
}
catch (CoreException e) {
JDIDebugUIPlugin.log(e);
}
catch (OperationCanceledException e) {
}
}
/**
* Return the type object which corresponds to the given name.
*/
public IType getType() {
if ( !fTypeSearched) {
findCorrespondingType();
}
return fType;
}
|
| CloneAbstraction |
| Parameter Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#a53b87c0]] | fTypeNameText |
| 1 | 2 | [[#a53b87c0]] | fQualifiedTypeNameText |