File tree 6 files changed +15
-15
lines changed
flutter-idea/src/io/flutter
flutter-studio/src/io/flutter/android
6 files changed +15
-15
lines changed Original file line number Diff line number Diff line change @@ -550,7 +550,12 @@ public static EmbeddedBrowser embeddedBrowser(Project project) {
550
550
return null ;
551
551
}
552
552
553
- return FlutterSettings .getInstance ().isEnableJcefBrowser ()
553
+ FlutterSettings settings = FlutterSettings .getInstance ();
554
+ if (settings == null ) {
555
+ return null ;
556
+ }
557
+
558
+ return settings .isEnableJcefBrowser ()
554
559
? EmbeddedJcefBrowser .getInstance (project )
555
560
: EmbeddedJxBrowser .getInstance (project );
556
561
}
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ public class EmbeddedBrowserEngine {
25
25
private final Engine engine ;
26
26
27
27
public static EmbeddedBrowserEngine getInstance () {
28
- return ServiceManager .getService (EmbeddedBrowserEngine .class );
28
+ return ApplicationManager . getApplication () .getService (EmbeddedBrowserEngine .class );
29
29
}
30
30
31
31
public EmbeddedBrowserEngine () {
Original file line number Diff line number Diff line change 6
6
package io .flutter .module .settings ;
7
7
8
8
import com .intellij .ide .browsers .BrowserLauncher ;
9
- import com .intellij .openapi .components .ServiceManager ;
10
9
import com .intellij .ui .components .labels .LinkLabel ;
11
10
import io .flutter .FlutterBundle ;
12
11
import io .flutter .FlutterConstants ;
@@ -36,10 +35,6 @@ public class SettingsHelpForm {
36
35
@ SuppressWarnings ("rawtypes" )
37
36
private LinkLabel gettingStartedUrl ;
38
37
39
- public static SettingsHelpForm getInstance () {
40
- return ServiceManager .getService (SettingsHelpForm .class );
41
- }
42
-
43
38
public SettingsHelpForm () {
44
39
projectTypeLabel .setText (FlutterBundle .message ("flutter.module.create.settings.help.project_type.label" ));
45
40
projectTypeDescriptionForApp .setText (FlutterBundle .message ("flutter.module.create.settings.help.project_type.description.app" ));
Original file line number Diff line number Diff line change 7
7
8
8
import com .google .common .annotations .VisibleForTesting ;
9
9
import com .intellij .ide .util .PropertiesComponent ;
10
+ import com .intellij .openapi .application .ApplicationManager ;
10
11
import com .intellij .openapi .components .ServiceManager ;
11
12
import com .intellij .openapi .util .registry .Registry ;
12
13
import com .intellij .util .EventDispatcher ;
13
14
import com .jetbrains .lang .dart .analyzer .DartClosingLabelManager ;
14
15
15
16
import java .util .EventListener ;
17
+ import java .util .Objects ;
16
18
17
19
public class FlutterSettings {
18
20
private static final String reloadOnSaveKey = "io.flutter.reloadOnSave" ;
@@ -62,7 +64,7 @@ public static FlutterSettings getInstance() {
62
64
return testInstance ;
63
65
}
64
66
65
- return ServiceManager .getService (FlutterSettings .class );
67
+ return Objects . requireNonNull ( ApplicationManager . getApplication ()) .getService (FlutterSettings .class );
66
68
}
67
69
68
70
protected static PropertiesComponent getPropertiesComponent () {
Original file line number Diff line number Diff line change 15
15
16
16
import javax .swing .*;
17
17
import java .awt .Dimension ;
18
+ import java .util .Objects ;
18
19
19
20
class EmbeddedJcefBrowserTab implements EmbeddedTab {
20
21
private JBCefBrowser browser ;
@@ -48,8 +49,8 @@ public EmbeddedJcefBrowser(Project project) {
48
49
}
49
50
50
51
@ NotNull
51
- public static EmbeddedJcefBrowser getInstance (Project project ) {
52
- return ServiceManager . getService (project , EmbeddedJcefBrowser .class );
52
+ public static EmbeddedJcefBrowser getInstance (@ NotNull Project project ) {
53
+ return Objects . requireNonNull (project . getService ( EmbeddedJcefBrowser .class ) );
53
54
}
54
55
55
56
public Logger logger () {
Original file line number Diff line number Diff line change 61
61
import java .lang .reflect .Method ;
62
62
import java .nio .file .Path ;
63
63
import java .nio .file .Paths ;
64
- import java .util .Arrays ;
65
- import java .util .HashSet ;
66
- import java .util .List ;
67
- import java .util .Set ;
64
+ import java .util .*;
68
65
import java .util .concurrent .atomic .AtomicBoolean ;
69
66
import java .util .function .Function ;
70
67
import java .util .stream .Collectors ;
@@ -263,7 +260,7 @@ private static boolean shouldIncludeRoot(String path) {
263
260
264
261
@ NotNull
265
262
public static AndroidModuleLibraryManager getInstance (@ NotNull final Project project ) {
266
- return ServiceManager . getService (project , AndroidModuleLibraryManager .class );
263
+ return Objects . requireNonNull (project . getService ( AndroidModuleLibraryManager .class ) );
267
264
}
268
265
269
266
public static void startWatching (@ NotNull Project project ) {
You can’t perform that action at this time.
0 commit comments