1818
1919import java .io .File ;
2020import java .io .IOException ;
21+ import java .util .Collection ;
2122import java .util .LinkedHashSet ;
2223import java .util .Optional ;
2324import java .util .Set ;
2425
2526import org .eclipse .buildship .core .GradleBuild ;
2627import org .eclipse .buildship .core .internal .CorePlugin ;
27- import org .eclipse .buildship .core .internal .workspace .FetchStrategy ;
2828import org .eclipse .buildship .core .internal .workspace .InternalGradleBuild ;
2929import org .eclipse .buildship .core .internal .workspace .InternalGradleWorkspace ;
30- import org .eclipse .buildship .core .internal .workspace .ModelProviderUtil ;
3130import org .eclipse .core .resources .IProject ;
3231import org .eclipse .core .resources .ResourcesPlugin ;
3332import org .eclipse .core .runtime .CoreException ;
@@ -86,15 +85,15 @@ private void configureProjects(IProgressMonitor monitor) throws CoreException, I
8685
8786 private void configureProject (IProject project , InternalGradleBuild build , IProgressMonitor monitor )
8887 throws CoreException , IOException {
89- Set <EclipseProject > projects = ModelProviderUtil . fetchAllEclipseProjects ( build , this . tokenSource ,
90- FetchStrategy . FORCE_RELOAD , monitor );
88+ Collection <EclipseProject > projects = build . getModelProvider ()
89+ . fetchEclipseProjectAndRunSyncTasks ( this . tokenSource , monitor );
9190 if (hasSpringFormatPlugin (projects )) {
9291 ProjectSettingsFilesLocator locator = new ProjectSettingsFilesLocator (getSearchFolders (projects ));
9392 locator .locateSettingsFiles ().applyToProject (project , monitor );
9493 }
9594 }
9695
97- private boolean hasSpringFormatPlugin (Set <EclipseProject > projects ) {
96+ private boolean hasSpringFormatPlugin (Collection <EclipseProject > projects ) {
9897 for (EclipseProject project : projects ) {
9998 for (GradleTask task : project .getGradleProject ().getTasks ()) {
10099 if (isSpringFormatPlugin (task )) {
@@ -109,7 +108,7 @@ private boolean isSpringFormatPlugin(GradleTask task) {
109108 return TASK_NAME .equals (task .getName ());
110109 }
111110
112- private Set <File > getSearchFolders (Set <EclipseProject > projects ) {
111+ private Set <File > getSearchFolders (Collection <EclipseProject > projects ) {
113112 Set <File > searchFolders = new LinkedHashSet <>();
114113 for (EclipseProject project : projects ) {
115114 while (project != null ) {
0 commit comments