use of org.intellij.lang.annotations.MagicConstant in project intellij-community by JetBrains.
the class JavaParametersUtil method getClasspathType.
@MagicConstant(valuesFromClass = JavaParameters.class)
public static int getClasspathType(final RunConfigurationModule configurationModule, final String mainClassName, final boolean classMustHaveSource) throws CantRunException {
final Module module = configurationModule.getModule();
if (module == null)
throw CantRunException.noModuleConfigured(configurationModule.getModuleName());
Boolean inProduction = isClassInProductionSources(mainClassName, module);
if (inProduction == null) {
if (!classMustHaveSource) {
return JavaParameters.JDK_AND_CLASSES_AND_TESTS;
}
throw CantRunException.classNotFound(mainClassName, module);
}
return inProduction ? JavaParameters.JDK_AND_CLASSES : JavaParameters.JDK_AND_CLASSES_AND_TESTS;
}
Aggregations