CloneSet877


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
35201.000class_body_declarations[2]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
13544
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/AddClassFileMarkerAction.java
23443
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/ClassFileMarkerRulerAction.java
Clone Instance
1
Line Count
35
Source Line
44
Source File
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/AddClassFileMarkerAction.java

        /**
         * @see AddMarkerAction#getResource()
         */
        protected IResource getResource() {

                IResource resource = null;

                IEditorInput input = getTextEditor().getEditorInput();
                if (input instanceof IClassFileEditorInput) {
                        IClassFile c = ((IClassFileEditorInput) input).getClassFile();
                        IResourceLocator locator = (IResourceLocator) c.getAdapter(IResourceLocator.class );
                        if (locator != null) {
                                try {
                                        resource = locator.getContainingResource(c);
                                } catch (JavaModelException x) {
                                        // ignore but should inform
                                  }
                        }
                }

                return resource;
        }

        /**
         * @see AddMarkerAction#getInitialAttributes()
         */
        protected Map getInitialAttributes() {

                Map attributes = super.getInitialAttributes();

                IEditorInput input = getTextEditor().getEditorInput();
                if (input instanceof IClassFileEditorInput) {

                        IClassFile classFile = ((IClassFileEditorInput) input).getClassFile();
                        JavaCore.addJavaElementMarkerAttributes(attributes, classFile);
                }

                return attributes;
        }


Clone Instance
2
Line Count
34
Source Line
43
Source File
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/ClassFileMarkerRulerAction.java

        /**
         * @see MarkerRulerAction#getResource()
         */
        protected IResource getResource() {

                IResource resource = null;

                IEditorInput input = getTextEditor().getEditorInput();
                if (input instanceof IClassFileEditorInput) {
                        IClassFile c = ((IClassFileEditorInput) input).getClassFile();
                        IResourceLocator locator = (IResourceLocator) c.getAdapter(IResourceLocator.class );
                        if (locator != null) {
                                try {
                                        resource = locator.getContainingResource(c);
                                } catch (JavaModelException x) {
                                        // ignore but should inform
                                  }
                        }
                }

                return resource;
        }

        /**
         * @see MarkerRulerAction#getInitialAttributes()
         */
        protected Map getInitialAttributes() {

                Map attributes = super.getInitialAttributes();

                IEditorInput input = getTextEditor().getEditorInput();
                if (input instanceof IClassFileEditorInput) {
                        IClassFile classFile = ((IClassFileEditorInput) input).getClassFile();
                        JavaCore.addJavaElementMarkerAttributes(attributes, classFile);
                }

                return attributes;
        }


Clone AbstractionParameter Count: 0Parameter Bindings

/**
         * @see AddMarkerAction#getResource()
         */
/**
         * @see MarkerRulerAction#getResource()
         */
protected IResource getResource() {
  IResource resource = null;
  IEditorInput input = getTextEditor().getEditorInput();
  if (input instanceof IClassFileEditorInput) {
    IClassFile c = ((IClassFileEditorInput) input).getClassFile();
    IResourceLocator locator = (IResourceLocator) c.getAdapter(IResourceLocator.class );
    if (locator != null) {
      try {
        resource = locator.getContainingResource(c);
      }
      catch (JavaModelException x) {
      // ignore but should inform
      }
    }
  }
  return resource;
}

/**
         * @see AddMarkerAction#getInitialAttributes()
         */
/**
         * @see MarkerRulerAction#getInitialAttributes()
         */
protected Map getInitialAttributes() {
  Map attributes = super.getInitialAttributes();
  IEditorInput input = getTextEditor().getEditorInput();
  if (input instanceof IClassFileEditorInput) {
    IClassFile classFile = ((IClassFileEditorInput) input).getClassFile();
    JavaCore.addJavaElementMarkerAttributes(attributes, classFile);
  }
  return attributes;
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
None