}
public boolean process() {
+ if (project != null) {
+ logger.warn("Failed to set default indexer: Project is null");
+ return false;
+ }
IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
IConfiguration config = info.getDefaultConfiguration();
IManagedProject managedProject = config.getManagedProject();
}
int scope = IndexerPreferences.SCOPE_PROJECT_PRIVATE;
- if (project != null) {
- IndexerPreferences.setScope(project, scope);
- }
+ IndexerPreferences.setScope(project, scope);
boolean useActive = true;
ICProjectDescriptionManager prjDescMgr = CCorePlugin.getDefault()
.getProjectDescriptionManager();
dlg.create();
if (Window.OK == dlg.open()) {
String programPath = dlg.getProgramPath();
- String coredumpPath = dlg.getCoredumpModel().getPath();
- String originCoredumpPath = dlg.getCoredumpModel().getOriginPath();
- String coredumpLocation = dlg.getCoredumpModel().getLocation().toString();
+ String coredumpPath = "";
+ String originCoredumpPath = "";
+ String coredumpLocation = "";
+ CoredumpModel cmodel = dlg.getCoredumpModel();
+ if (cmodel != null) {
+ coredumpPath = dlg.getCoredumpModel().getPath();
+ originCoredumpPath = dlg.getCoredumpModel().getOriginPath();
+ coredumpLocation = dlg.getCoredumpModel().getLocation().toString();
+ }
rootstrap = dlg.getSelectedRootstrap();
target.setRootstrap(rootstrap);
String rootstrapName = rootstrap.getName();
}
IPkgCommander commander = target.getCommander(CmdTargetTypes.ROOTSTRAP);
ICommandStatus status = commander.copyFile(path, dstPath);
- if (!status.isOk()) {
+ if (status == null || !status.isOk()) {
logger.error(String.format("Faile to copy coredump file: %s -> %s", path, dstPath));
return null;
}
data = new ArrayList<String>();
if (selectIdx >= 0) {
List<ICheckTreeItem> children = snapshotInfos.get(selectIdx).getChildren();
- for (int idx = 0; idx < children.size(); idx++) {
- data.add(children.get(idx).getText());
+ if (children != null) {
+ for (int idx = 0; idx < children.size(); idx++) {
+ data.add(children.get(idx).getText());
+ }
}
}
}
}
public String getLogs() {
- if (rec == null) {
+ if (rec == null || rec.getLog() == null) {
return null;
}
StringBuffer sb = new StringBuffer();
ZypperTool.refreshRepoCommandXmlOut());
PackageManagerOuputReceiver hrec = getNewOuputReceiver();
ICommandStatus status = execute(command, hrec, 10000, null);
- if (!status.isOk()) {
+ if (status == null || !status.isOk()) {
printResultLog("Failed to refresh repository");
} else {
List<String> value = status.getValues();
String command = makeCommand(getProxyCommand(), getResetRpmDb(),
ZypperTool.refreshRepoCommand());
ICommandStatus status = execute(command, 10000, null);
- if (!status.isOk()) {
+ if (status == null || !status.isOk()) {
printResultLog("Failed to refresh repository");
}
-
return status;
}
ZypperTool.searchPkgCommandWithXmlOut(pkg));
PackageManagerOuputReceiver hrec = getNewOuputReceiver();
ICommandStatus status = execute(command, hrec, null);
+ PkgInstallTypes result = PkgInstallTypes.NOT_EXISTS;
if (!status.isOk()) {
printResultLog("Failed to get remote package list");
- return PkgInstallTypes.NOT_EXISTS;
+ return result;
}
- PkgInstallTypes result = null;
List<String> value = status.getValues();
if (value != null && value.size() > 0) {
String xml = makeNewlineString(value);
result = PkgInstallTypes.INSTALLED;
} else if (log.equals("not-installed")) {
result = PkgInstallTypes.NOT_INSTALLED;
- } else {
- result = PkgInstallTypes.NOT_EXISTS;
}
}
return result;
expectScript.getAbsoluteFile()), e);
cleanUpScript(expectScript.getPath());
}
+ return null;
} finally {
tryClose(bw);
}
tryClose(bw);
}
+ // execute script
return shellScript.getPath();
}