18
18
19
19
import java .io .File ;
20
20
import java .io .IOException ;
21
+ import java .util .Collection ;
21
22
import java .util .LinkedHashSet ;
22
23
import java .util .Optional ;
23
24
import java .util .Set ;
30
31
import org .eclipse .buildship .core .internal .workspace .FetchStrategy ;
31
32
import org .eclipse .buildship .core .internal .workspace .InternalGradleBuild ;
32
33
import org .eclipse .buildship .core .internal .workspace .InternalGradleWorkspace ;
33
- import org .eclipse .buildship .core .internal .workspace .ModelProviderUtil ;
34
34
import org .eclipse .core .resources .IProject ;
35
35
import org .eclipse .core .runtime .CoreException ;
36
36
import org .eclipse .core .runtime .IProgressMonitor ;
@@ -74,16 +74,16 @@ private void configureProject(IProject project, IProgressMonitor monitor) throws
74
74
InternalGradleWorkspace workspace = CorePlugin .internalGradleWorkspace ();
75
75
Optional <GradleBuild > build = workspace .getBuild (project );
76
76
if (build .isPresent ()) {
77
- Set <EclipseProject > projects = ModelProviderUtil . fetchAllEclipseProjects ((InternalGradleBuild ) build .get (),
78
- this . tokenSource , FetchStrategy .FORCE_RELOAD , monitor );
77
+ Collection <EclipseProject > projects = ((InternalGradleBuild ) build .get ()). getModelProvider ()
78
+ . fetchModels ( EclipseProject . class , FetchStrategy .FORCE_RELOAD , this . tokenSource , monitor );
79
79
if (hasSpringFormatPlugin (projects )) {
80
80
ProjectSettingsFilesLocator locator = new ProjectSettingsFilesLocator (getSearchFolders (projects ));
81
81
locator .locateSettingsFiles ().applyToProject (project , monitor );
82
82
}
83
83
}
84
84
}
85
85
86
- private boolean hasSpringFormatPlugin (Set <EclipseProject > projects ) {
86
+ private boolean hasSpringFormatPlugin (Collection <EclipseProject > projects ) {
87
87
for (EclipseProject project : projects ) {
88
88
for (GradleTask task : project .getGradleProject ().getTasks ()) {
89
89
if (isSpringFormatPlugin (task )) {
@@ -98,7 +98,7 @@ private boolean isSpringFormatPlugin(GradleTask task) {
98
98
return TASK_NAME .equals (task .getName ());
99
99
}
100
100
101
- private Set <File > getSearchFolders (Set <EclipseProject > projects ) {
101
+ private Set <File > getSearchFolders (Collection <EclipseProject > projects ) {
102
102
Set <File > searchFolders = new LinkedHashSet <>();
103
103
for (EclipseProject project : projects ) {
104
104
while (project != null ) {
0 commit comments