Skip to content

Commit 0d45dcf

Browse files
committed
Make LaunchManager's IResourceDeltaVisitors more light weight
Defer obtaining a delta's resource as long as possible and instead only on the full-path of the delta.
1 parent c95b821 commit 0d45dcf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ public static String serializeDocument(Document doc, String lineDelimiter) throw
542542
return false;
543543
}
544544
if (0 != (delta.getFlags() & IResourceDelta.OPEN)) {
545-
if (delta.getResource() instanceof IProject project) {
545+
if (delta.getFullPath().segmentCount() == 1 && delta.getResource() instanceof IProject project) {
546546
if (project.isOpen()) {
547547
LaunchManager.this.projectOpened(project);
548548
} else {
@@ -551,8 +551,8 @@ public static String serializeDocument(Document doc, String lineDelimiter) throw
551551
}
552552
return false;
553553
}
554-
if (delta.getResource() instanceof IFile file) {
555-
if (LAUNCH_CONFIG_FILE_EXTENSIONS.contains(file.getFileExtension())) {
554+
if (LAUNCH_CONFIG_FILE_EXTENSIONS.contains(delta.getFullPath().getFileExtension())) {
555+
if (delta.getResource() instanceof IFile file) {
556556
ILaunchConfiguration handle = new LaunchConfiguration(file);
557557
switch (delta.getKind()) {
558558
case IResourceDelta.ADDED:

0 commit comments

Comments
 (0)