Skip to content

Commit 51815e5

Browse files
committed
Add family for the quick diff initialize job
The quick diff initialization job currently has no family, making it difficult to wait on it during tests. During JDT UI SaveParticipantTest we observe the job running in parallel to the test, potentially running into errors due to file operations done in the test. This change adds a family that tests can use to wait on the job. Fixes: #4172 See also: eclipse-jdt/eclipse.jdt.ui#79
1 parent 0e1835a commit 51815e5

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

  • bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/quickdiff

bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/quickdiff/DocumentLineDiffer.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,11 @@ public String[] getOriginalText() {
134134
}
135135
}
136136

137+
/**
138+
* Family for the quick diff initialize job.
139+
*/
140+
public static final Object QUICKDIFF_INITIALIZE_FAMILY = new Object();
141+
137142
/** Tells whether this class is in debug mode. */
138143
private static boolean DEBUG= "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.ui.workbench.texteditor/debug/DocumentLineDiffer")); //$NON-NLS-1$//$NON-NLS-2$
139144

@@ -550,6 +555,11 @@ protected synchronized void initialize() {
550555
: QuickDiffMessages.quickdiff_initialize;
551556
fInitializationJob= new Job(jobName) {
552557

558+
@Override
559+
public boolean belongsTo(Object family) {
560+
return family == QUICKDIFF_INITIALIZE_FAMILY;
561+
}
562+
553563
/*
554564
* This is run in a different thread. As the documents might be synchronized, never ever
555565
* access the documents in a synchronized section or expect deadlocks. See

0 commit comments

Comments
 (0)