From b97b6d4b3ca83ff723e58292faad8715437d81f3 Mon Sep 17 00:00:00 2001 From: "Egor.Ushakov" Date: Tue, 6 Oct 2015 18:46:29 +0300 Subject: [PATCH] cleanup - final where appropriate --- .../actions/JvmSmartStepIntoHandler.java | 2 +- .../engine/CompoundPositionManager.java | 2 +- .../debugger/engine/DebugProcessImpl.java | 4 ++-- .../intellij/debugger/engine/JVMNameUtil.java | 2 +- .../intellij/debugger/engine/JavaValue.java | 2 +- .../engine/SourcePositionProvider.java | 4 ++-- .../debugger/engine/SuspendContextImpl.java | 2 +- .../expression/ExpressionEvaluatorImpl.java | 4 ++-- .../evaluation/expression/FieldEvaluator.java | 12 ++++++------ .../expression/InstanceofEvaluator.java | 18 +++++++----------- .../debugger/impl/ClassLoadingUtils.java | 2 +- .../impl/JvmSteppingCommandProvider.java | 3 +-- .../com/intellij/debugger/jdi/JdiProxy.java | 2 +- .../debugger/jdi/LocalVariablesUtil.java | 3 +-- .../debugger/jdi/VirtualMachineProxyImpl.java | 2 +- .../settings/NodeRendererSettings.java | 2 +- .../ui/DebuggerExpressionComboBox.java | 6 +++--- .../debugger/ui/DebuggerTreeCreatorImpl.java | 4 ++-- .../debugger/ui/HotSwapProgressImpl.java | 2 +- .../debugger/ui/XBreakpointClassGroup.java | 6 +++--- .../debugger/ui/XBreakpointPackageGroup.java | 4 ++-- .../breakpoints/AddFieldBreakpointDialog.java | 5 +++-- .../debugger/ui/breakpoints/Breakpoint.java | 2 +- .../ui/breakpoints/BreakpointManager.java | 10 ++++------ .../ui/breakpoints/EditClassFiltersDialog.java | 4 ++-- .../ui/breakpoints/LineBreakpoint.java | 2 +- .../ui/impl/watch/MessageDescriptor.java | 6 +++--- .../render/CustomPopupFullValueEvaluator.java | 2 +- .../StackTraceElementObjectRenderer.java | 2 +- .../ui/tree/render/ToStringRenderer.java | 9 +++------ .../NamedChildrenConfigurable.java | 2 +- .../xdebugger/impl/XSourcePositionImpl.java | 7 ++++--- .../impl/actions/EditBreakpointAction.java | 4 ++-- .../impl/actions/MuteBreakpointAction.java | 6 +++--- .../RemoveBreakpointGutterIconAction.java | 4 ++-- .../ToggleBreakpointGutterIconAction.java | 4 ++-- .../breakpoints/XBreakpointPanelProvider.java | 8 ++++---- .../impl/breakpoints/ui/BreakpointChooser.java | 10 +++++----- .../impl/breakpoints/ui/BreakpointsDialog.java | 12 ++++++------ .../ui/BreakpointsDialogFactory.java | 2 +- .../ui/grouping/XBreakpointTypeGroup.java | 5 ++--- .../ui/tree/BreakpointsTreeCellRenderer.java | 7 ++++--- .../evaluate/XDebuggerEditorLinePainter.java | 2 +- .../DebuggerTreeWithHistoryContainer.java | 4 ++-- .../quick/common/ValueLookupManager.java | 3 ++- .../xdebugger/impl/ui/XDebugSessionTab.java | 2 +- .../ui/tree/XDebuggerTreeInplaceEditor.java | 4 ++-- .../ui/tree/XValueExtendedPresentation.java | 4 ++-- 48 files changed, 106 insertions(+), 114 deletions(-) diff --git a/java/debugger/impl/src/com/intellij/debugger/actions/JvmSmartStepIntoHandler.java b/java/debugger/impl/src/com/intellij/debugger/actions/JvmSmartStepIntoHandler.java index 69a3255cd49c..41d4368ff66e 100644 --- a/java/debugger/impl/src/com/intellij/debugger/actions/JvmSmartStepIntoHandler.java +++ b/java/debugger/impl/src/com/intellij/debugger/actions/JvmSmartStepIntoHandler.java @@ -42,7 +42,7 @@ import java.util.List; * Date: 22.11.11 */ public abstract class JvmSmartStepIntoHandler { - public static ExtensionPointName EP_NAME = ExtensionPointName.create("com.intellij.debugger.jvmSmartStepIntoHandler"); + public static final ExtensionPointName EP_NAME = ExtensionPointName.create("com.intellij.debugger.jvmSmartStepIntoHandler"); @NotNull public abstract List findSmartStepTargets(SourcePosition position); diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/CompoundPositionManager.java b/java/debugger/impl/src/com/intellij/debugger/engine/CompoundPositionManager.java index e954855507e5..29e9da063354 100644 --- a/java/debugger/impl/src/com/intellij/debugger/engine/CompoundPositionManager.java +++ b/java/debugger/impl/src/com/intellij/debugger/engine/CompoundPositionManager.java @@ -58,7 +58,7 @@ public class CompoundPositionManager extends PositionManagerEx implements MultiR myPositionManagers.add(0, manager); } - private Cache mySourcePositionCache = new Cache(); + private final Cache mySourcePositionCache = new Cache(); private interface Processor { T process(PositionManager positionManager) throws NoDataException; diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/DebugProcessImpl.java b/java/debugger/impl/src/com/intellij/debugger/engine/DebugProcessImpl.java index ce73228da077..93d1e20a6fe2 100644 --- a/java/debugger/impl/src/com/intellij/debugger/engine/DebugProcessImpl.java +++ b/java/debugger/impl/src/com/intellij/debugger/engine/DebugProcessImpl.java @@ -103,8 +103,8 @@ public abstract class DebugProcessImpl extends UserDataHolderBase implements Deb private final RequestManagerImpl myRequestManager; private volatile VirtualMachineProxyImpl myVirtualMachineProxy = null; - protected EventDispatcher myDebugProcessDispatcher = EventDispatcher.create(DebugProcessListener.class); - protected EventDispatcher myEvaluationDispatcher = EventDispatcher.create(EvaluationListener.class); + protected final EventDispatcher myDebugProcessDispatcher = EventDispatcher.create(DebugProcessListener.class); + protected final EventDispatcher myEvaluationDispatcher = EventDispatcher.create(EvaluationListener.class); private final List myProcessListeners = ContainerUtil.createLockFreeCopyOnWriteList(); diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/JVMNameUtil.java b/java/debugger/impl/src/com/intellij/debugger/engine/JVMNameUtil.java index c520b4be4418..80ec955f8b2f 100644 --- a/java/debugger/impl/src/com/intellij/debugger/engine/JVMNameUtil.java +++ b/java/debugger/impl/src/com/intellij/debugger/engine/JVMNameUtil.java @@ -125,7 +125,7 @@ public class JVMNameUtil { } private static class JVMNameBuffer { - List myList = new ArrayList(); + private final List myList = new ArrayList(); public void append(@NotNull JVMName evaluator){ myList.add(evaluator); diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/JavaValue.java b/java/debugger/impl/src/com/intellij/debugger/engine/JavaValue.java index 66de6219ca28..c238aaf35792 100644 --- a/java/debugger/impl/src/com/intellij/debugger/engine/JavaValue.java +++ b/java/debugger/impl/src/com/intellij/debugger/engine/JavaValue.java @@ -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 diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/SourcePositionProvider.java b/java/debugger/impl/src/com/intellij/debugger/engine/SourcePositionProvider.java index a9382682aaca..3c04d1066298 100644 --- a/java/debugger/impl/src/com/intellij/debugger/engine/SourcePositionProvider.java +++ b/java/debugger/impl/src/com/intellij/debugger/engine/SourcePositionProvider.java @@ -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 EP_NAME = ExtensionPointName.create("com.intellij.debugger.sourcePositionProvider"); + public static final ExtensionPointName EP_NAME = ExtensionPointName.create("com.intellij.debugger.sourcePositionProvider"); @Nullable public static SourcePosition getSourcePosition(@NotNull NodeDescriptor descriptor, diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/SuspendContextImpl.java b/java/debugger/impl/src/com/intellij/debugger/engine/SuspendContextImpl.java index 8f93dea4b85f..dd9f6cace703 100644 --- a/java/debugger/impl/src/com/intellij/debugger/engine/SuspendContextImpl.java +++ b/java/debugger/impl/src/com/intellij/debugger/engine/SuspendContextImpl.java @@ -56,7 +56,7 @@ public abstract class SuspendContextImpl extends XSuspendContext implements Susp private final EventSet myEventSet; private volatile boolean myIsResumed; - public ConcurrentLinkedQueue myPostponedCommands = new ConcurrentLinkedQueue(); + private final ConcurrentLinkedQueue myPostponedCommands = new ConcurrentLinkedQueue(); public volatile boolean myInProgress; private final HashSet myKeptReferences = new HashSet(); private EvaluationContextImpl myEvaluationContext = null; diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/ExpressionEvaluatorImpl.java b/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/ExpressionEvaluatorImpl.java index 66fd0eb3971e..9c8ab0671541 100644 --- a/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/ExpressionEvaluatorImpl.java +++ b/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/ExpressionEvaluatorImpl.java @@ -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) { diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/FieldEvaluator.java b/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/FieldEvaluator.java index 7c72e154a24d..faa4c8dc5151 100644 --- a/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/FieldEvaluator.java +++ b/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/FieldEvaluator.java @@ -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); } diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/InstanceofEvaluator.java b/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/InstanceofEvaluator.java index 2a3c0101c4b5..d9e8eacf06cf 100644 --- a/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/InstanceofEvaluator.java +++ b/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/InstanceofEvaluator.java @@ -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()) { diff --git a/java/debugger/impl/src/com/intellij/debugger/impl/ClassLoadingUtils.java b/java/debugger/impl/src/com/intellij/debugger/impl/ClassLoadingUtils.java index 56b4b03962e2..2e158d9c6c9a 100644 --- a/java/debugger/impl/src/com/intellij/debugger/impl/ClassLoadingUtils.java +++ b/java/debugger/impl/src/com/intellij/debugger/impl/ClassLoadingUtils.java @@ -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); diff --git a/java/debugger/impl/src/com/intellij/debugger/impl/JvmSteppingCommandProvider.java b/java/debugger/impl/src/com/intellij/debugger/impl/JvmSteppingCommandProvider.java index 3331a4c98b8e..911c35bff4ba 100644 --- a/java/debugger/impl/src/com/intellij/debugger/impl/JvmSteppingCommandProvider.java +++ b/java/debugger/impl/src/com/intellij/debugger/impl/JvmSteppingCommandProvider.java @@ -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 EP_NAME = + public static final ExtensionPointName EP_NAME = ExtensionPointName.create("com.intellij.debugger.jvmSteppingCommandProvider"); /** diff --git a/java/debugger/impl/src/com/intellij/debugger/jdi/JdiProxy.java b/java/debugger/impl/src/com/intellij/debugger/jdi/JdiProxy.java index 1552cdeae648..28d7f697c5f7 100644 --- a/java/debugger/impl/src/com/intellij/debugger/jdi/JdiProxy.java +++ b/java/debugger/impl/src/com/intellij/debugger/jdi/JdiProxy.java @@ -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) { diff --git a/java/debugger/impl/src/com/intellij/debugger/jdi/LocalVariablesUtil.java b/java/debugger/impl/src/com/intellij/debugger/jdi/LocalVariablesUtil.java index b204903ca751..61713e2428e0 100644 --- a/java/debugger/impl/src/com/intellij/debugger/jdi/LocalVariablesUtil.java +++ b/java/debugger/impl/src/com/intellij/debugger/jdi/LocalVariablesUtil.java @@ -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 collectVariablesFromBytecode(StackFrameProxyImpl frame, - final MultiMap namesMap) throws EvaluateException { + final MultiMap namesMap) { if (!frame.getVirtualMachine().canGetBytecodes()) { return Collections.emptyList(); } diff --git a/java/debugger/impl/src/com/intellij/debugger/jdi/VirtualMachineProxyImpl.java b/java/debugger/impl/src/com/intellij/debugger/jdi/VirtualMachineProxyImpl.java index fb99c0360a4a..fac6657e49c1 100644 --- a/java/debugger/impl/src/com/intellij/debugger/jdi/VirtualMachineProxyImpl.java +++ b/java/debugger/impl/src/com/intellij/debugger/jdi/VirtualMachineProxyImpl.java @@ -55,7 +55,7 @@ public class VirtualMachineProxyImpl implements JdiTimer, VirtualMachineProxy { private List myAllClasses; private Map> myNestedClassesCache = new HashMap>(); - public Throwable mySuspendLogger = new Throwable(); + public final Throwable mySuspendLogger = new Throwable(); private final boolean myVersionHigher_15; private final boolean myVersionHigher_14; diff --git a/java/debugger/impl/src/com/intellij/debugger/settings/NodeRendererSettings.java b/java/debugger/impl/src/com/intellij/debugger/settings/NodeRendererSettings.java index 996c878f212f..5facfe560008 100644 --- a/java/debugger/impl/src/com/intellij/debugger/settings/NodeRendererSettings.java +++ b/java/debugger/impl/src/com/intellij/debugger/settings/NodeRendererSettings.java @@ -111,7 +111,7 @@ public class NodeRendererSettings implements PersistentStateComponent { } /** - * use {@link com.intellij.debugger.ui.tree.render.NodeRenderer} extension + * use {@link NodeRenderer} extension * @param renderer */ @Deprecated diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/DebuggerExpressionComboBox.java b/java/debugger/impl/src/com/intellij/debugger/ui/DebuggerExpressionComboBox.java index cb855d5ba6fb..9da44b91b0af 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/DebuggerExpressionComboBox.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/DebuggerExpressionComboBox.java @@ -49,8 +49,8 @@ public class DebuggerExpressionComboBox extends DebuggerEditorImpl { public static final Key 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(); diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/DebuggerTreeCreatorImpl.java b/java/debugger/impl/src/com/intellij/debugger/ui/DebuggerTreeCreatorImpl.java index 556c7691f4bf..a9fbf18748c2 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/DebuggerTreeCreatorImpl.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/DebuggerTreeCreatorImpl.java @@ -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> { 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; diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/HotSwapProgressImpl.java b/java/debugger/impl/src/com/intellij/debugger/ui/HotSwapProgressImpl.java index 787e5bf35b80..ee70fcb6d051 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/HotSwapProgressImpl.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/HotSwapProgressImpl.java @@ -43,7 +43,7 @@ import java.util.List; public class HotSwapProgressImpl extends HotSwapProgress{ static final NotificationGroup NOTIFICATION_GROUP = NotificationGroup.toolWindowGroup("HotSwap", ToolWindowId.DEBUG); - TIntObjectHashMap> myMessages = new TIntObjectHashMap>(); + private final TIntObjectHashMap> myMessages = new TIntObjectHashMap>(); private final ProgressWindow myProgressWindow; private String myTitle = DebuggerBundle.message("progress.hot.swap.title"); private final MergingUpdateQueue myUpdateQueue; diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/XBreakpointClassGroup.java b/java/debugger/impl/src/com/intellij/debugger/ui/XBreakpointClassGroup.java index ca978304202e..84285c355f8f 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/XBreakpointClassGroup.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/XBreakpointClassGroup.java @@ -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; diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/XBreakpointPackageGroup.java b/java/debugger/impl/src/com/intellij/debugger/ui/XBreakpointPackageGroup.java index 0d193a20255b..5d969a67accb 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/XBreakpointPackageGroup.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/XBreakpointPackageGroup.java @@ -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; diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/AddFieldBreakpointDialog.java b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/AddFieldBreakpointDialog.java index e3cd5229e0ab..10aa1402cb68 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/AddFieldBreakpointDialog.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/AddFieldBreakpointDialog.java @@ -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)); diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/Breakpoint.java b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/Breakpoint.java index 79ecd9bc27a1..e7b992b4a057 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/Breakpoint.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/Breakpoint.java @@ -65,7 +65,7 @@ import javax.swing.*; import java.util.List; public abstract class Breakpoint

implements FilteredRequestor, ClassPrepareRequestor { - public static Key DATA_KEY = Key.create("JavaBreakpoint"); + public static final Key DATA_KEY = Key.create("JavaBreakpoint"); final XBreakpoint

myXBreakpoint; protected final Project myProject; diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointManager.java b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointManager.java index b1a5e3565e23..393c1219b486 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointManager.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointManager.java @@ -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 > XBreakpoint createXBreakpoint(Class> typeCls, - Element breakpointNode) throws InvalidDataException { + private > XBreakpoint createXBreakpoint(Class> typeCls) { final XBreakpointType type = XDebuggerUtil.getInstance().findBreakpointType(typeCls); return ApplicationManager.getApplication().runWriteAction(new Computable() { @Override public XBreakpoint compute() { - return XDebuggerManager.getInstance(myProject).getBreakpointManager() - .addBreakpoint((XBreakpointType)type, type.createProperties()); + return XDebuggerManager.getInstance(myProject).getBreakpointManager().addBreakpoint((XBreakpointType)type, type.createProperties()); } }); } diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/EditClassFiltersDialog.java b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/EditClassFiltersDialog.java index 1b623a946ee9..5ce98b1f6433 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/EditClassFiltersDialog.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/EditClassFiltersDialog.java @@ -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); diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/LineBreakpoint.java b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/LineBreakpoint.java index 2b6784ed0c6e..2c744a288b3a 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/LineBreakpoint.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/LineBreakpoint.java @@ -191,7 +191,7 @@ public class LineBreakpoint

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(); diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/MessageDescriptor.java b/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/MessageDescriptor.java index 502df8af71d8..773d794377da 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/MessageDescriptor.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/MessageDescriptor.java @@ -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( diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/CustomPopupFullValueEvaluator.java b/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/CustomPopupFullValueEvaluator.java index 6925a2964f23..3c05ea06e373 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/CustomPopupFullValueEvaluator.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/CustomPopupFullValueEvaluator.java @@ -43,7 +43,7 @@ public abstract class CustomPopupFullValueEvaluator 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 diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/StackTraceElementObjectRenderer.java b/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/StackTraceElementObjectRenderer.java index d9e7ffd9eb1d..a0388342514a 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/StackTraceElementObjectRenderer.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/StackTraceElementObjectRenderer.java @@ -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;"); diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/ToStringRenderer.java b/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/ToStringRenderer.java index 6bf5983d9232..4fbcaaf616ff 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/ToStringRenderer.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/ToStringRenderer.java @@ -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"}) diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/configurables/NamedChildrenConfigurable.java b/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/configurables/NamedChildrenConfigurable.java index a0e5ac85f4f8..89f4acff9b84 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/configurables/NamedChildrenConfigurable.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/configurables/NamedChildrenConfigurable.java @@ -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; diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XSourcePositionImpl.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XSourcePositionImpl.java index 8ccc8b629a76..78fd43bacf05 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XSourcePositionImpl.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XSourcePositionImpl.java @@ -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) { diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/EditBreakpointAction.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/EditBreakpointAction.java index 9683ba106986..2d515d5ed34c 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/EditBreakpointAction.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/EditBreakpointAction.java @@ -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")); diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/MuteBreakpointAction.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/MuteBreakpointAction.java index 4fc1bf2400f9..7869ea026ab9 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/MuteBreakpointAction.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/MuteBreakpointAction.java @@ -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) { diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/RemoveBreakpointGutterIconAction.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/RemoveBreakpointGutterIconAction.java index c8b34bb3ec03..c248038f8d78 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/RemoveBreakpointGutterIconAction.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/RemoveBreakpointGutterIconAction.java @@ -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")); diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ToggleBreakpointGutterIconAction.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ToggleBreakpointGutterIconAction.java index 010f8a2bf96f..b0f20f1988f6 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ToggleBreakpointGutterIconAction.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ToggleBreakpointGutterIconAction.java @@ -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")); diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/XBreakpointPanelProvider.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/XBreakpointPanelProvider.java index c2bfb8132b38..5a4dc383909e 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/XBreakpointPanelProvider.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/XBreakpointPanelProvider.java @@ -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> { - public BreakpointsListener myListener; - public XBreakpointManager myBreakpointManager; + public final BreakpointsListener myListener; + public final XBreakpointManager myBreakpointManager; public MyXBreakpointListener(BreakpointsListener listener, XBreakpointManager breakpointManager) { myListener = listener; diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/BreakpointChooser.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/BreakpointChooser.java index 563c614efa5c..7854321bb6ee 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/BreakpointChooser.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/BreakpointChooser.java @@ -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 myBreakpointItems; private BreakpointChooser.MyDetailView myDetailView; @@ -82,7 +82,7 @@ public class BreakpointChooser { final Ref 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 getUserData(@NotNull Key key) { diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/BreakpointsDialog.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/BreakpointsDialog.java index 3c7d56b68a13..89c19a95c56f 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/BreakpointsDialog.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/BreakpointsDialog.java @@ -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 myBreakpointsPanelProviders; + private final Object myInitialBreakpoint; + private final List 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 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()); diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/BreakpointsDialogFactory.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/BreakpointsDialogFactory.java index 87ac62482d50..e0fe6457aff1 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/BreakpointsDialogFactory.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/BreakpointsDialogFactory.java @@ -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; diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/grouping/XBreakpointTypeGroup.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/grouping/XBreakpointTypeGroup.java index f1dd95cc47b0..305ca6d267bf 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/grouping/XBreakpointTypeGroup.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/grouping/XBreakpointTypeGroup.java @@ -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; diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/tree/BreakpointsTreeCellRenderer.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/tree/BreakpointsTreeCellRenderer.java index 8aa3ed2faa30..f3958bc08269 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/tree/BreakpointsTreeCellRenderer.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/tree/BreakpointsTreeCellRenderer.java @@ -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, diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/evaluate/XDebuggerEditorLinePainter.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/evaluate/XDebuggerEditorLinePainter.java index f6bbb646c4b9..50e98a4a306c 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/evaluate/XDebuggerEditorLinePainter.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/evaluate/XDebuggerEditorLinePainter.java @@ -279,7 +279,7 @@ public class XDebuggerEditorLinePainter extends EditorLinePainter { } private static class VariableText { - List infos = new ArrayList(); + final List infos = new ArrayList(); int length = 0; void add(LineExtensionInfo info) { diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/evaluate/quick/common/DebuggerTreeWithHistoryContainer.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/evaluate/quick/common/DebuggerTreeWithHistoryContainer.java index 783c5c093092..0313124eb69a 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/evaluate/quick/common/DebuggerTreeWithHistoryContainer.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/evaluate/quick/common/DebuggerTreeWithHistoryContainer.java @@ -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 { } 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"), diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/evaluate/quick/common/ValueLookupManager.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/evaluate/quick/common/ValueLookupManager.java index 770295d4f0cc..7f49d407ead1 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/evaluate/quick/common/ValueLookupManager.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/evaluate/quick/common/ValueLookupManager.java @@ -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 DISABLE_VALUE_LOOKUP = Key.create("DISABLE_VALUE_LOOKUP"); diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/XDebugSessionTab.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/XDebugSessionTab.java index b35b150c82f3..0953eb98830b 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/XDebugSessionTab.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/XDebugSessionTab.java @@ -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()) { diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/XDebuggerTreeInplaceEditor.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/XDebuggerTreeInplaceEditor.java index ae456cb065fb..49b2c47b20c1 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/XDebuggerTreeInplaceEditor.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/XDebuggerTreeInplaceEditor.java @@ -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; diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/XValueExtendedPresentation.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/XValueExtendedPresentation.java index eab188951085..01e77e146035 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/XValueExtendedPresentation.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/XValueExtendedPresentation.java @@ -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; - }; + } }