diff --git a/java/debugger/impl/src/com/intellij/debugger/actions/ThrowDebugExceptionAction.java b/java/debugger/impl/src/com/intellij/debugger/actions/ThrowDebugExceptionAction.java index a7c244c6dfbb..bbe093b9d97d 100644 --- a/java/debugger/impl/src/com/intellij/debugger/actions/ThrowDebugExceptionAction.java +++ b/java/debugger/impl/src/com/intellij/debugger/actions/ThrowDebugExceptionAction.java @@ -1,6 +1,6 @@ /* - * 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,7 +27,7 @@ public class ThrowDebugExceptionAction extends AnAction implements DumbAware { try{ throw new DebugException(); } - catch(DebugException e){ + catch(DebugException ignored){ } } } diff --git a/java/debugger/impl/src/com/intellij/debugger/actions/ViewTextAction.java b/java/debugger/impl/src/com/intellij/debugger/actions/ViewTextAction.java index 098928e1eb52..5d69564a1f02 100644 --- a/java/debugger/impl/src/com/intellij/debugger/actions/ViewTextAction.java +++ b/java/debugger/impl/src/com/intellij/debugger/actions/ViewTextAction.java @@ -52,7 +52,7 @@ public class ViewTextAction extends XFetchValueActionBase { dialog.setText(StringUtil.unquoteString(value)); } }; - }; + } //@Override //protected void processText(final Project project, final String text, DebuggerTreeNodeImpl node, DebuggerContextImpl debuggerContext) { diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/BasicStepMethodFilter.java b/java/debugger/impl/src/com/intellij/debugger/engine/BasicStepMethodFilter.java index fcffb359c91e..49b645b8b5af 100644 --- a/java/debugger/impl/src/com/intellij/debugger/engine/BasicStepMethodFilter.java +++ b/java/debugger/impl/src/com/intellij/debugger/engine/BasicStepMethodFilter.java @@ -45,9 +45,9 @@ public class BasicStepMethodFilter implements NamedMethodFilter { } protected BasicStepMethodFilter(@NotNull JVMName declaringClassName, - @NotNull String targetMethodName, - JVMName targetMethodSignature, - Range callingExpressionLines) { + @NotNull String targetMethodName, + @Nullable JVMName targetMethodSignature, + Range callingExpressionLines) { myDeclaringClassName = declaringClassName; myTargetMethodName = targetMethodName; myTargetMethodSignature = targetMethodSignature; diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/JavaExecutionStack.java b/java/debugger/impl/src/com/intellij/debugger/engine/JavaExecutionStack.java index b0d8d3e6539d..27861ef0d08e 100644 --- a/java/debugger/impl/src/com/intellij/debugger/engine/JavaExecutionStack.java +++ b/java/debugger/impl/src/com/intellij/debugger/engine/JavaExecutionStack.java @@ -25,6 +25,7 @@ import com.intellij.debugger.jdi.ThreadReferenceProxyImpl; import com.intellij.debugger.settings.DebuggerSettings; import com.intellij.debugger.ui.impl.watch.MethodsTracker; import com.intellij.icons.AllIcons; +import com.intellij.openapi.diagnostic.Logger; import com.intellij.xdebugger.frame.XExecutionStack; import com.sun.jdi.ThreadReference; import org.jetbrains.annotations.NotNull; @@ -38,6 +39,8 @@ import java.util.Iterator; * @author egor */ public class JavaExecutionStack extends XExecutionStack { + private static final Logger LOG = Logger.getInstance(JavaExecutionStack.class); + private final ThreadReferenceProxyImpl myThreadProxy; private final DebugProcessImpl myDebugProcess; private volatile JavaStackFrame myTopFrame; @@ -79,7 +82,7 @@ public class JavaExecutionStack extends XExecutionStack { } } catch (EvaluateException e) { - e.printStackTrace(); + LOG.info(e); } finally { myTopFrameReady = true; diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/JavaValueModifier.java b/java/debugger/impl/src/com/intellij/debugger/engine/JavaValueModifier.java index 933b46f7aec3..410304dc9024 100644 --- a/java/debugger/impl/src/com/intellij/debugger/engine/JavaValueModifier.java +++ b/java/debugger/impl/src/com/intellij/debugger/engine/JavaValueModifier.java @@ -18,13 +18,13 @@ package com.intellij.debugger.engine; import com.intellij.debugger.DebuggerBundle; import com.intellij.debugger.DebuggerInvocationUtil; import com.intellij.debugger.DebuggerManagerEx; +import com.intellij.debugger.EvaluatingComputable; import com.intellij.debugger.engine.evaluation.*; import com.intellij.debugger.engine.evaluation.expression.*; import com.intellij.debugger.engine.events.DebuggerContextCommandImpl; import com.intellij.debugger.engine.events.SuspendContextCommandImpl; import com.intellij.debugger.impl.DebuggerContextImpl; import com.intellij.debugger.impl.DebuggerSession; -import com.intellij.debugger.impl.DebuggerUtilsEx; import com.intellij.debugger.jdi.LocalVariableProxyImpl; import com.intellij.debugger.jdi.VirtualMachineProxyImpl; import com.intellij.debugger.ui.impl.watch.*; @@ -273,7 +273,7 @@ public class JavaValueModifier extends XValueModifier { return value; } - private static interface SetValueRunnable { + private interface SetValueRunnable { void setValue(EvaluationContextImpl evaluationContext, Value newValue) throws ClassNotLoadedException, InvalidTypeException, EvaluateException, @@ -341,10 +341,10 @@ public class JavaValueModifier extends XValueModifier { } public void threadAction() { - ExpressionEvaluator evaluator = null; + ExpressionEvaluator evaluator; try { evaluator = DebuggerInvocationUtil - .commitAndRunReadAction(evaluationContext.getProject(), new com.intellij.debugger.EvaluatingComputable() { + .commitAndRunReadAction(evaluationContext.getProject(), new EvaluatingComputable() { public ExpressionEvaluator compute() throws EvaluateException { return EvaluatorBuilderImpl .build(new TextWithImportsImpl(CodeFragmentKind.EXPRESSION, expression), ContextUtil.getContextElement(evaluationContext), @@ -565,7 +565,7 @@ public class JavaValueModifier extends XValueModifier { // editor.show(); //} - @SuppressWarnings({"HardCodedStringLiteral"}) + @SuppressWarnings({"HardCodedStringLiteral", "StringToUpperCaseOrToLowerCaseWithoutLocale"}) private static String getDisplayableString(PrimitiveValue value, boolean showAsHex) { if (value instanceof CharValue) { long longValue = value.longValue(); @@ -595,7 +595,7 @@ public class JavaValueModifier extends XValueModifier { long val = value.longValue(); return showAsHex ? "0x" + Long.toHexString(val).toUpperCase() + "L" : value.toString() + "L"; } - return DebuggerUtilsEx.translateStringValue(value.toString()); + return DebuggerUtils.translateStringValue(value.toString()); } } diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/EvaluateRuntimeException.java b/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/EvaluateRuntimeException.java index a5b460cebc5d..42f9cebad8e5 100644 --- a/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/EvaluateRuntimeException.java +++ b/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/EvaluateRuntimeException.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. @@ -23,7 +23,7 @@ public class EvaluateRuntimeException extends RuntimeException { super(e); } - public EvaluateException getCause() { + public synchronized EvaluateException getCause() { return (EvaluateException)super.getCause(); } } diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/Evaluator.java b/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/Evaluator.java index 9c2efc4e05e2..ec0773dace44 100644 --- a/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/Evaluator.java +++ b/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/Evaluator.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. @@ -25,7 +25,7 @@ import com.intellij.debugger.engine.evaluation.EvaluateException; public interface Evaluator { /** - * @throws com.intellij.debugger.engine.evaluation.EvaluateException + * @throws EvaluateException */ Object evaluate(EvaluationContextImpl context) throws EvaluateException; diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/NewArrayInstanceEvaluator.java b/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/NewArrayInstanceEvaluator.java index ebcdf443c6be..6262165fc07d 100644 --- a/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/NewArrayInstanceEvaluator.java +++ b/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/NewArrayInstanceEvaluator.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. @@ -23,10 +23,10 @@ package com.intellij.debugger.engine.evaluation.expression; import com.intellij.debugger.DebuggerBundle; import com.intellij.debugger.engine.DebugProcessImpl; +import com.intellij.debugger.engine.DebuggerUtils; 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.openapi.diagnostic.Logger; import com.sun.jdi.*; @@ -60,7 +60,7 @@ class NewArrayInstanceEvaluator implements Evaluator { Object[] initialValues = null; if (myDimensionEvaluator != null) { Object o = myDimensionEvaluator.evaluate(context); - if (!(o instanceof Value && DebuggerUtilsEx.isNumeric((Value)o))) { + if (!(o instanceof Value && DebuggerUtils.isNumeric((Value)o))) { throw EvaluateExceptionUtil.createEvaluateException( DebuggerBundle.message("evaluation.error.array.dimention.numeric.value.expected") ); diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/UnaryExpressionEvaluator.java b/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/UnaryExpressionEvaluator.java index 77f3c34d907a..acbe88cccf77 100644 --- a/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/UnaryExpressionEvaluator.java +++ b/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/UnaryExpressionEvaluator.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. @@ -21,6 +21,7 @@ package com.intellij.debugger.engine.evaluation.expression; import com.intellij.debugger.DebuggerBundle; +import com.intellij.debugger.engine.DebuggerUtils; import com.intellij.debugger.engine.evaluation.EvaluateException; import com.intellij.debugger.engine.evaluation.EvaluateExceptionUtil; import com.intellij.debugger.engine.evaluation.EvaluationContextImpl; @@ -53,24 +54,24 @@ class UnaryExpressionEvaluator implements Evaluator { Value operand = (Value)myOperandEvaluator.evaluate(context); VirtualMachineProxyImpl vm = context.getDebugProcess().getVirtualMachineProxy(); if (myOperationType == JavaTokenType.PLUS) { - if (DebuggerUtilsEx.isNumeric(operand)) { + if (DebuggerUtils.isNumeric(operand)) { return operand; } throw EvaluateExceptionUtil.createEvaluateException(DebuggerBundle.message("evaluation.error.numeric.expected")); } else if (myOperationType == JavaTokenType.MINUS) { - if (DebuggerUtilsEx.isInteger(operand)) { + if (DebuggerUtils.isInteger(operand)) { long v = ((PrimitiveValue)operand).longValue(); return DebuggerUtilsEx.createValue(vm, myExpectedType, -v); } - if (DebuggerUtilsEx.isNumeric(operand)) { + if (DebuggerUtils.isNumeric(operand)) { double v = ((PrimitiveValue)operand).doubleValue(); return DebuggerUtilsEx.createValue(vm, myExpectedType, -v); } throw EvaluateExceptionUtil.createEvaluateException(DebuggerBundle.message("evaluation.error.numeric.expected")); } else if (myOperationType == JavaTokenType.TILDE) { - if (DebuggerUtilsEx.isInteger(operand)) { + if (DebuggerUtils.isInteger(operand)) { long v = ((PrimitiveValue)operand).longValue(); return DebuggerUtilsEx.createValue(vm, myExpectedType, ~v); } diff --git a/java/debugger/impl/src/com/intellij/debugger/impl/EventQueueClosedException.java b/java/debugger/impl/src/com/intellij/debugger/impl/EventQueueClosedException.java index d58b663f522a..c5c8ef10cad0 100644 --- a/java/debugger/impl/src/com/intellij/debugger/impl/EventQueueClosedException.java +++ b/java/debugger/impl/src/com/intellij/debugger/impl/EventQueueClosedException.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,7 +20,7 @@ package com.intellij.debugger.impl; */ public class EventQueueClosedException extends Exception { @Override - public Throwable fillInStackTrace() { + public synchronized Throwable fillInStackTrace() { return this; } } diff --git a/java/debugger/impl/src/com/intellij/debugger/jdi/Bytecodes.java b/java/debugger/impl/src/com/intellij/debugger/jdi/Bytecodes.java index 85bf698a930c..9f82d74a37dd 100644 --- a/java/debugger/impl/src/com/intellij/debugger/jdi/Bytecodes.java +++ b/java/debugger/impl/src/com/intellij/debugger/jdi/Bytecodes.java @@ -564,7 +564,7 @@ class Bytecodes { b[INVOKESTATIC_QUICK] = FIELDORMETH_INSN; // = 217; b[INVOKEINTERFACE_QUICK] = ITFMETH_INSN; // = 218; b[INVOKEVIRTUALOBJECT_QUICK] = FIELDORMETH_INSN; // = 219; - b[220] = Bytecodes.NOARG_INSN; // the ID is not used for any opcode + b[220] = NOARG_INSN; // the ID is not used for any opcode b[NEW_QUICK] = TYPE_INSN; // = 221; b[ANEWARRAY_QUICK] = TYPE_INSN; // = 222; b[MULTIANEWARRAY_QUICK] = MANA_INSN; // = 223; diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/EditorEvaluationCommand.java b/java/debugger/impl/src/com/intellij/debugger/ui/EditorEvaluationCommand.java index 414bdd340826..f2ee75790851 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/EditorEvaluationCommand.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/EditorEvaluationCommand.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. @@ -16,7 +16,6 @@ package com.intellij.debugger.ui; import com.intellij.codeInsight.hint.HintManager; -import com.intellij.codeInsight.hint.HintManagerImpl; import com.intellij.debugger.DebuggerBundle; import com.intellij.debugger.DebuggerInvocationUtil; import com.intellij.debugger.DebuggerManagerEx; @@ -87,8 +86,8 @@ public abstract class EditorEvaluationCommand extends DebuggerContextCommandI if (myEditor.isDisposed() || !myEditor.getComponent().isVisible()) return; HintManager.getInstance().showErrorHint(myEditor, e.getMessage(), myElement.getTextRange().getStartOffset(), - myElement.getTextRange().getEndOffset(), HintManagerImpl.UNDER, - HintManagerImpl.HIDE_BY_ESCAPE | HintManagerImpl.HIDE_BY_TEXT_CHANGE, + myElement.getTextRange().getEndOffset(), HintManager.UNDER, + HintManager.HIDE_BY_ESCAPE | HintManager.HIDE_BY_TEXT_CHANGE, 1500); } diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/RunHotswapDialog.java b/java/debugger/impl/src/com/intellij/debugger/ui/RunHotswapDialog.java index d59128c71c0f..76515b7dad65 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/RunHotswapDialog.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/RunHotswapDialog.java @@ -73,7 +73,7 @@ public class RunHotswapDialog extends OptionsDialog { else { setTitle(DebuggerBundle.message("hotswap.dialog.title")); } - setButtonsAlignment(SwingUtilities.CENTER); + setButtonsAlignment(SwingConstants.CENTER); this.init(); } diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/FieldBreakpoint.java b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/FieldBreakpoint.java index 5483eab9ed2b..3a647109c9ce 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/FieldBreakpoint.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/FieldBreakpoint.java @@ -382,11 +382,11 @@ public class FieldBreakpoint extends BreakpointWithHighlighter { private static final Logger LOG = Logger.getInstance("#com.intellij.debugger.ui.breakpoints.ExceptionBreakpoint"); @@ -90,7 +88,7 @@ public class WildcardMethodBreakpoint extends Breakpoint() { public PsiClass compute() { - return getClassName() != null ? DebuggerUtilsEx.findClass(getClassName(), myProject, GlobalSearchScope.allScope(myProject)) : null; + return getClassName() != null ? DebuggerUtils.findClass(getClassName(), myProject, GlobalSearchScope.allScope(myProject)) : null; } }); } @@ -236,11 +234,11 @@ public class WildcardMethodBreakpoint extends Breakpoint> myChildren; 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 0bd464a158c7..a0e5ac85f4f8 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 @@ -43,6 +43,7 @@ import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; +import java.util.List; public class NamedChildrenConfigurable implements UnnamedConfigurable, Disposable { private Table myTable; @@ -139,7 +140,7 @@ public class NamedChildrenConfigurable implements UnnamedConfigurable, Disposabl DefaultTableModel model = getModel(); final int size = model.getRowCount(); - java.util.List> result = new ArrayList>(); + List> result = new ArrayList>(); for (int idx = 0; idx < size; idx++) { result.add(Pair.create((String)model.getValueAt(idx, 0), (TextWithImports)model.getValueAt(idx, 1))); diff --git a/java/debugger/openapi/src/com/intellij/debugger/NoDataException.java b/java/debugger/openapi/src/com/intellij/debugger/NoDataException.java index 707ba0f445f3..74455dadd89b 100644 --- a/java/debugger/openapi/src/com/intellij/debugger/NoDataException.java +++ b/java/debugger/openapi/src/com/intellij/debugger/NoDataException.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. @@ -16,17 +16,18 @@ package com.intellij.debugger; public class NoDataException extends Exception { + @SuppressWarnings({"deprecation", "ThrowableInstanceNeverThrown"}) public static final NoDataException INSTANCE = new NoDataException(); /** - * @deprecated Use shared {@link com.intellij.debugger.NoDataException#INSTANCE} instead + * @deprecated Use shared {@link NoDataException#INSTANCE} instead */ @Deprecated public NoDataException() { } @Override - public Throwable fillInStackTrace() { + public synchronized Throwable fillInStackTrace() { return this; } } diff --git a/java/debugger/openapi/src/com/intellij/debugger/engine/evaluation/EvaluateExceptionUtil.java b/java/debugger/openapi/src/com/intellij/debugger/engine/evaluation/EvaluateExceptionUtil.java index bbf200afdeff..0e9cd150366f 100644 --- a/java/debugger/openapi/src/com/intellij/debugger/engine/evaluation/EvaluateExceptionUtil.java +++ b/java/debugger/openapi/src/com/intellij/debugger/engine/evaluation/EvaluateExceptionUtil.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. @@ -22,6 +22,7 @@ import com.sun.jdi.*; /** * @author lex */ +@SuppressWarnings("ThrowableResultOfMethodCallIgnored") public class EvaluateExceptionUtil { public static final EvaluateException INCONSISTEND_DEBUG_INFO = createEvaluateException(DebuggerBundle.message("evaluation.error.inconsistent.debug.info")); public static final EvaluateException BOOLEAN_EXPECTED = createEvaluateException(DebuggerBundle.message("evaluation.error.boolean.value.expected.in.condition"));