Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
44 | 2 | 5 | 0.986 | statement_sequence[14] |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 44 | 125 | plugins/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/nls/SourceFirstPackageSelectionDialogField.java |
2 | 44 | 449 | plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/wizards/NewContainerWizardPage.java |
| ||||
Class[] acceptedClasses = new Class[] { IPackageFragmentRoot.class ,IJavaProject.class }; TypedElementSelectionValidator validator = new TypedElementSelectionValidator(acceptedClasses, false) { public boolean isSelectedValid(Object element) { try { if (element instanceof IJavaProject) { IJavaProject jproject = (IJavaProject) element; IPath path = jproject.getProject().getFullPath(); return (jproject.findPackageFragmentRoot(path) != null); } else if (element instanceof IPackageFragmentRoot) { return (((IPackageFragmentRoot) element).getKind() == IPackageFragmentRoot.K_SOURCE); } return true; } catch (JavaModelException e) { JavaPlugin.log(e.getStatus()); // just log, no ui in validation } return false; } }; acceptedClasses = new Class[] { IJavaModel.class ,IPackageFragmentRoot.class ,IJavaProject.class }; ViewerFilter filter = new TypedViewerFilter(acceptedClasses) { public boolean select(Viewer viewer, Object parent, Object element) { if (element instanceof IPackageFragmentRoot) { try { return (((IPackageFragmentRoot) element).getKind() == IPackageFragmentRoot.K_SOURCE); } catch (JavaModelException e) { JavaPlugin.log(e.getStatus()); // just log, no ui in validation return false; } } return super.select(viewer, parent, element); } }; StandardJavaElementContentProvider provider = new StandardJavaElementContentProvider(); ILabelProvider labelProvider = new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_DEFAULT); ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(fShell, labelProvider, provider); dialog.setValidator(validator); dialog.setSorter(new JavaElementSorter()); dialog.setTitle(NLSUIMessages.SourceFirstPackageSelectionDialogField_ChooseSourceContainerDialog_title); dialog.setMessage(NLSUIMessages.SourceFirstPackageSelectionDialogField_ChooseSourceContainerDialog_description); dialog.addFilter(filter); dialog.setInput(JavaCore.create(ResourcesPlugin.getWorkspace().getRoot())); dialog.setInitialSelection(initElement); |
| ||||
Class[] acceptedClasses = new Class[] { IPackageFragmentRoot.class ,IJavaProject.class }; TypedElementSelectionValidator validator = new TypedElementSelectionValidator(acceptedClasses, false) { public boolean isSelectedValid(Object element) { try { if (element instanceof IJavaProject) { IJavaProject jproject = (IJavaProject) element; IPath path = jproject.getProject().getFullPath(); return (jproject.findPackageFragmentRoot(path) != null); } else if (element instanceof IPackageFragmentRoot) { return (((IPackageFragmentRoot) element).getKind() == IPackageFragmentRoot.K_SOURCE); } return true; } catch (JavaModelException e) { JavaPlugin.log(e.getStatus()); // just log, no UI in validation } return false; } }; acceptedClasses = new Class[] { IJavaModel.class ,IPackageFragmentRoot.class ,IJavaProject.class }; ViewerFilter filter = new TypedViewerFilter(acceptedClasses) { public boolean select(Viewer viewer, Object parent, Object element) { if (element instanceof IPackageFragmentRoot) { try { return (((IPackageFragmentRoot) element).getKind() == IPackageFragmentRoot.K_SOURCE); } catch (JavaModelException e) { JavaPlugin.log(e.getStatus()); // just log, no UI in validation return false; } } return super.select(viewer, parent, element); } }; StandardJavaElementContentProvider provider = new StandardJavaElementContentProvider(); ILabelProvider labelProvider = new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_DEFAULT); ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(), labelProvider, provider); dialog.setValidator(validator); dialog.setSorter(new JavaElementSorter()); dialog.setTitle(NewWizardMessages.NewContainerWizardPage_ChooseSourceContainerDialog_title); dialog.setMessage(NewWizardMessages.NewContainerWizardPage_ChooseSourceContainerDialog_description); dialog.addFilter(filter); dialog.setInput(JavaCore.create(fWorkspaceRoot)); dialog.setInitialSelection(initElement); |
| |||
Class[] acceptedClasses = new Class[] { IPackageFragmentRoot.class , IJavaProject.class }; TypedElementSelectionValidator validator = new TypedElementSelectionValidator(acceptedClasses, false) { public boolean isSelectedValid(Object element) { try { if (element instanceof IJavaProject) { IJavaProject jproject = (IJavaProject) element; IPath path = jproject.getProject().getFullPath(); return (jproject.findPackageFragmentRoot(path) != null); } else if (element instanceof IPackageFragmentRoot) { return (((IPackageFragmentRoot) element).getKind() == IPackageFragmentRoot.K_SOURCE); } return true; } catch (JavaModelException e) { JavaPlugin.log(e.getStatus()); // just log, no ui in validation // just log, no UI in validation } return false; } }; acceptedClasses = new Class[] { IJavaModel.class , IPackageFragmentRoot.class , IJavaProject.class }; ViewerFilter filter = new TypedViewerFilter(acceptedClasses) { public boolean select(Viewer viewer, Object parent, Object element) { if (element instanceof IPackageFragmentRoot) { try { return (((IPackageFragmentRoot) element).getKind() == IPackageFragmentRoot.K_SOURCE); } catch (JavaModelException e) { JavaPlugin.log(e.getStatus()); // just log, no ui in validation // just log, no UI in validation return false; } } return super.select(viewer, parent, element); } }; StandardJavaElementContentProvider provider = new StandardJavaElementContentProvider(); ILabelProvider labelProvider = new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_DEFAULT); ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog( [[#variableb77ab6e0]], labelProvider, provider); dialog.setValidator(validator); dialog.setSorter(new JavaElementSorter()); dialog.setTitle( [[#variableb77ab640]]. [[#variableb77ab5c0]]); dialog.setMessage( [[#variableb77ab640]]. [[#variableb7c1f620]]); dialog.addFilter(filter); dialog.setInput(JavaCore.create( [[#variableb77ab560]])); dialog.setInitialSelection(initElement); |
CloneAbstraction |
Parameter Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#b77ab6e0]] | fShell |
1 | 2 | [[#b77ab6e0]] | getShell() |
2 | 1 | [[#b77ab640]] | NLSUIMessages |
2 | 2 | [[#b77ab640]] | NewWizardMessages |
3 | 1 | [[#b77ab5c0]] | SourceFirstPackageSelectionDialogField_ChooseSourceContainerDialog_title |
3 | 2 | [[#b77ab5c0]] | NewContainerWizardPage_ChooseSourceContainerDialog_title |
4 | 1 | [[#b7c1f620]] | SourceFirstPackageSelectionDialogField_ChooseSourceContainerDialog_description |
4 | 2 | [[#b7c1f620]] | NewContainerWizardPage_ChooseSourceContainerDialog_description |
5 | 1 | [[#b77ab560]] | ResourcesPlugin.getWorkspace().getRoot() |
5 | 2 | [[#b77ab560]] | fWorkspaceRoot |