mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
cleanup [debugger]: use safe EP iteration
GitOrigin-RevId: 62c9bc89345e6a0166ac26ee36a7f9875ee794a9
This commit is contained in:
committed by
intellij-monorepo-bot
parent
7a4263971b
commit
cd72fd120c
@@ -550,12 +550,13 @@ public abstract class DebuggerUtilsEx extends DebuggerUtils {
|
||||
fileType = file != null ? file.getFileType() : null;
|
||||
}
|
||||
}
|
||||
for (CodeFragmentFactory factory : CodeFragmentFactory.EXTENSION_POINT_NAME.getExtensionList()) {
|
||||
if (factory != defaultFactory && (fileType == null || factory.getFileType().equals(fileType)) && factory.isContextAccepted(context)) {
|
||||
return factory;
|
||||
}
|
||||
}
|
||||
return defaultFactory;
|
||||
@Nullable FileType finalFileType = fileType;
|
||||
CodeFragmentFactory factory = CodeFragmentFactory.EXTENSION_POINT_NAME.findFirstSafe(f -> {
|
||||
return f != defaultFactory &&
|
||||
(finalFileType == null || f.getFileType().equals(finalFileType)) &&
|
||||
f.isContextAccepted(context);
|
||||
});
|
||||
return factory != null ? factory : defaultFactory;
|
||||
}
|
||||
|
||||
public static @NotNull CodeFragmentFactory findAppropriateCodeFragmentFactory(final TextWithImports text, final PsiElement context) {
|
||||
|
||||
Reference in New Issue
Block a user