<commit_before>package com.intellij.idea;

import com.incors.plaf.alloy.*;
import com.intellij.ExtensionPoints;
import com.intellij.ide.GeneralSettings;
import com.intellij.ide.RecentProjectsManager;
import com.intellij.ide.impl.ProjectUtil;
import com.intellij.ide.plugins.PluginManager;
import com.intellij.ide.reporter.ConnectionException;
import com.intellij.openapi.application.*;
import com.intellij.openapi.application.ex.ApplicationEx;
import com.intellij.openapi.application.ex.ApplicationManagerEx;
import com.intellij.openapi.application.impl.ApplicationInfoImpl;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.updateSettings.impl.UpdateChecker;
import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.InvalidDataException;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.wm.WindowManager;
import com.intellij.openapi.wm.impl.WindowManagerImpl;
import com.intellij.ui.Splash;
import org.jetbrains.annotations.NonNls;

import javax.swing.*;
import java.io.IOException;


@SuppressWarnings({"CallToPrintStackTrace"})
public class IdeaApplication {
  private static final Logger LOG = Logger.getInstance("#com.intellij.idea.IdeaApplication");

  private String[] myArgs;
  private boolean myPerformProjectLoad = true;
  private static IdeaApplication ourInstance;
  private ApplicationStarter myStarter;
  @NonNls public static final String IDEA_IS_INTERNAL_PROPERTY = "idea.is.internal";
  @NonNls public static final String IPR_SUFFIX = ".ipr";

  @SuppressWarnings({"HardCodedStringLiteral"})
  protected IdeaApplication(String[] args) {
    LOG.assertTrue(ourInstance == null);
    ourInstance = this;
    myArgs = args;
    boolean isInternal = Boolean.valueOf(System.getProperty(IDEA_IS_INTERNAL_PROPERTY)).booleanValue();
    if (Main.isHeadless()) {
      if (SystemInfo.isLinux) { //hack: do not initialize X11Toolit in headless environment
        System.setProperty("awt.toolkit", "sun.awt.HeadlessToolkit");
      }
      new CommandLineApplication(isInternal, false, "componentSets/IdeaComponents");
    } else {
      ApplicationManagerEx.createApplication("componentSets/IdeaComponents", isInternal, false, false, "idea");
    }

    myStarter = getStarter();
    myStarter.premain(args);
  }

  private ApplicationStarter getStarter() {
    if (myArgs.length > 0) {
      final Application app = ApplicationManager.getApplication();
      app.getPlugins(); //TODO[max] make it clearer plugins should initialize before querying for extpoints.<commit_msg>revert<commit_after>package com.intellij.idea;

import com.incors.plaf.alloy.*;
import com.intellij.ExtensionPoints;
import com.intellij.ide.GeneralSettings;
import com.intellij.ide.RecentProjectsManager;
import com.intellij.ide.impl.ProjectUtil;
import com.intellij.ide.plugins.PluginManager;
import com.intellij.ide.reporter.ConnectionException;
import com.intellij.openapi.application.*;
import com.intellij.openapi.application.ex.ApplicationEx;
import com.intellij.openapi.application.ex.ApplicationManagerEx;
import com.intellij.openapi.application.impl.ApplicationInfoImpl;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.updateSettings.impl.UpdateChecker;
import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.InvalidDataException;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.wm.WindowManager;
import com.intellij.openapi.wm.impl.WindowManagerImpl;
import com.intellij.ui.Splash;
import org.jetbrains.annotations.NonNls;

import javax.swing.*;
import java.io.IOException;


@SuppressWarnings({"CallToPrintStackTrace"})
public class IdeaApplication {
  private static final Logger LOG = Logger.getInstance("#com.intellij.idea.IdeaApplication");

  private String[] myArgs;
  private boolean myPerformProjectLoad = true;
  private static IdeaApplication ourInstance;
  private ApplicationStarter myStarter;
  @NonNls public static final String IDEA_IS_INTERNAL_PROPERTY = "idea.is.internal";
  @NonNls public static final String IPR_SUFFIX = ".ipr";

  @SuppressWarnings({"HardCodedStringLiteral"})
  protected IdeaApplication(String[] args) {
    LOG.assertTrue(ourInstance == null);
    ourInstance = this;
    myArgs = args;
    boolean isInternal = Boolean.valueOf(System.getProperty(IDEA_IS_INTERNAL_PROPERTY)).booleanValue();
    if (Main.isHeadless()) {
      new CommandLineApplication(isInternal, false, "componentSets/IdeaComponents");
    } else {
      ApplicationManagerEx.createApplication("componentSets/IdeaComponents", isInternal, false, false, "idea");
    }

    myStarter = getStarter();
    myStarter.premain(args);
  }

  private ApplicationStarter getStarter() {
    if (myArgs.length > 0) {
      final Application app = ApplicationManager.getApplication();
      app.getPlugins(); //TODO[max] make it clearer plugins should initialize before querying for extpoints.
{'fraction_non_alphanumeric': 0.1042371195544062, 'fraction_numerical': 0.0007957032027053909, 'mean_word_length': 5.5984251968503935, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4432052', 'n_tokens_mistral': 1526, 'n_tokens_neox': 1507, 'n_words': 283}