List<Sdk> sdkList = new ArrayList<Sdk>();
sdkList.addAll(GoSdkUtil.getSdkOfType(GoSdkType.getInstance(), jdkTable));
for (Sdk sdk : sdkList) {
GoSdkData sdkData = (GoSdkData) sdk.getSdkAdditionalData();
boolean needsUpgrade = sdkData == null;
try {
if (!needsUpgrade) {
sdkData.checkValid();
}
} catch (ConfigurationException ex) {
needsUpgrade = true;
}
if (!needsUpgrade)
continue;
needsUpgrade = false;
GoSdkData data = GoSdkUtil.testGoogleGoSdk(sdk.getHomePath());
if (data == null)
needsUpgrade = true;
try {
if (data != null) {
data.checkValid();
}
} catch (ConfigurationException ex) {
needsUpgrade = true;
}
if (needsUpgrade) {
Notifications.Bus.notify(
new Notification("Go SDK validator", "Corrupt Go SDK",
getContent("Go", sdk.getName()),
NotificationType.WARNING), myProject);
}
SdkModificator sdkModificator = sdk.getSdkModificator();
sdkModificator.setSdkAdditionalData(data);
sdkModificator.commitChanges();
}
sdkList.clear();
sdkList.addAll(GoSdkUtil.getSdkOfType(GoAppEngineSdkType.getInstance(), jdkTable));
for (Sdk sdk : sdkList) {
GoAppEngineSdkData sdkData = (GoAppEngineSdkData) sdk.getSdkAdditionalData();
if (sdkData == null || sdkData.TARGET_ARCH == null || sdkData.TARGET_OS == null) {
Notifications.Bus.notify(
new Notification(
"Go AppEngine SDK validator",
"Corrupt Go App Engine SDK",
getContent("Go App Engine", sdk.getName()),
NotificationType.WARNING
), myProject);
continue;
}
boolean needsUpgrade = false;
try {
sdkData.checkValid();
} catch (ConfigurationException ex) {
needsUpgrade = true;
}
if (!needsUpgrade)
continue;
needsUpgrade = false;
GoAppEngineSdkData data = GoSdkUtil.testGoAppEngineSdk(sdk.getHomePath());
if (data == null)
needsUpgrade = true;
try {
if (data != null) {
data.checkValid();
}
} catch (ConfigurationException ex) {
needsUpgrade = true;
}