CloneSet1431


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
44230.964compilation_unit
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
14411
plugins/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ShowConstantsAction.java
24411
plugins/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ShowStaticVariablesAction.java
Clone Instance
1
Line Count
44
Source Line
11
Source File
plugins/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ShowConstantsAction.java

/*******************************************************************************
 * Copyright (c) 2000, 2005 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.jdt.internal.debug.ui.actions;


import org.eclipse.debug.core.DebugException;
import org.eclipse.jdt.debug.core.IJavaVariable;
import org.eclipse.jdt.internal.debug.ui.IJDIPreferencesConstants;
import org.eclipse.jdt.internal.debug.ui.JDIDebugUIPlugin;
import org.eclipse.jface.viewers.Viewer;

/**
 * Shows static final variables (constants)
 */
public class ShowConstantsAction extends ViewFilterAction {

        public ShowConstantsAction() {
                super();
        }

        /**
         * @see ViewFilterAction#getPreferenceKey()
         */
        protected String getPreferenceKey() {
                return IJDIPreferencesConstants.PREF_SHOW_CONSTANTS;
        }

        /**
         * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
         */
        public boolean select(Viewer viewer, Object parentElement, Object element) {
                if (element instanceof IJavaVariable) {
                        IJavaVariable variable = (IJavaVariable) element;
                        try {
                                if ( !getValue()) {
                                        // when not on, filter static finals
                                        return !(variable.isStatic() && variable.isFinal());
                                }
                        } catch (DebugException e) {
                                JDIDebugUIPlugin.log(e);
                          }
                }
                return true;
        }
}




Clone Instance
2
Line Count
44
Source Line
11
Source File
plugins/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ShowStaticVariablesAction.java

/*******************************************************************************
 * Copyright (c) 2000, 2005 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.jdt.internal.debug.ui.actions;


import org.eclipse.debug.core.DebugException;
import org.eclipse.jdt.debug.core.IJavaVariable;
import org.eclipse.jdt.internal.debug.ui.IJDIPreferencesConstants;
import org.eclipse.jdt.internal.debug.ui.JDIDebugUIPlugin;
import org.eclipse.jface.viewers.Viewer;

/**
 * Shows non-final static variables
 */
public class ShowStaticVariablesAction extends ViewFilterAction {

        public ShowStaticVariablesAction() {
                super();
        }

        /**
         * @see ViewFilterAction#getPreferenceKey()
         */
        protected String getPreferenceKey() {
                return IJDIPreferencesConstants.PREF_SHOW_STATIC_VARIALBES;
        }

        /**
         * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
         */
        public boolean select(Viewer viewer, Object parentElement, Object element) {
                if (element instanceof IJavaVariable) {
                        IJavaVariable variable = (IJavaVariable) element;
                        try {
                                if ( !getValue()) {
                                        // when not on, filter non-static finals
                                        return !(variable.isStatic() && !variable.isFinal());
                                }
                        } catch (DebugException e) {
                                JDIDebugUIPlugin.log(e);
                          }
                }
                return true;
        }
}




Clone AbstractionParameter Count: 3Parameter Bindings

/*******************************************************************************
 * Copyright (c) 2000, 2005 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.jdt.internal.debug.ui.actions;

import org.eclipse.debug.core.DebugException;
import org.eclipse.jdt.debug.core.IJavaVariable;
import org.eclipse.jdt.internal.debug.ui.IJDIPreferencesConstants;
import org.eclipse.jdt.internal.debug.ui.JDIDebugUIPlugin;
import org.eclipse.jface.viewers.Viewer;

/**
 * Shows static final variables (constants)
 */
/**
 * Shows non-final static variables
 */
public class [[#variable78af8720]]extends ViewFilterAction {
  public [[#variable78af8720]]() {
    super();
  }

  /**
           * @see ViewFilterAction#getPreferenceKey()
           */
  protected String getPreferenceKey() {
    return IJDIPreferencesConstants. [[#variable78af86c0]];
  }

  /**
           * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
           */
  public boolean select(Viewer viewer, Object parentElement, Object element) {
    if (element instanceof IJavaVariable) {
      IJavaVariable variable = (IJavaVariable) element;
      try {
        if ( !getValue()) {
          // when not on, filter static finals
          // when not on, filter non-static finals
          return !(variable.isStatic() && [[#variable78af8660]]);
        }
      }
      catch (DebugException e) {
        JDIDebugUIPlugin.log(e);
      }
    }
    return true;
  }
}


 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#78af8720]]
ShowConstantsAction 
12[[#78af8720]]
ShowStaticVariablesAction 
21[[#78af86c0]]
PREF_SHOW_CONSTANTS 
22[[#78af86c0]]
PREF_SHOW_STATIC_VARIALBES 
31[[#78af8660]]
variable.isFinal() 
32[[#78af8660]]
!variable.isFinal()