diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/JavaFieldBreakpointType.java b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/JavaFieldBreakpointType.java index f34898b7f615..f534e8883a63 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/JavaFieldBreakpointType.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/JavaFieldBreakpointType.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. @@ -181,4 +181,9 @@ public class JavaFieldBreakpointType extends JavaLineBreakpointTypeBase exten public int getPriority() { return 0; } + + /** + * Return true if this breakpoint could be hit on lines other than the one specified, + * an example is method breakpoint in java - it could be hit on any method overriding the one specified + */ + public boolean canBeHitInOtherPlaces() { + return false; + } } diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebugSessionImpl.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebugSessionImpl.java index b8abd9764511..520a4e395267 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebugSessionImpl.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebugSessionImpl.java @@ -713,7 +713,8 @@ public class XDebugSessionImpl implements XDebugSession { } } - myActiveNonLineBreakpoint = !(breakpoint instanceof XLineBreakpoint) ? breakpoint : null; + myActiveNonLineBreakpoint = + (!(breakpoint instanceof XLineBreakpoint) || ((XLineBreakpoint)breakpoint).getType().canBeHitInOtherPlaces()) ? breakpoint : null; positionReached(suspendContext); UIUtil.invokeLaterIfNeeded(new Runnable() {