Call module init helpers on debug builds
Reviewed By: SeyelentEco Differential Revision: D8879847 fbshipit-source-id: 812ff0098fc8e3c85ab0a33df5e4ade919209583
This commit is contained in:
committed by
Facebook Github Bot
parent
0244f15dab
commit
5b0e742fe6
@@ -48,8 +48,14 @@ public class InspectorSonarPlugin implements SonarPlugin {
|
||||
SonarReceiver receiver(ObjectTracker tracker, SonarConnection connection);
|
||||
}
|
||||
|
||||
private static Application getAppContextFromContext(Context context) {
|
||||
Context nonNullContext =
|
||||
context.getApplicationContext() == null ? context : context.getApplicationContext();
|
||||
return (Application) context;
|
||||
}
|
||||
|
||||
public InspectorSonarPlugin(Context context, DescriptorMapping descriptorMapping) {
|
||||
this(context, descriptorMapping, new NullScriptingEnvironment());
|
||||
this(getAppContextFromContext(context), descriptorMapping, new NullScriptingEnvironment());
|
||||
}
|
||||
|
||||
public InspectorSonarPlugin(
|
||||
@@ -57,7 +63,7 @@ public class InspectorSonarPlugin implements SonarPlugin {
|
||||
DescriptorMapping descriptorMapping,
|
||||
ScriptingEnvironment scriptingEnvironment) {
|
||||
this(
|
||||
new ApplicationWrapper((Application) context.getApplicationContext()),
|
||||
new ApplicationWrapper(getAppContextFromContext(context)),
|
||||
descriptorMapping,
|
||||
scriptingEnvironment,
|
||||
null);
|
||||
@@ -68,7 +74,7 @@ public class InspectorSonarPlugin implements SonarPlugin {
|
||||
DescriptorMapping descriptorMapping,
|
||||
@Nullable List<ExtensionCommand> extensions) {
|
||||
this(
|
||||
new ApplicationWrapper((Application) context.getApplicationContext()),
|
||||
new ApplicationWrapper(getAppContextFromContext(context)),
|
||||
descriptorMapping,
|
||||
new NullScriptingEnvironment(),
|
||||
extensions);
|
||||
@@ -79,8 +85,9 @@ public class InspectorSonarPlugin implements SonarPlugin {
|
||||
DescriptorMapping descriptorMapping,
|
||||
ScriptingEnvironment scriptingEnvironment,
|
||||
@Nullable List<ExtensionCommand> extensions) {
|
||||
|
||||
this(
|
||||
new ApplicationWrapper((Application) context.getApplicationContext()),
|
||||
new ApplicationWrapper(getAppContextFromContext(context)),
|
||||
descriptorMapping,
|
||||
scriptingEnvironment,
|
||||
extensions);
|
||||
|
||||
Reference in New Issue
Block a user