if (sdkData == null) {
// skip since the folder isn't a proper go sdk
return;
}
GoAppEngineSdkType gaeSdkType = GoAppEngineSdkType.getInstance();
if (gaeSdkType.getSdkData() == null) {
gaeSdkType.setSdkData(sdkData);
}
Sdk existingSdk = ProjectJdkTable.getInstance().findJdk(gaeSdkType.getSdkLongName());
if (existingSdk == null) {
ProjectJdkTable jdkTable = ProjectJdkTable.getInstance();
String newSdkName = SdkConfigurationUtil.createUniqueSdkName(gaeSdkType, sdkData.SDK_HOME_PATH, Arrays.asList(jdkTable.getAllJdks()));
ProjectJdkImpl goSdk = new ProjectJdkImpl(newSdkName, gaeSdkType);
goSdk.setHomePath(goRootPath);
gaeSdkType.setupSdkPaths(goSdk);
jdkTable.addJdk(goSdk);
ProjectRootManager.getInstance(project).setProjectSdk(goSdk);
} else {
ProjectRootManager.getInstance(project).setProjectSdk(existingSdk);