cleanup - final where appropriate

This commit is contained in:
Egor.Ushakov
2015-10-06 18:49:17 +03:00
parent e99ce9d898
commit b97b6d4b3c
48 changed files with 106 additions and 114 deletions
@@ -42,7 +42,7 @@ import java.util.List;
* Date: 22.11.11
*/
public abstract class JvmSmartStepIntoHandler {
public static ExtensionPointName<JvmSmartStepIntoHandler> EP_NAME = ExtensionPointName.create("com.intellij.debugger.jvmSmartStepIntoHandler");
public static final ExtensionPointName<JvmSmartStepIntoHandler> EP_NAME = ExtensionPointName.create("com.intellij.debugger.jvmSmartStepIntoHandler");
@NotNull
public abstract List<SmartStepTarget> findSmartStepTargets(SourcePosition position);
@@ -58,7 +58,7 @@ public class CompoundPositionManager extends PositionManagerEx implements MultiR
myPositionManagers.add(0, manager);
}
private Cache<Location, SourcePosition> mySourcePositionCache = new Cache<Location, SourcePosition>();
private final Cache<Location, SourcePosition> mySourcePositionCache = new Cache<Location, SourcePosition>();
private interface Processor<T> {
T process(PositionManager positionManager) throws NoDataException;
@@ -103,8 +103,8 @@ public abstract class DebugProcessImpl extends UserDataHolderBase implements Deb
private final RequestManagerImpl myRequestManager;
private volatile VirtualMachineProxyImpl myVirtualMachineProxy = null;
protected EventDispatcher<DebugProcessListener> myDebugProcessDispatcher = EventDispatcher.create(DebugProcessListener.class);
protected EventDispatcher<EvaluationListener> myEvaluationDispatcher = EventDispatcher.create(EvaluationListener.class);
protected final EventDispatcher<DebugProcessListener> myDebugProcessDispatcher = EventDispatcher.create(DebugProcessListener.class);
protected final EventDispatcher<EvaluationListener> myEvaluationDispatcher = EventDispatcher.create(EvaluationListener.class);
private final List<ProcessListener> myProcessListeners = ContainerUtil.createLockFreeCopyOnWriteList();
@@ -125,7 +125,7 @@ public class JVMNameUtil {
}
private static class JVMNameBuffer {
List<JVMName> myList = new ArrayList<JVMName>();
private final List<JVMName> myList = new ArrayList<JVMName>();
public void append(@NotNull JVMName evaluator){
myList.add(evaluator);
@@ -164,7 +164,7 @@ public class JavaValue extends XNamedValue implements NodeDescriptorProvider, XV
else if (value.length() > XValueNode.MAX_VALUE_LENGTH) {
node.setFullValueEvaluator(new JavaFullValueEvaluator(myEvaluationContext) {
@Override
public void evaluate(@NotNull final XFullValueEvaluationCallback callback) throws Exception {
public void evaluate(@NotNull final XFullValueEvaluationCallback callback) {
final ValueDescriptorImpl fullValueDescriptor = myValueDescriptor.getFullValueDescriptor();
fullValueDescriptor.updateRepresentation(myEvaluationContext, new DescriptorLabelListener() {
@Override
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,7 +24,7 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public abstract class SourcePositionProvider {
public static ExtensionPointName<SourcePositionProvider> EP_NAME = ExtensionPointName.create("com.intellij.debugger.sourcePositionProvider");
public static final ExtensionPointName<SourcePositionProvider> EP_NAME = ExtensionPointName.create("com.intellij.debugger.sourcePositionProvider");
@Nullable
public static SourcePosition getSourcePosition(@NotNull NodeDescriptor descriptor,
@@ -56,7 +56,7 @@ public abstract class SuspendContextImpl extends XSuspendContext implements Susp
private final EventSet myEventSet;
private volatile boolean myIsResumed;
public ConcurrentLinkedQueue<SuspendContextCommandImpl> myPostponedCommands = new ConcurrentLinkedQueue<SuspendContextCommandImpl>();
private final ConcurrentLinkedQueue<SuspendContextCommandImpl> myPostponedCommands = new ConcurrentLinkedQueue<SuspendContextCommandImpl>();
public volatile boolean myInProgress;
private final HashSet<ObjectReference> myKeptReferences = new HashSet<ObjectReference>();
private EvaluationContextImpl myEvaluationContext = null;
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,7 +32,7 @@ import com.sun.jdi.Value;
*/
public class ExpressionEvaluatorImpl implements ExpressionEvaluator {
private static final Logger LOG = Logger.getInstance("#com.intellij.debugger.engine.evaluation.expression.ExpressionEvaluator");
Evaluator myEvaluator;
private final Evaluator myEvaluator;
Value myValue;
public ExpressionEvaluatorImpl(Evaluator evaluator) {
@@ -85,19 +85,19 @@ public class FieldEvaluator implements Evaluator {
}
@Nullable
private Field findField(@Nullable Type t, final EvaluationContextImpl context) throws EvaluateException {
private Field findField(@Nullable Type t) {
if(t instanceof ClassType) {
ClassType cls = (ClassType) t;
if(myTargetClassFilter.acceptClass(cls)) {
return cls.fieldByName(myFieldName);
}
for (final InterfaceType interfaceType : cls.interfaces()) {
final Field field = findField(interfaceType, context);
final Field field = findField(interfaceType);
if (field != null) {
return field;
}
}
return findField(cls.superclass(), context);
return findField(cls.superclass());
}
else if(t instanceof InterfaceType) {
InterfaceType iface = (InterfaceType) t;
@@ -105,7 +105,7 @@ public class FieldEvaluator implements Evaluator {
return iface.fieldByName(myFieldName);
}
for (final InterfaceType interfaceType : iface.superinterfaces()) {
final Field field = findField(interfaceType, context);
final Field field = findField(interfaceType);
if (field != null) {
return field;
}
@@ -126,7 +126,7 @@ public class FieldEvaluator implements Evaluator {
private Object evaluateField(Object object, EvaluationContextImpl context) throws EvaluateException {
if (object instanceof ReferenceType) {
ReferenceType refType = (ReferenceType)object;
Field field = findField(refType, context);
Field field = findField(refType);
if (field == null || !field.isStatic()) {
field = refType.fieldByName(myFieldName);
}
@@ -156,7 +156,7 @@ public class FieldEvaluator implements Evaluator {
);
}
Field field = findField(refType, context);
Field field = findField(refType);
if (field == null) {
field = refType.fieldByName(myFieldName);
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,19 +20,16 @@
*/
package com.intellij.debugger.engine.evaluation.expression;
import com.intellij.debugger.DebuggerBundle;
import com.intellij.debugger.engine.evaluation.EvaluateException;
import com.intellij.debugger.engine.evaluation.EvaluateExceptionUtil;
import com.intellij.debugger.engine.evaluation.EvaluationContextImpl;
import com.intellij.debugger.impl.DebuggerUtilsEx;
import com.intellij.debugger.engine.evaluation.EvaluateException;
import com.intellij.debugger.engine.evaluation.EvaluationContextImpl;
import com.intellij.debugger.engine.evaluation.EvaluateExceptionUtil;
import com.intellij.debugger.engine.evaluation.EvaluateException;
import com.intellij.debugger.DebuggerBundle;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.psi.PsiType;
import com.sun.jdi.*;
import java.util.LinkedList;
import java.util.List;
import java.util.Collections;
class InstanceofEvaluator implements Evaluator {
private static final Logger LOG = Logger.getInstance("#com.intellij.debugger.engine.evaluation.expression.InstanceofEvaluator");
@@ -62,9 +59,8 @@ class InstanceofEvaluator implements Evaluator {
ClassType classRefType = (ClassType)classObject.referenceType();
//noinspection HardCodedStringLiteral
Method method = classRefType.concreteMethodByName("isAssignableFrom", "(Ljava/lang/Class;)Z");
List args = new LinkedList();
args.add(((ObjectReference)value).referenceType().classObject());
return context.getDebugProcess().invokeMethod(context, classObject, method, args);
return context.getDebugProcess().invokeMethod(context, classObject, method,
Collections.singletonList(((ObjectReference)value).referenceType().classObject()));
}
catch (Exception e) {
if (LOG.isDebugEnabled()) {
@@ -115,7 +115,7 @@ public class ClassLoadingUtils {
}
private static ArrayReference createURLArray(EvaluationContext context)
throws EvaluateException, InvocationException, InvalidTypeException, ClassNotLoadedException, IncompatibleThreadStateException {
throws EvaluateException, InvalidTypeException, ClassNotLoadedException {
DebugProcess process = context.getDebugProcess();
ArrayType arrayType = (ArrayType)process.findClass(context, "java.net.URL[]", context.getClassLoader());
ArrayReference arrayRef = arrayType.newInstance(1);
@@ -19,13 +19,12 @@ import com.intellij.debugger.engine.DebugProcessImpl;
import com.intellij.debugger.engine.MethodFilter;
import com.intellij.debugger.engine.SuspendContextImpl;
import com.intellij.openapi.extensions.ExtensionPointName;
import org.jetbrains.annotations.Nullable;
/**
* @author egor
*/
public abstract class JvmSteppingCommandProvider {
public static ExtensionPointName<JvmSteppingCommandProvider> EP_NAME =
public static final ExtensionPointName<JvmSteppingCommandProvider> EP_NAME =
ExtensionPointName.create("com.intellij.debugger.jvmSteppingCommandProvider");
/**
@@ -25,7 +25,7 @@ import org.jetbrains.annotations.NotNull;
* To change this template use Options | File Templates.
*/
public abstract class JdiProxy {
@NotNull protected JdiTimer myTimer;
@NotNull protected final JdiTimer myTimer;
private int myTimeStamp = 0;
public JdiProxy(@NotNull JdiTimer timer) {
@@ -19,7 +19,6 @@ import com.intellij.debugger.SourcePosition;
import com.intellij.debugger.engine.ContextUtil;
import com.intellij.debugger.engine.DebugProcess;
import com.intellij.debugger.engine.StackFrameContext;
import com.intellij.debugger.engine.evaluation.EvaluateException;
import com.intellij.debugger.impl.DebuggerUtilsEx;
import com.intellij.debugger.impl.SimpleStackFrameContext;
import com.intellij.openapi.application.ApplicationManager;
@@ -215,7 +214,7 @@ public class LocalVariablesUtil {
@NotNull
private static List<DecompiledLocalVariable> collectVariablesFromBytecode(StackFrameProxyImpl frame,
final MultiMap<Integer, String> namesMap) throws EvaluateException {
final MultiMap<Integer, String> namesMap) {
if (!frame.getVirtualMachine().canGetBytecodes()) {
return Collections.emptyList();
}
@@ -55,7 +55,7 @@ public class VirtualMachineProxyImpl implements JdiTimer, VirtualMachineProxy {
private List<ReferenceType> myAllClasses;
private Map<ReferenceType, List<ReferenceType>> myNestedClassesCache = new HashMap<ReferenceType, List<ReferenceType>>();
public Throwable mySuspendLogger = new Throwable();
public final Throwable mySuspendLogger = new Throwable();
private final boolean myVersionHigher_15;
private final boolean myVersionHigher_14;
@@ -111,7 +111,7 @@ public class NodeRendererSettings implements PersistentStateComponent<Element> {
}
/**
* use {@link com.intellij.debugger.ui.tree.render.NodeRenderer} extension
* use {@link NodeRenderer} extension
* @param renderer
*/
@Deprecated
@@ -49,8 +49,8 @@ public class DebuggerExpressionComboBox extends DebuggerEditorImpl {
public static final Key<String> KEY = Key.create("DebuggerComboBoxEditor.KEY");
public static final int MAX_ROWS = 20;
private MyEditorComboBoxEditor myEditor;
private ComboBox myComboBox;
private final MyEditorComboBoxEditor myEditor;
private final ComboBox myComboBox;
private class MyEditorComboBoxEditor extends EditorComboBoxEditor {
@@ -86,7 +86,7 @@ public class DebuggerExpressionComboBox extends DebuggerEditorImpl {
}
private static DocumentListener REPLACE_NEWLINES_LISTENER = new DocumentAdapter() {
private static final DocumentListener REPLACE_NEWLINES_LISTENER = new DocumentAdapter() {
@Override
public void documentChanged(DocumentEvent e) {
final String text = e.getNewFragment().toString();
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -36,7 +36,7 @@ import org.jetbrains.annotations.NotNull;
*/
class DebuggerTreeCreatorImpl implements DebuggerTreeCreator<Pair<NodeDescriptorImpl, String>> {
private static final Logger LOG = Logger.getInstance("#com.intellij.debugger.ui.ValueHintTreeComponent");
private Project myProject;
private final Project myProject;
public DebuggerTreeCreatorImpl(Project project) {
myProject = project;
@@ -43,7 +43,7 @@ import java.util.List;
public class HotSwapProgressImpl extends HotSwapProgress{
static final NotificationGroup NOTIFICATION_GROUP = NotificationGroup.toolWindowGroup("HotSwap", ToolWindowId.DEBUG);
TIntObjectHashMap<List<String>> myMessages = new TIntObjectHashMap<List<String>>();
private final TIntObjectHashMap<List<String>> myMessages = new TIntObjectHashMap<List<String>>();
private final ProgressWindow myProgressWindow;
private String myTitle = DebuggerBundle.message("progress.hot.swap.title");
private final MergingUpdateQueue myUpdateQueue;
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2012 JetBrains s.r.o.
* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,8 +26,8 @@ import javax.swing.*;
public class XBreakpointClassGroup extends XBreakpointGroup {
private static final String DEFAULT_PACKAGE_NAME = DebuggerBundle.message("default.package.name");
private String myPackageName;
private String myClassName;
private final String myPackageName;
private final String myClassName;
public XBreakpointClassGroup(@Nullable String packageName, String className) {
myPackageName = packageName != null ? packageName : DEFAULT_PACKAGE_NAME;
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2012 JetBrains s.r.o.
* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,7 +26,7 @@ import javax.swing.*;
public class XBreakpointPackageGroup extends XBreakpointGroup {
private static final String DEFAULT_PACKAGE_NAME = DebuggerBundle.message("default.package.name");
private String myPackageName;
private final String myPackageName;
public XBreakpointPackageGroup(String packageName) {
myPackageName = packageName;
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,6 +29,7 @@ import com.intellij.ide.util.TreeClassChooserFactory;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.openapi.ui.TextFieldWithBrowseButton;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.*;
import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.ui.DocumentAdapter;
@@ -115,7 +116,7 @@ public abstract class AddFieldBreakpointDialog extends DialogWrapper {
private PsiClass getSelectedClass() {
final PsiManager psiManager = PsiManager.getInstance(myProject);
String classQName = myClassChooser.getText();
if ("".equals(classQName)) {
if (StringUtil.isEmpty(classQName)) {
return null;
}
return JavaPsiFacade.getInstance(psiManager.getProject()).findClass(classQName, GlobalSearchScope.allScope(myProject));
@@ -65,7 +65,7 @@ import javax.swing.*;
import java.util.List;
public abstract class Breakpoint<P extends JavaBreakpointProperties> implements FilteredRequestor, ClassPrepareRequestor {
public static Key<Breakpoint> DATA_KEY = Key.create("JavaBreakpoint");
public static final Key<Breakpoint> DATA_KEY = Key.create("JavaBreakpoint");
final XBreakpoint<P> myXBreakpoint;
protected final Project myProject;
@@ -450,14 +450,14 @@ public class BreakpointManager {
xBreakpoint = createXLineBreakpoint(JavaMethodBreakpointType.class, breakpointNode);
}
else {
xBreakpoint = createXBreakpoint(JavaWildcardMethodBreakpointType.class, breakpointNode);
xBreakpoint = createXBreakpoint(JavaWildcardMethodBreakpointType.class);
}
}
else if (category.equals(FieldBreakpoint.CATEGORY.toString())) {
xBreakpoint = createXLineBreakpoint(JavaFieldBreakpointType.class, breakpointNode);
}
else if (category.equals(ExceptionBreakpoint.CATEGORY.toString())) {
xBreakpoint = createXBreakpoint(JavaExceptionBreakpointType.class, breakpointNode);
xBreakpoint = createXBreakpoint(JavaExceptionBreakpointType.class);
}
if (xBreakpoint == null) {
throw new IllegalStateException("Unknown breakpoint category " + category);
@@ -465,14 +465,12 @@ public class BreakpointManager {
return getJavaBreakpoint(xBreakpoint);
}
private <B extends XBreakpoint<?>> XBreakpoint createXBreakpoint(Class<? extends XBreakpointType<B, ?>> typeCls,
Element breakpointNode) throws InvalidDataException {
private <B extends XBreakpoint<?>> XBreakpoint createXBreakpoint(Class<? extends XBreakpointType<B, ?>> typeCls) {
final XBreakpointType<B, ?> type = XDebuggerUtil.getInstance().findBreakpointType(typeCls);
return ApplicationManager.getApplication().runWriteAction(new Computable<XBreakpoint>() {
@Override
public XBreakpoint compute() {
return XDebuggerManager.getInstance(myProject).getBreakpointManager()
.addBreakpoint((XBreakpointType)type, type.createProperties());
return XDebuggerManager.getInstance(myProject).getBreakpointManager().addBreakpoint((XBreakpointType)type, type.createProperties());
}
});
}
@@ -34,8 +34,8 @@ import java.awt.*;
public class EditClassFiltersDialog extends DialogWrapper {
private ClassFilterEditor myClassFilterEditor;
private ClassFilterEditor myClassExclusionFilterEditor;
private Project myProject;
private ClassFilter myChooserFilter;
private final Project myProject;
private final ClassFilter myChooserFilter;
public EditClassFiltersDialog(Project project) {
this(project, null);
@@ -191,7 +191,7 @@ public class LineBreakpoint<P extends JavaBreakpointProperties> extends Breakpoi
updateUI();
}
private static Pattern ourAnonymousPattern = Pattern.compile(".*\\$\\d*$");
private static final Pattern ourAnonymousPattern = Pattern.compile(".*\\$\\d*$");
private static boolean isAnonymousClass(ReferenceType classType) {
if (classType instanceof ClassType) {
return ourAnonymousPattern.matcher(classType.name()).matches();
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,8 +27,8 @@ public class MessageDescriptor extends NodeDescriptorImpl {
public static final int WARNING = 1;
public static final int INFORMATION = 2;
public static final int SPECIAL = 3;
private int myKind;
private String myMessage;
private final int myKind;
private final String myMessage;
public static final MessageDescriptor DEBUG_INFO_UNAVAILABLE = new MessageDescriptor(DebuggerBundle.message("message.node.debug.info.not.available"));
public static final MessageDescriptor LOCAL_VARIABLES_INFO_UNAVAILABLE = new MessageDescriptor(
@@ -43,7 +43,7 @@ public abstract class CustomPopupFullValueEvaluator<T> extends JavaValue.JavaFul
protected abstract JComponent createComponent(T data);
@Override
public void evaluate(@NotNull final XFullValueEvaluationCallback callback) throws Exception {
public void evaluate(@NotNull final XFullValueEvaluationCallback callback) {
final T data = getData();
DebuggerUIUtil.invokeLater(new Runnable() {
@Override
@@ -52,7 +52,7 @@ class StackTraceElementObjectRenderer extends ToStringBasedRenderer implements F
public XFullValueEvaluator getFullValueEvaluator(final EvaluationContextImpl evaluationContext, final ValueDescriptorImpl valueDescriptor) {
return new JavaValue.JavaFullValueEvaluator(DebuggerBundle.message("message.node.navigate"), evaluationContext) {
@Override
public void evaluate(@NotNull XFullValueEvaluationCallback callback) throws Exception {
public void evaluate(@NotNull XFullValueEvaluationCallback callback) {
Value value = valueDescriptor.getValue();
ClassType type = ((ClassType)value.type());
Method toString = type.concreteMethodByName("toString", "()Ljava/lang/String;");
@@ -137,19 +137,16 @@ public class ToStringRenderer extends NodeRendererImpl {
}
public void buildChildren(Value value, ChildrenBuilder builder, EvaluationContext evaluationContext) {
final DebugProcessImpl debugProcess = (DebugProcessImpl)evaluationContext.getDebugProcess();
debugProcess.getDefaultRenderer(value).buildChildren(value, builder, evaluationContext);
DebugProcessImpl.getDefaultRenderer(value).buildChildren(value, builder, evaluationContext);
}
public PsiElement getChildValueExpression(DebuggerTreeNode node, DebuggerContext context) throws EvaluateException {
final Value parentValue = ((ValueDescriptor)node.getParent().getDescriptor()).getValue();
final DebugProcessImpl debugProcess = (DebugProcessImpl)context.getDebugProcess();
return debugProcess.getDefaultRenderer(parentValue).getChildValueExpression(node, context);
return DebugProcessImpl.getDefaultRenderer(parentValue).getChildValueExpression(node, context);
}
public boolean isExpandable(Value value, EvaluationContext evaluationContext, NodeDescriptor parentDescriptor) {
final DebugProcessImpl debugProcess = (DebugProcessImpl)evaluationContext.getDebugProcess();
return debugProcess.getDefaultRenderer(value).isExpandable(value, evaluationContext, parentDescriptor);
return DebugProcessImpl.getDefaultRenderer(value).isExpandable(value, evaluationContext, parentDescriptor);
}
@SuppressWarnings({"HardCodedStringLiteral"})
@@ -54,7 +54,7 @@ public class NamedChildrenConfigurable implements UnnamedConfigurable, Disposabl
private JButton myButtonRemove;
private JButton myButtonUp;
private JButton myButtonDown;
private CompletionEditor myCompletionEditor;
private final CompletionEditor myCompletionEditor;
public NamedChildrenConfigurable(@NotNull Project project, EnumerationChildrenRenderer renderer) {
myRenderer = renderer;
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,6 +26,7 @@ import com.intellij.openapi.vfs.impl.http.HttpVirtualFile;
import com.intellij.pom.Navigatable;
import com.intellij.psi.PsiElement;
import com.intellij.testFramework.LightVirtualFile;
import com.intellij.xdebugger.XDebuggerUtil;
import com.intellij.xdebugger.XSourcePosition;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -61,7 +62,7 @@ public class XSourcePositionImpl implements XSourcePosition {
}
/**
* do not call this method from plugins, use {@link com.intellij.xdebugger.XDebuggerUtil#createPositionByOffset(com.intellij.openapi.vfs.VirtualFile, int)} instead
* do not call this method from plugins, use {@link XDebuggerUtil#createPositionByOffset(VirtualFile, int)} instead
*/
@Nullable
public static XSourcePositionImpl createByOffset(@Nullable VirtualFile file, final int offset) {
@@ -94,7 +95,7 @@ public class XSourcePositionImpl implements XSourcePosition {
}
/**
* do not call this method from plugins, use {@link com.intellij.xdebugger.XDebuggerUtil#createPosition(com.intellij.openapi.vfs.VirtualFile, int)} instead
* do not call this method from plugins, use {@link XDebuggerUtil#createPosition(VirtualFile, int)} instead
*/
@Nullable
public static XSourcePositionImpl create(@Nullable VirtualFile file, int line) {
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2011 JetBrains s.r.o.
* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -33,7 +33,7 @@ public class EditBreakpointAction extends XDebuggerActionBase implements DumbAwa
public static class ContextAction extends DumbAwareAction {
private final GutterIconRenderer myRenderer;
private final Object myBreakpoint;
private DebuggerSupport myDebuggerSupport;
private final DebuggerSupport myDebuggerSupport;
public ContextAction(GutterIconRenderer breakpointRenderer, Object breakpoint, DebuggerSupport debuggerSupport) {
super(ActionsBundle.actionText("EditBreakpoint"));
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,10 +17,10 @@ package com.intellij.xdebugger.impl.actions;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.actionSystem.ToggleAction;
import com.intellij.openapi.project.Project;
import com.intellij.xdebugger.impl.DebuggerSupport;
import org.jetbrains.annotations.NotNull;
/**
* @author nik
@@ -52,7 +52,7 @@ public class MuteBreakpointAction extends ToggleAction {
}
}
public void update(final AnActionEvent e) {
public void update(@NotNull final AnActionEvent e) {
super.update(e);
Project project = e.getData(CommonDataKeys.PROJECT);
if (project != null) {
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,7 +23,7 @@ import com.intellij.xdebugger.XDebuggerBundle;
import com.intellij.xdebugger.XDebuggerUtil;
class RemoveBreakpointGutterIconAction extends DumbAwareAction {
private XBreakpointBase<?,?,?> myBreakpoint;
private final XBreakpointBase<?,?,?> myBreakpoint;
RemoveBreakpointGutterIconAction(XBreakpointBase<?, ?, ?> breakpoint) {
super(XDebuggerBundle.message("xdebugger.remove.line.breakpoint.action.text"));
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2011 JetBrains s.r.o.
* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,7 +26,7 @@ import com.intellij.xdebugger.breakpoints.XBreakpoint;
* @author nik
*/
class ToggleBreakpointGutterIconAction extends DumbAwareAction {
private XBreakpoint<?> myBreakpoint;
private final XBreakpoint<?> myBreakpoint;
ToggleBreakpointGutterIconAction(XBreakpoint<?> breakpoint) {
super(breakpoint.isEnabled() ? XDebuggerBundle.message("xdebugger.disable.breakpoint.action.text") : XDebuggerBundle.message("xdebugger.enable.breakpoint.action.text"));
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2012 JetBrains s.r.o.
* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -108,7 +108,7 @@ public class XBreakpointPanelProvider extends BreakpointPanelProvider<XBreakpoin
if (breakpoint instanceof XLineBreakpointImpl) {
RangeHighlighter highlighter = ((XLineBreakpointImpl)breakpoint).getHighlighter();
if (highlighter != null) {
return (GutterIconRenderer)highlighter.getGutterIconRenderer();
return highlighter.getGutterIconRenderer();
}
}
return null;
@@ -131,8 +131,8 @@ public class XBreakpointPanelProvider extends BreakpointPanelProvider<XBreakpoin
}
private static class MyXBreakpointListener implements XBreakpointListener<XBreakpoint<?>> {
public BreakpointsListener myListener;
public XBreakpointManager myBreakpointManager;
public final BreakpointsListener myListener;
public final XBreakpointManager myBreakpointManager;
public MyXBreakpointListener(BreakpointsListener listener, XBreakpointManager breakpointManager) {
myListener = listener;
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2012 JetBrains s.r.o.
* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -37,11 +37,11 @@ public class BreakpointChooser {
private DetailView myDetailViewDelegate;
private Delegate myDelegate;
private final Delegate myDelegate;
private final ComboBox myComboBox;
private DetailController myDetailController;
private final DetailController myDetailController;
private final List<BreakpointItem> myBreakpointItems;
private BreakpointChooser.MyDetailView myDetailView;
@@ -82,7 +82,7 @@ public class BreakpointChooser {
final Ref<Object> hackedSelection = Ref.create();
myDetailController = new DetailController(new MasterController() {
JLabel fake = new JLabel();
final JLabel fake = new JLabel();
@Override
public ItemWrapper[] getSelectedItems() {
if (hackedSelection.get() == null) {
@@ -212,7 +212,7 @@ public class BreakpointChooser {
return true;
}
UserDataHolderBase myDataHolderBase = new UserDataHolderBase();
final UserDataHolderBase myDataHolderBase = new UserDataHolderBase();
@Override
public <T> T getUserData(@NotNull Key<T> key) {
@@ -62,16 +62,16 @@ import java.util.*;
import java.util.List;
public class BreakpointsDialog extends DialogWrapper {
@NotNull private Project myProject;
@NotNull private final Project myProject;
private Object myInitialBreakpoint;
private List<BreakpointPanelProvider> myBreakpointsPanelProviders;
private final Object myInitialBreakpoint;
private final List<BreakpointPanelProvider> myBreakpointsPanelProviders;
private BreakpointItemsTreeController myTreeController;
JLabel temp = new JLabel();
final JLabel temp = new JLabel();
private MasterController myMasterController = new MasterController() {
private final MasterController myMasterController = new MasterController() {
@Override
public ItemWrapper[] getSelectedItems() {
final List<BreakpointItem> res = myTreeController.getSelectedBreakpoints(false);
@@ -189,7 +189,7 @@ public class BreakpointsDialog extends DialogWrapper {
}
private class ToggleBreakpointGroupingRuleEnabledAction extends ToggleActionButton {
private XBreakpointGroupingRule myRule;
private final XBreakpointGroupingRule myRule;
public ToggleBreakpointGroupingRuleEnabledAction(XBreakpointGroupingRule rule) {
super(rule.getPresentableName(), rule.getIcon());
@@ -25,7 +25,7 @@ import org.jetbrains.annotations.Nullable;
public class BreakpointsDialogFactory {
private Project myProject;
private final Project myProject;
private Balloon myBalloonToHide;
private Object myBreakpoint;
private BreakpointsDialog myDialogShowing;
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2012 JetBrains s.r.o.
* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,7 +17,6 @@ package com.intellij.xdebugger.impl.breakpoints.ui.grouping;
import com.intellij.util.ArrayUtil;
import com.intellij.xdebugger.breakpoints.XBreakpointType;
import com.intellij.xdebugger.breakpoints.XLineBreakpoint;
import com.intellij.xdebugger.breakpoints.XLineBreakpointType;
import com.intellij.xdebugger.breakpoints.ui.XBreakpointGroup;
import com.intellij.xdebugger.impl.breakpoints.XBreakpointUtil;
@@ -27,7 +26,7 @@ import javax.swing.*;
public class XBreakpointTypeGroup extends XBreakpointGroup {
private XBreakpointType myBreakpointType;
private final XBreakpointType myBreakpointType;
public XBreakpointTypeGroup(XBreakpointType type) {
myBreakpointType = type;
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2012 JetBrains s.r.o.
* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,11 +22,12 @@ import com.intellij.ui.SimpleTextAttributes;
import com.intellij.xdebugger.breakpoints.ui.XBreakpointGroup;
import com.intellij.xdebugger.impl.breakpoints.ui.BreakpointItem;
import com.intellij.xdebugger.impl.breakpoints.ui.grouping.XBreakpointCustomGroup;
import org.jetbrains.annotations.NotNull;
import javax.swing.*;
class BreakpointsTreeCellRenderer {
private static SimpleTextAttributes SIMPLE_CELL_ATTRIBUTES_BOLD = SimpleTextAttributes.SIMPLE_CELL_ATTRIBUTES.derive(SimpleTextAttributes.STYLE_BOLD, null, null, null);
private static final SimpleTextAttributes SIMPLE_CELL_ATTRIBUTES_BOLD = SimpleTextAttributes.SIMPLE_CELL_ATTRIBUTES.derive(SimpleTextAttributes.STYLE_BOLD, null, null, null);
private static void customizeRenderer(Project project,
Object value,
@@ -71,7 +72,7 @@ class BreakpointsTreeCellRenderer {
}
@Override
public void customizeCellRenderer(JTree tree,
public void customizeCellRenderer(@NotNull JTree tree,
Object value,
boolean selected,
boolean expanded,
@@ -279,7 +279,7 @@ public class XDebuggerEditorLinePainter extends EditorLinePainter {
}
private static class VariableText {
List<LineExtensionInfo> infos = new ArrayList<LineExtensionInfo>();
final List<LineExtensionInfo> infos = new ArrayList<LineExtensionInfo>();
int length = 0;
void add(LineExtensionInfo info) {
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -138,7 +138,7 @@ abstract class DebuggerTreeWithHistoryContainer<D> {
}
private class SetAsRootAction extends AnAction {
private Tree myTree;
private final Tree myTree;
public SetAsRootAction(Tree tree) {
super(XDebuggerBundle.message("xdebugger.popup.value.tree.set.root.action.tooltip"),
@@ -31,6 +31,7 @@ import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Key;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.util.Alarm;
import com.intellij.xdebugger.XDebuggerUtil;
import com.intellij.xdebugger.impl.DebuggerSupport;
import org.jetbrains.annotations.NotNull;
@@ -38,7 +39,7 @@ import java.awt.*;
public class ValueLookupManager extends EditorMouseAdapter implements EditorMouseMotionListener {
/**
* @see com.intellij.xdebugger.XDebuggerUtil#disableValueLookup(com.intellij.openapi.editor.Editor)
* @see XDebuggerUtil#disableValueLookup(Editor)
*/
public static final Key<Boolean> DISABLE_VALUE_LOOKUP = Key.create("DISABLE_VALUE_LOOKUP");
@@ -65,7 +65,7 @@ public class XDebugSessionTab extends DebuggerSessionTabBase {
private XDebugSessionImpl mySession;
private XDebugSessionData mySessionData;
private Runnable myRebuildWatchesRunnable = new Runnable() {
private final Runnable myRebuildWatchesRunnable = new Runnable() {
@Override
public void run() {
if (myWatchesView != null && myWatchesView.rebuildNeeded()) {
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,7 +31,7 @@ import javax.swing.tree.TreePath;
public abstract class XDebuggerTreeInplaceEditor extends TreeInplaceEditor {
private final XDebuggerTreeNode myNode;
protected final XDebuggerExpressionComboBox myExpressionEditor;
protected XDebuggerTree myTree;
protected final XDebuggerTree myTree;
public XDebuggerTreeInplaceEditor(final XDebuggerTreeNode node, @NonNls final String historyId) {
myNode = node;
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,5 +23,5 @@ import com.intellij.xdebugger.frame.presentation.XValuePresentation;
public abstract class XValueExtendedPresentation extends XValuePresentation {
public boolean isModified() {
return false;
};
}
}