/platform/bootstrap/src/com/intellij/ide/WindowsCommandLineProcessor.java

https://github.com/JetBrains/intellij-community · Java · 29 lines · 17 code · 3 blank · 9 comment · 2 complexity · 3c3ade3113e38b30c7436cdff02f40de MD5 · raw file

  1. // Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
  2. package com.intellij.ide;
  3. import java.lang.reflect.InvocationTargetException;
  4. import java.lang.reflect.Method;
  5. /**
  6. * This class is initialized in two class loaders: the bootstrap classloader and the main IDEA classloader. The bootstrap instance
  7. * has ourMirrorClass initialized by the Bootstrap class; it calls the main instance of itself via reflection.
  8. */
  9. public final class WindowsCommandLineProcessor {
  10. // The MainRunner class which is loaded in the main IDEA (non-bootstrap) classloader.
  11. public static Class<?> ourMainRunnerClass;
  12. /**
  13. * NOTE: This method is called through JNI by the Windows launcher. Please do not delete or rename it.
  14. */
  15. @SuppressWarnings("unused")
  16. public static int processWindowsLauncherCommandLine(final String currentDirectory, final String[] args) {
  17. if (ourMainRunnerClass != null) {
  18. try {
  19. Method method = ourMainRunnerClass.getMethod("processWindowsLauncherCommandLine", String.class, String[].class);
  20. return (Integer)method.invoke(null, currentDirectory, args);
  21. }
  22. catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ignored) { }
  23. }
  24. return 1;
  25. }
  26. }