| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 160 | 2 | 2 | 0.967 | class_body_declarations[13] |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 160 | 755 | plugins/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryType.java |
| 2 | 184 | 611 | plugins/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceType.java |
| ||||
/*
* @see IType
*/
public ITypeHierarchy loadTypeHierachy(InputStream input, IProgressMonitor monitor) throws JavaModelException {
return loadTypeHierachy(input, DefaultWorkingCopyOwner.PRIMARY, monitor);
}
/*
* @see IType
*/
public ITypeHierarchy loadTypeHierachy(InputStream input, WorkingCopyOwner owner, IProgressMonitor monitor) throws JavaModelException {
return TypeHierarchy.load(this, input, owner);
}
/*
* @see IType#newSupertypeHierarchy(IProgressMonitor monitor)
*/
public ITypeHierarchy newSupertypeHierarchy(IProgressMonitor monitor) throws JavaModelException {
return this.newSupertypeHierarchy(DefaultWorkingCopyOwner.PRIMARY, monitor);
}
/*
*@see IType#newSupertypeHierarchy(ICompilationUnit[], IProgressMonitor monitor)
*/
public ITypeHierarchy newSupertypeHierarchy(
ICompilationUnit[] workingCopies,
IProgressMonitor monitor ) throws
JavaModelException {
CreateTypeHierarchyOperation op = new CreateTypeHierarchyOperation(this, workingCopies, SearchEngine.createWorkspaceScope(), false);
op.runOperation(monitor);
return op.getResult();
}
/**
* @param workingCopies the working copies that take precedence over their original compilation units
* @param monitor the given progress monitor
* @return a type hierarchy for this type containing this type and all of its supertypes
* @exception JavaModelException if this element does not exist or if an
* exception occurs while accessing its corresponding resource.
*
* @see IType#newSupertypeHierarchy(IWorkingCopy[], IProgressMonitor)
* @deprecated
*/
public ITypeHierarchy newSupertypeHierarchy(
IWorkingCopy[] workingCopies,
IProgressMonitor monitor ) throws
JavaModelException {
ICompilationUnit[] copies;
if (workingCopies == null) {
copies = null;
}
else {
int length = workingCopies.length;
System.arraycopy(workingCopies, 0, copies = new ICompilationUnit[length], 0, length);
}
return newSupertypeHierarchy(copies, monitor);
}
/*
* @see IType#newSupertypeHierarchy(WorkingCopyOwner, IProgressMonitor)
*/
public ITypeHierarchy newSupertypeHierarchy(
WorkingCopyOwner owner,
IProgressMonitor monitor ) throws
JavaModelException {
ICompilationUnit[] workingCopies = JavaModelManager.getJavaModelManager().getWorkingCopies(owner, true
/*add primary working copies*/
);
CreateTypeHierarchyOperation op = new CreateTypeHierarchyOperation(this, workingCopies, SearchEngine.createWorkspaceScope(), false);
op.runOperation(monitor);
return op.getResult();
}
/*
* @see IType#newTypeHierarchy(IJavaProject, IProgressMonitor)
*/
public ITypeHierarchy newTypeHierarchy(IJavaProject project, IProgressMonitor monitor) throws JavaModelException {
return newTypeHierarchy(project, DefaultWorkingCopyOwner.PRIMARY, monitor);
}
/*
* @see IType#newTypeHierarchy(IJavaProject, WorkingCopyOwner, IProgressMonitor)
*/
public ITypeHierarchy newTypeHierarchy(IJavaProject project, WorkingCopyOwner owner, IProgressMonitor monitor) throws JavaModelException {
if (project == null) {
throw new IllegalArgumentException(Messages.hierarchy_nullProject);
}
ICompilationUnit[] workingCopies = JavaModelManager.getJavaModelManager().getWorkingCopies(owner, true
/*add primary working copies*/
);
ICompilationUnit[] projectWCs = null;
if (workingCopies != null) {
int length = workingCopies.length;
projectWCs = new ICompilationUnit[length];
int index = 0;
for (int i = 0; i < length; i++) {
ICompilationUnit wc = workingCopies[i];
if (project.equals(wc.getJavaProject())) {
projectWCs[index++ ] = wc;
}
}
if (index != length) {
System.arraycopy(projectWCs, 0, projectWCs = new ICompilationUnit[index], 0, index);
}
}
CreateTypeHierarchyOperation op = new CreateTypeHierarchyOperation(
this,
projectWCs,
project,
true );
op.runOperation(monitor);
return op.getResult();
}
/**
* @param monitor the given progress monitor
* @exception JavaModelException if this element does not exist or if an
* exception occurs while accessing its corresponding resource.
* @return a type hierarchy for this type containing
*
* @see IType#newTypeHierarchy(IProgressMonitor monitor)
* @deprecated
*/
public ITypeHierarchy newTypeHierarchy(IProgressMonitor monitor) throws JavaModelException {
return newTypeHierarchy((IWorkingCopy[]) null, monitor);
}
/*
* @see IType#newTypeHierarchy(ICompilationUnit[], IProgressMonitor)
*/
public ITypeHierarchy newTypeHierarchy(
ICompilationUnit[] workingCopies,
IProgressMonitor monitor ) throws
JavaModelException {
CreateTypeHierarchyOperation op = new CreateTypeHierarchyOperation(this, workingCopies, SearchEngine.createWorkspaceScope(), true);
op.runOperation(monitor);
return op.getResult();
}
/**
* @see IType#newTypeHierarchy(IWorkingCopy[], IProgressMonitor)
* @deprecated
*/
public ITypeHierarchy newTypeHierarchy(
IWorkingCopy[] workingCopies,
IProgressMonitor monitor ) throws
JavaModelException {
ICompilationUnit[] copies;
if (workingCopies == null) {
copies = null;
}
else {
int length = workingCopies.length;
System.arraycopy(workingCopies, 0, copies = new ICompilationUnit[length], 0, length);
}
return newTypeHierarchy(copies, monitor);
}
/*
* @see IType#newTypeHierarchy(WorkingCopyOwner, IProgressMonitor)
*/
public ITypeHierarchy newTypeHierarchy(
WorkingCopyOwner owner,
IProgressMonitor monitor ) throws
JavaModelException {
ICompilationUnit[] workingCopies = JavaModelManager.getJavaModelManager().getWorkingCopies(owner, true
/*add primary working copies*/
);
CreateTypeHierarchyOperation op = new CreateTypeHierarchyOperation(this, workingCopies, SearchEngine.createWorkspaceScope(), true);
op.runOperation(monitor);
return op.getResult();
}
public JavaElement resolved(Binding binding) {
SourceRefElement resolvedHandle = new ResolvedBinaryType(this.parent, this.name, new String(binding.computeUniqueKey()));
resolvedHandle.occurrenceCount = this.occurrenceCount;
return resolvedHandle;
}
|
| ||||
/**
* @see IType
*/
public ITypeHierarchy loadTypeHierachy(InputStream input, IProgressMonitor monitor) throws JavaModelException {
return loadTypeHierachy(input, DefaultWorkingCopyOwner.PRIMARY, monitor);
}
/**
* NOTE: This method is not part of the API has it is not clear clients would easily use it: they would need to
* first make sure all working copies for the given owner exist before calling it. This is especially har at startup
* time.
* In case clients want this API, here is how it should be specified:
* <p>
* Loads a previously saved ITypeHierarchy from an input stream. A type hierarchy can
* be stored using ITypeHierachy#store(OutputStream). A compilation unit of a
* loaded type has the given owner if such a working copy exists, otherwise the type's
* compilation unit is a primary compilation unit.
*
* Only hierarchies originally created by the following methods can be loaded:
* <ul>
* <li>IType#newSupertypeHierarchy(IProgressMonitor)</li>
* <li>IType#newSupertypeHierarchy(WorkingCopyOwner, IProgressMonitor)</li>
* <li>IType#newTypeHierarchy(IJavaProject, IProgressMonitor)</li>
* <li>IType#newTypeHierarchy(IJavaProject, WorkingCopyOwner, IProgressMonitor)</li>
* <li>IType#newTypeHierarchy(IProgressMonitor)</li>
* <li>IType#newTypeHierarchy(WorkingCopyOwner, IProgressMonitor)</li>
* </u>
*
* @param input stream where hierarchy will be read
* @param monitor the given progress monitor
* @return the stored hierarchy
* @exception JavaModelException if the hierarchy could not be restored, reasons include:
* - type is not the focus of the hierarchy or
* - unable to read the input stream (wrong format, IOException during reading, ...)
* @see ITypeHierarchy#store(java.io.OutputStream, IProgressMonitor)
* @since 3.0
*/
public ITypeHierarchy loadTypeHierachy(InputStream input, WorkingCopyOwner owner, IProgressMonitor monitor) throws JavaModelException {
// TODO monitor should be passed to TypeHierarchy.load(...)
return TypeHierarchy.load(this, input, owner);
}
/**
* @see IType
*/
public ITypeHierarchy newSupertypeHierarchy(IProgressMonitor monitor) throws JavaModelException {
return this.newSupertypeHierarchy(DefaultWorkingCopyOwner.PRIMARY, monitor);
}
/*
* @see IType#newSupertypeHierarchy(ICompilationUnit[], IProgressMonitor)
*/
public ITypeHierarchy newSupertypeHierarchy(
ICompilationUnit[] workingCopies,
IProgressMonitor monitor ) throws
JavaModelException {
CreateTypeHierarchyOperation op = new CreateTypeHierarchyOperation(this, workingCopies, SearchEngine.createWorkspaceScope(), false);
op.runOperation(monitor);
return op.getResult();
}
/**
* @param workingCopies the working copies that take precedence over their original compilation units
* @param monitor the given progress monitor
* @return a type hierarchy for this type containing this type and all of its supertypes
* @exception JavaModelException if this element does not exist or if an
* exception occurs while accessing its corresponding resource.
*
* @see IType#newSupertypeHierarchy(IWorkingCopy[], IProgressMonitor)
* @deprecated
*/
public ITypeHierarchy newSupertypeHierarchy(
IWorkingCopy[] workingCopies,
IProgressMonitor monitor ) throws
JavaModelException {
ICompilationUnit[] copies;
if (workingCopies == null) {
copies = null;
}
else {
int length = workingCopies.length;
System.arraycopy(workingCopies, 0, copies = new ICompilationUnit[length], 0, length);
}
return newSupertypeHierarchy(copies, monitor);
}
/**
* @see IType#newSupertypeHierarchy(WorkingCopyOwner, IProgressMonitor)
*/
public ITypeHierarchy newSupertypeHierarchy(
WorkingCopyOwner owner,
IProgressMonitor monitor ) throws
JavaModelException {
ICompilationUnit[] workingCopies = JavaModelManager.getJavaModelManager().getWorkingCopies(owner, true
/*add primary working copies*/
);
CreateTypeHierarchyOperation op = new CreateTypeHierarchyOperation(this, workingCopies, SearchEngine.createWorkspaceScope(), false);
op.runOperation(monitor);
return op.getResult();
}
/**
* @see IType
*/
public ITypeHierarchy newTypeHierarchy(IJavaProject project, IProgressMonitor monitor) throws JavaModelException {
return newTypeHierarchy(project, DefaultWorkingCopyOwner.PRIMARY, monitor);
}
/**
* @see IType#newTypeHierarchy(IJavaProject, WorkingCopyOwner, IProgressMonitor)
*/
public ITypeHierarchy newTypeHierarchy(IJavaProject project, WorkingCopyOwner owner, IProgressMonitor monitor) throws JavaModelException {
if (project == null) {
throw new IllegalArgumentException(Messages.hierarchy_nullProject);
}
ICompilationUnit[] workingCopies = JavaModelManager.getJavaModelManager().getWorkingCopies(owner, true
/*add primary working copies*/
);
ICompilationUnit[] projectWCs = null;
if (workingCopies != null) {
int length = workingCopies.length;
projectWCs = new ICompilationUnit[length];
int index = 0;
for (int i = 0; i < length; i++) {
ICompilationUnit wc = workingCopies[i];
if (project.equals(wc.getJavaProject())) {
projectWCs[index++ ] = wc;
}
}
if (index != length) {
System.arraycopy(projectWCs, 0, projectWCs = new ICompilationUnit[index], 0, index);
}
}
CreateTypeHierarchyOperation op = new CreateTypeHierarchyOperation(
this,
projectWCs,
project,
true );
op.runOperation(monitor);
return op.getResult();
}
/**
* @see IType
*/
public ITypeHierarchy newTypeHierarchy(IProgressMonitor monitor) throws JavaModelException {
CreateTypeHierarchyOperation op = new CreateTypeHierarchyOperation(this, null, SearchEngine.createWorkspaceScope(), true);
op.runOperation(monitor);
return op.getResult();
}
/*
* @see IType#newTypeHierarchy(ICompilationUnit[], IProgressMonitor)
*/
public ITypeHierarchy newTypeHierarchy(
ICompilationUnit[] workingCopies,
IProgressMonitor monitor ) throws
JavaModelException {
CreateTypeHierarchyOperation op = new CreateTypeHierarchyOperation(this, workingCopies, SearchEngine.createWorkspaceScope(), true);
op.runOperation(monitor);
return op.getResult();
}
/**
* @see IType#newTypeHierarchy(IWorkingCopy[], IProgressMonitor)
* @deprecated
*/
public ITypeHierarchy newTypeHierarchy(
IWorkingCopy[] workingCopies,
IProgressMonitor monitor ) throws
JavaModelException {
ICompilationUnit[] copies;
if (workingCopies == null) {
copies = null;
}
else {
int length = workingCopies.length;
System.arraycopy(workingCopies, 0, copies = new ICompilationUnit[length], 0, length);
}
return newTypeHierarchy(copies, monitor);
}
/**
* @see IType#newTypeHierarchy(WorkingCopyOwner, IProgressMonitor)
*/
public ITypeHierarchy newTypeHierarchy(
WorkingCopyOwner owner,
IProgressMonitor monitor ) throws
JavaModelException {
ICompilationUnit[] workingCopies = JavaModelManager.getJavaModelManager().getWorkingCopies(owner, true
/*add primary working copies*/
);
CreateTypeHierarchyOperation op = new CreateTypeHierarchyOperation(this, workingCopies, SearchEngine.createWorkspaceScope(), true);
op.runOperation(monitor);
return op.getResult();
}
public JavaElement resolved(Binding binding) {
SourceRefElement resolvedHandle = new ResolvedSourceType(this.parent, this.name, new String(binding.computeUniqueKey()));
resolvedHandle.occurrenceCount = this.occurrenceCount;
return resolvedHandle;
}
|
| |||
/*
* @see IType
*/
/**
* @see IType
*/
public ITypeHierarchy loadTypeHierachy(InputStream input, IProgressMonitor monitor) throws JavaModelException {
return loadTypeHierachy(input, DefaultWorkingCopyOwner.PRIMARY, monitor);
}
/*
* @see IType
*/
/**
* NOTE: This method is not part of the API has it is not clear clients would easily use it: they would need to
* first make sure all working copies for the given owner exist before calling it. This is especially har at startup
* time.
* In case clients want this API, here is how it should be specified:
* <p>
* Loads a previously saved ITypeHierarchy from an input stream. A type hierarchy can
* be stored using ITypeHierachy#store(OutputStream). A compilation unit of a
* loaded type has the given owner if such a working copy exists, otherwise the type's
* compilation unit is a primary compilation unit.
*
* Only hierarchies originally created by the following methods can be loaded:
* <ul>
* <li>IType#newSupertypeHierarchy(IProgressMonitor)</li>
* <li>IType#newSupertypeHierarchy(WorkingCopyOwner, IProgressMonitor)</li>
* <li>IType#newTypeHierarchy(IJavaProject, IProgressMonitor)</li>
* <li>IType#newTypeHierarchy(IJavaProject, WorkingCopyOwner, IProgressMonitor)</li>
* <li>IType#newTypeHierarchy(IProgressMonitor)</li>
* <li>IType#newTypeHierarchy(WorkingCopyOwner, IProgressMonitor)</li>
* </u>
*
* @param input stream where hierarchy will be read
* @param monitor the given progress monitor
* @return the stored hierarchy
* @exception JavaModelException if the hierarchy could not be restored, reasons include:
* - type is not the focus of the hierarchy or
* - unable to read the input stream (wrong format, IOException during reading, ...)
* @see ITypeHierarchy#store(java.io.OutputStream, IProgressMonitor)
* @since 3.0
*/
public ITypeHierarchy loadTypeHierachy(InputStream input, WorkingCopyOwner owner, IProgressMonitor monitor) throws JavaModelException {
// TODO monitor should be passed to TypeHierarchy.load(...)
return TypeHierarchy.load(this, input, owner);
}
/*
* @see IType#newSupertypeHierarchy(IProgressMonitor monitor)
*/
/**
* @see IType
*/
public ITypeHierarchy newSupertypeHierarchy(IProgressMonitor monitor) throws JavaModelException {
return this.newSupertypeHierarchy(DefaultWorkingCopyOwner.PRIMARY, monitor);
}
/*
*@see IType#newSupertypeHierarchy(ICompilationUnit[], IProgressMonitor monitor)
*/
/*
* @see IType#newSupertypeHierarchy(ICompilationUnit[], IProgressMonitor)
*/
public ITypeHierarchy newSupertypeHierarchy(ICompilationUnit[] workingCopies, IProgressMonitor monitor) throws JavaModelException {
CreateTypeHierarchyOperation op = new CreateTypeHierarchyOperation(this, workingCopies, SearchEngine.createWorkspaceScope(), false);
op.runOperation(monitor);
return op.getResult();
}
/**
* @param workingCopies the working copies that take precedence over their original compilation units
* @param monitor the given progress monitor
* @return a type hierarchy for this type containing this type and all of its supertypes
* @exception JavaModelException if this element does not exist or if an
* exception occurs while accessing its corresponding resource.
*
* @see IType#newSupertypeHierarchy(IWorkingCopy[], IProgressMonitor)
* @deprecated
*/
public ITypeHierarchy newSupertypeHierarchy(IWorkingCopy[] workingCopies, IProgressMonitor monitor) throws JavaModelException {
ICompilationUnit[] copies;
if (workingCopies == null) {
copies = null;
}
else {
int length = workingCopies.length;
System.arraycopy(workingCopies, 0, copies = new ICompilationUnit[length], 0, length);
}
return newSupertypeHierarchy(copies, monitor);
}
/*
* @see IType#newSupertypeHierarchy(WorkingCopyOwner, IProgressMonitor)
*/
/**
* @see IType#newSupertypeHierarchy(WorkingCopyOwner, IProgressMonitor)
*/
public ITypeHierarchy newSupertypeHierarchy(WorkingCopyOwner owner, IProgressMonitor monitor) throws JavaModelException {
ICompilationUnit[] workingCopies = JavaModelManager.getJavaModelManager().getWorkingCopies(owner, true
/*add primary working copies*/
);
CreateTypeHierarchyOperation op = new CreateTypeHierarchyOperation(this, workingCopies, SearchEngine.createWorkspaceScope(), false);
op.runOperation(monitor);
return op.getResult();
}
/*
* @see IType#newTypeHierarchy(IJavaProject, IProgressMonitor)
*/
/**
* @see IType
*/
public ITypeHierarchy newTypeHierarchy(IJavaProject project, IProgressMonitor monitor) throws JavaModelException {
return newTypeHierarchy(project, DefaultWorkingCopyOwner.PRIMARY, monitor);
}
/*
* @see IType#newTypeHierarchy(IJavaProject, WorkingCopyOwner, IProgressMonitor)
*/
/**
* @see IType#newTypeHierarchy(IJavaProject, WorkingCopyOwner, IProgressMonitor)
*/
public ITypeHierarchy newTypeHierarchy(IJavaProject project, WorkingCopyOwner owner, IProgressMonitor monitor) throws JavaModelException {
if (project == null) {
throw new IllegalArgumentException(Messages.hierarchy_nullProject);
}
ICompilationUnit[] workingCopies = JavaModelManager.getJavaModelManager().getWorkingCopies(owner, true
/*add primary working copies*/
);
ICompilationUnit[] projectWCs = null;
if (workingCopies != null) {
int length = workingCopies.length;
projectWCs = new ICompilationUnit[length];
int index = 0;
for (int i = 0; i < length; i++) {
ICompilationUnit wc = workingCopies[i];
if (project.equals(wc.getJavaProject())) {
projectWCs[index++ ] = wc;
}
}
if (index != length) {
System.arraycopy(projectWCs, 0, projectWCs = new ICompilationUnit[index], 0, index);
}
}
CreateTypeHierarchyOperation op = new CreateTypeHierarchyOperation(this, projectWCs, project, true);
op.runOperation(monitor);
return op.getResult();
}
/**
* @param monitor the given progress monitor
* @exception JavaModelException if this element does not exist or if an
* exception occurs while accessing its corresponding resource.
* @return a type hierarchy for this type containing
*
* @see IType#newTypeHierarchy(IProgressMonitor monitor)
* @deprecated
*/
/**
* @see IType
*/
public ITypeHierarchy newTypeHierarchy(IProgressMonitor monitor) throws JavaModelException {
[[#variableb71ed1e0]]
}
/*
* @see IType#newTypeHierarchy(ICompilationUnit[], IProgressMonitor)
*/
public ITypeHierarchy newTypeHierarchy(ICompilationUnit[] workingCopies, IProgressMonitor monitor) throws JavaModelException {
CreateTypeHierarchyOperation op = new CreateTypeHierarchyOperation(this, workingCopies, SearchEngine.createWorkspaceScope(), true);
op.runOperation(monitor);
return op.getResult();
}
/**
* @see IType#newTypeHierarchy(IWorkingCopy[], IProgressMonitor)
* @deprecated
*/
public ITypeHierarchy newTypeHierarchy(IWorkingCopy[] workingCopies, IProgressMonitor monitor) throws JavaModelException {
ICompilationUnit[] copies;
if (workingCopies == null) {
copies = null;
}
else {
int length = workingCopies.length;
System.arraycopy(workingCopies, 0, copies = new ICompilationUnit[length], 0, length);
}
return newTypeHierarchy(copies, monitor);
}
/*
* @see IType#newTypeHierarchy(WorkingCopyOwner, IProgressMonitor)
*/
/**
* @see IType#newTypeHierarchy(WorkingCopyOwner, IProgressMonitor)
*/
public ITypeHierarchy newTypeHierarchy(WorkingCopyOwner owner, IProgressMonitor monitor) throws JavaModelException {
ICompilationUnit[] workingCopies = JavaModelManager.getJavaModelManager().getWorkingCopies(owner, true
/*add primary working copies*/
);
CreateTypeHierarchyOperation op = new CreateTypeHierarchyOperation(this, workingCopies, SearchEngine.createWorkspaceScope(), true);
op.runOperation(monitor);
return op.getResult();
}
public JavaElement resolved(Binding binding) {
SourceRefElement resolvedHandle = new [[#variableb71ed140]](this.parent, this.name, new String(binding.computeUniqueKey()));
resolvedHandle.occurrenceCount = this.occurrenceCount;
return resolvedHandle;
}
|
| CloneAbstraction |
| Parameter Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#b71ed1e0]] | return newTypeHierarchy((IWorkingCopy[]) null, monitor); |
| 1 | 2 | [[#b71ed1e0]] | CreateTypeHierarchyOperation op = new CreateTypeHierarchyOperation(this, null, SearchEngine.createWorkspaceScope(), true); op.runOperation(monitor); return op.getResult(); |
| 2 | 1 | [[#b71ed140]] | ResolvedBinaryType |
| 2 | 2 | [[#b71ed140]] | ResolvedSourceType |