Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
44 | 2 | 3 | 0.964 | compilation_unit |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 44 | 11 | plugins/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/ShowConstantsAction.java |
2 | 44 | 11 | 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 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; } } |
| ||||
/******************************************************************************* * 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; } } |
| |||
/******************************************************************************* * 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 Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#78af8720]] | ShowConstantsAction |
1 | 2 | [[#78af8720]] | ShowStaticVariablesAction |
2 | 1 | [[#78af86c0]] | PREF_SHOW_CONSTANTS |
2 | 2 | [[#78af86c0]] | PREF_SHOW_STATIC_VARIALBES |
3 | 1 | [[#78af8660]] | variable.isFinal() |
3 | 2 | [[#78af8660]] | !variable.isFinal() |