IDEA-352394 Breakpoints on commented lines in java code shouldn't be allowed

GitOrigin-RevId: 5113451d62b3b38621f2c62f0f83f6ce5b5f66b8
This commit is contained in:
Egor Ushakov
2024-05-03 14:15:46 +02:00
committed by intellij-monorepo-bot
parent b6217e6309
commit 72ccd6afd4

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.debugger.ui.breakpoints;
import com.intellij.debugger.engine.DebuggerUtils;
@@ -100,7 +100,7 @@ public abstract class JavaLineBreakpointTypeBase<P extends JavaBreakpointPropert
XDebuggerUtil.getInstance().iterateLine(project, document, line, element -> {
// avoid comments
if ((element instanceof PsiWhiteSpace)
|| (PsiTreeUtil.getParentOfType(element, PsiComment.class, PsiImportStatementBase.class, PsiPackageStatement.class) != null)) {
|| (PsiTreeUtil.getNonStrictParentOfType(element, PsiComment.class, PsiImportStatementBase.class, PsiPackageStatement.class) != null)) {
return true;
}
PsiElement parent = element;