CloneSet1151


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
50240.985class_body_declarations[7]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
15041
plugins/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/template/java/CodeTemplates.java
25739
plugins/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/template/java/Templates.java
Clone Instance
1
Line Count
50
Source Line
41
Source File
plugins/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/template/java/CodeTemplates.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();
        }


Clone Instance
2
Line Count
57
Source Line
39
Source File
plugins/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/template/java/Templates.java

        /**
         * 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();
        }


Clone AbstractionParameter Count: 4Parameter Bindings

/**
         * 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 Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#5297b3a0]]
CodeTemplates 
12[[#5297b3a0]]
Templates 
21[[#5297b300]]
private 
22[[#5297b300]]
public 
31[[#4cf722c0]]
"codetemplate" 
32[[#4cf722c0]]
"template" 
41[[#5297b340]]
getCodeTemplateContextRegistry 
42[[#5297b340]]
getTemplateContextRegistry