Kotlinify JvmPluginStartupComponent p.2
Relates to #KT-38407
This commit is contained in:
committed by
Vladimir Dolzhenko
parent
fe3cf88e45
commit
fa2fb667e6
@@ -13,34 +13,28 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.jetbrains.kotlin.idea
|
||||||
|
|
||||||
package org.jetbrains.kotlin.idea;
|
import com.intellij.openapi.application.ApplicationManager
|
||||||
|
import com.intellij.openapi.components.BaseComponent
|
||||||
|
import org.jetbrains.kotlin.idea.ThreadTrackerPatcherForTeamCityTesting.patchThreadTracker
|
||||||
|
import org.jetbrains.kotlin.idea.debugger.filter.addKotlinStdlibDebugFilterIfNeeded
|
||||||
|
import org.jetbrains.kotlin.idea.util.application.isUnitTestMode
|
||||||
|
|
||||||
import com.intellij.openapi.application.ApplicationManager;
|
class JvmPluginStartupComponent : BaseComponent {
|
||||||
import com.intellij.openapi.components.BaseComponent;
|
override fun getComponentName(): String = JvmPluginStartupComponent::class.java.name
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
import org.jetbrains.kotlin.idea.debugger.filter.DebuggerFiltersUtilKt;
|
|
||||||
|
|
||||||
public class JvmPluginStartupComponent implements BaseComponent {
|
override fun initComponent() {
|
||||||
public static JvmPluginStartupComponent getInstance() {
|
if (isUnitTestMode()) {
|
||||||
return ApplicationManager.getApplication().getComponent(JvmPluginStartupComponent.class);
|
patchThreadTracker()
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@NotNull
|
|
||||||
public String getComponentName() {
|
|
||||||
return JvmPluginStartupComponent.class.getName();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void initComponent() {
|
|
||||||
if (ApplicationManager.getApplication().isUnitTestMode()) {
|
|
||||||
ThreadTrackerPatcherForTeamCityTesting.INSTANCE.patchThreadTracker();
|
|
||||||
}
|
}
|
||||||
|
addKotlinStdlibDebugFilterIfNeeded()
|
||||||
DebuggerFiltersUtilKt.addKotlinStdlibDebugFilterIfNeeded();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
override fun disposeComponent() {}
|
||||||
public void disposeComponent() {}
|
|
||||||
}
|
companion object {
|
||||||
|
fun getInstance(): JvmPluginStartupComponent =
|
||||||
|
ApplicationManager.getApplication().getComponent(JvmPluginStartupComponent::class.java)
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user