Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
50 | 2 | 4 | 0.985 | class_body_declarations[7] |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 50 | 41 | plugins/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/template/java/CodeTemplates.java |
2 | 57 | 39 | plugins/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/template/java/Templates.java |
| ||||
/** * Returns an instance of templates. */ public static CodeTemplates getInstance() { if (fgTemplates == null) fgTemplates = new CodeTemplates(); return fgTemplates; } private CodeTemplates() { super("codetemplate", JavaPlugin.getDefault().getCodeTemplateContextRegistry()); //$NON-NLS-1$ create(); } private void create() { try { File templateFile = getTemplateFile(); if (templateFile.exists()) { addFromFile(templateFile, false); } } catch (CoreException e) { JavaPlugin.log(e); clear(); } } /** * Resets the template set. */ public void reset() throws CoreException { } /** * Resets the template set with the default templates. */ public void restoreDefaults() throws CoreException { } /** * Saves the template set. */ public void save() throws CoreException { } private static File getTemplateFile() { IPath path = JavaPlugin.getDefault().getStateLocation(); path = path.append(TEMPLATE_FILE); return path.toFile(); } |
| ||||
/** * Returns an instance of templates. * * @return an instance of templates * @deprecated As of 3.0, replaced by * {@link org.eclipse.jdt.internal.ui.JavaPlugin#getTemplateStore()} */ public static Templates getInstance() { if (fgTemplates == null) fgTemplates = new Templates(); return fgTemplates; } public Templates() { super("template", JavaPlugin.getDefault().getTemplateContextRegistry()); //$NON-NLS-1$ create(); } private void create() { try { File templateFile = getTemplateFile(); if (templateFile.exists()) { addFromFile(templateFile, false); } } catch (CoreException e) { JavaPlugin.log(e); clear(); } } /** * Resets the template set. * * @throws CoreException in case the reset operation fails */ public void reset() throws CoreException { } /** * Resets the template set with the default templates. * * @throws CoreException in case the restore operation fails */ public void restoreDefaults() throws CoreException { } /** * Saves the template set. * * @throws CoreException in case the save operation fails */ public void save() throws CoreException { } private static File getTemplateFile() { IPath path = JavaPlugin.getDefault().getStateLocation(); path = path.append(TEMPLATE_FILE); return path.toFile(); } |
| |||
/** * Returns an instance of templates. */ /** * Returns an instance of templates. * * @return an instance of templates * @deprecated As of 3.0, replaced by * {@link org.eclipse.jdt.internal.ui.JavaPlugin#getTemplateStore()} */ public static [[#variable5297b3a0]] getInstance() { if (fgTemplates == null) fgTemplates = new [[#variable5297b3a0]](); return fgTemplates; } [[#variable5297b300]] [[#variable5297b3a0]]() { super( [[#variable4cf722c0]], JavaPlugin.getDefault(). [[#variable5297b340]]()); //$NON-NLS-1$ create(); } private void create() { try { File templateFile = getTemplateFile(); if (templateFile.exists()) { addFromFile(templateFile, false); } } catch (CoreException e) { JavaPlugin.log(e); clear(); } } /** * Resets the template set. */ /** * Resets the template set. * * @throws CoreException in case the reset operation fails */ public void reset() throws CoreException { } /** * Resets the template set with the default templates. */ /** * Resets the template set with the default templates. * * @throws CoreException in case the restore operation fails */ public void restoreDefaults() throws CoreException { } /** * Saves the template set. */ /** * Saves the template set. * * @throws CoreException in case the save operation fails */ public void save() throws CoreException { } private static File getTemplateFile() { IPath path = JavaPlugin.getDefault().getStateLocation(); path = path.append(TEMPLATE_FILE); return path.toFile(); } |
CloneAbstraction |
Parameter Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#5297b3a0]] | CodeTemplates |
1 | 2 | [[#5297b3a0]] | Templates |
2 | 1 | [[#5297b300]] | private |
2 | 2 | [[#5297b300]] | public |
3 | 1 | [[#4cf722c0]] | "codetemplate" |
3 | 2 | [[#4cf722c0]] | "template" |
4 | 1 | [[#5297b340]] | getCodeTemplateContextRegistry |
4 | 2 | [[#5297b340]] | getTemplateContextRegistry |