MISC: Resolved dereference null return value
authordonghyuk.yang <donghyuk.yang@samsung.com>
Sun, 30 Mar 2014 07:36:03 +0000 (16:36 +0900)
committerdonghyuk.yang <donghyuk.yang@samsung.com>
Sun, 30 Mar 2014 07:36:03 +0000 (16:36 +0900)
Change-Id: If9c05c52ae0c57ef6abb6b4ac39cc6946849ae59
Signed-off-by: donghyuk.yang <donghyuk.yang@samsung.com>
org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/LaunchCommandCancelThread.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/LaunchConfigurationProcessor.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/PlatformLaunchDelegate.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/ui/PlatformMainTab.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/wizard/pages/PlatformEFLLaunchSettingPage.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/wizard/pages/PlatformLaunchSettingPage.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/wizards/EnvironmentDialog.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/wizards/PlatformLaunchWizard.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/pkg/commander/rpm/RpmCommanderCommon.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/pkg/commander/rpm/RpmPackageLauncher.java

index b1a7fd9..385545c 100644 (file)
@@ -7,20 +7,22 @@ public class LaunchCommandCancelThread extends Thread {
     private IPkgCommander commander;
     private IProgressMonitor monitor;
     private boolean running = true;
-    
+
     public LaunchCommandCancelThread(IPkgCommander commander, IProgressMonitor monitor) {
         this.commander = commander;
         this.monitor = monitor;
     }
-    
+
     public void setTerminated() {
         running = false;
     }
-    
+
     public void run() {
-        while(running) {
+        while (running) {
             if (monitor.isCanceled()) {
-                commander.getOutputReceiver().processNewLine("Execution canceled");
+                if (commander.getOutputReceiver() != null) {
+                    commander.getOutputReceiver().processNewLine("Execution canceled");
+                }
                 commander.cancelExecution();
                 monitor.subTask("Execution cancelled");
                 running = false;
index 8abee04..993fcd9 100644 (file)
@@ -46,8 +46,7 @@ public class LaunchConfigurationProcessor implements ILaunchConfigurationProcess
     private PkgCommandTarget target;
     private String applicationId = "";
     private PackageUtil pkgUtil = new PackageUtil(PlatformProjectUtil.getPkgType());
-    private IPkgFilter pkgFilter = PkgFilterFactory.getFilter(PlatformProjectUtil
-            .getPkgType());
+    private IPkgFilter pkgFilter = PkgFilterFactory.getFilter(PlatformProjectUtil.getPkgType());
     private String rootstrapInstallLog = "";
     private String deviceInstallLog = "";
 
@@ -61,26 +60,28 @@ public class LaunchConfigurationProcessor implements ILaunchConfigurationProcess
         this.monitor = monitor;
         this.buildConfig = getBuildConfiguration();
     }
-    
+
     @Override
     public boolean process() throws CoreException {
         boolean configurationIsSet = isSetProgramPath(launchConfig);
         boolean isEflApp = PlatformProjectUtil.isEFLApplication(project);
-        
+
         if (configurationIsSet) {
             if (isEflApp) {
-                String appId = launchConfig.getAttribute(ITizenLaunchConfigurationConstants.ATTR_APPLICATION_ID, "");
+                String appId = launchConfig.getAttribute(
+                        ITizenLaunchConfigurationConstants.ATTR_APPLICATION_ID, "");
                 killIfRunningApplication(appId);
             }
-            return installPackages(configurationIsSet, monitor);                                           
-        } else {            
+            return installPackages(configurationIsSet, monitor);
+        } else {
             monitor.beginTask("", 2);
             try {
                 String descMsg = "";
                 if (!installPackages(configurationIsSet, new SubProgressMonitor(monitor, 1))) {
                     descMsg = "Installation seems to be failed. Check package installation log.";
                 }
-                if (!setLaunchConfigurationForEFL(new SubProgressMonitor(monitor, 1), descMsg, isEflApp)) {                
+                if (!setLaunchConfigurationForEFL(new SubProgressMonitor(monitor, 1), descMsg,
+                        isEflApp)) {
                     return false;
                 }
             } finally {
@@ -89,14 +90,17 @@ public class LaunchConfigurationProcessor implements ILaunchConfigurationProcess
         }
         return true;
     }
-    
-    private boolean _installPackages(List<IPackage> devicePkgs, List<IPackage> rootstrapPkgs, 
-            boolean reinstallOp, IProgressMonitor monitor) throws CoreException {       
+
+    private boolean _installPackages(List<IPackage> devicePkgs, List<IPackage> rootstrapPkgs,
+            boolean reinstallOp, IProgressMonitor monitor) throws CoreException {
         int totalWorks = 2;
         monitor.beginTask("", totalWorks);
-        
-        IPkgLauncher pkgLauncher = PkgLauncherFactory.getLauncher(project, target,
-                devicePkgs, rootstrapPkgs, reinstallOp);
+
+        IPkgLauncher pkgLauncher = PkgLauncherFactory.getLauncher(project, target, devicePkgs,
+                rootstrapPkgs, reinstallOp);
+        if (pkgLauncher == null) {
+            return false;
+        }
         try {
             if (mode.equals(ILaunchManager.DEBUG_MODE)) {
                 pkgLauncher.debugLaunchPkgs(LaunchTypes.NONE, shell, new SubProgressMonitor(
@@ -111,45 +115,51 @@ public class LaunchConfigurationProcessor implements ILaunchConfigurationProcess
             rootstrapInstallLog = pkgLauncher.getRootstrapLog();
             deviceInstallLog = pkgLauncher.getDeviceLog();
         }
-        
+
         return true;
-        
+
     }
-    
+
     @SuppressWarnings("unchecked")
-    private boolean installPackages(boolean configurationIsSet, IProgressMonitor monitor) throws CoreException {        
+    private boolean installPackages(boolean configurationIsSet, IProgressMonitor monitor)
+            throws CoreException {
         ILaunchConfigurationWorkingCopy wc = launchConfig.getWorkingCopy();
         List<IPackage> devicePackages = new ArrayList<IPackage>();
         List<IPackage> rootstrapPackages = new ArrayList<IPackage>();
         boolean reinstallOp = true;
-        
+
         if (configurationIsSet) {
             IPkgModelMaker maker = PkgModelMakerFactory.getMaker(PlatformProjectUtil.getPkgType());
-            List<String> devicePkgStr = wc.getAttribute(ITizenLaunchConfigurationConstants.ATTR_DEVICE_PACKAGE_LIST, new ArrayList<String>());
-            List<String> rootstrapPkgStr = wc.getAttribute(ITizenLaunchConfigurationConstants.ATTR_ROOTSTRAP_PACKAGE_LIST, new ArrayList<String>());                    
+            List<String> devicePkgStr = wc.getAttribute(
+                    ITizenLaunchConfigurationConstants.ATTR_DEVICE_PACKAGE_LIST,
+                    new ArrayList<String>());
+            List<String> rootstrapPkgStr = wc.getAttribute(
+                    ITizenLaunchConfigurationConstants.ATTR_ROOTSTRAP_PACKAGE_LIST,
+                    new ArrayList<String>());
             devicePackages.addAll(maker.makeModels(devicePkgStr));
             rootstrapPackages.addAll(maker.makeModels(rootstrapPkgStr));
         } else {
-            List<IPackage> packages = pkgUtil.getPackages(project, buildConfig);           
+            List<IPackage> packages = pkgUtil.getPackages(project, buildConfig);
             if (!packages.isEmpty()) {
                 devicePackages.addAll(pkgFilter.filter(CmdTargetTypes.DEVICE, packages));
                 rootstrapPackages.addAll(pkgFilter.filter(CmdTargetTypes.ROOTSTRAP, packages));
             }
             setOptionAttributes(wc, devicePackages, rootstrapPackages, reinstallOp);
-        }       
-        return _installPackages(devicePackages, rootstrapPackages, reinstallOp, monitor);        
+        }
+        return _installPackages(devicePackages, rootstrapPackages, reinstallOp, monitor);
     }
 
     private boolean setLaunchConfigurationForEFL(IProgressMonitor monitor, final String descMsg,
             final boolean isEflApp) throws CoreException {
         monitor.beginTask("", 1);
-        final ILaunchConfigurationWorkingCopy wc = launchConfig.getWorkingCopy();        
+        final ILaunchConfigurationWorkingCopy wc = launchConfig.getWorkingCopy();
         try {
             SWTUtil.syncExec(new Runnable() {
                 @Override
                 public void run() {
-                    PlatformLaunchWizard wizard = new PlatformLaunchWizard(shell, launchConfig, project, buildConfig, 
-                            target, mode, deviceInstallLog, rootstrapInstallLog, descMsg, isEflApp);
+                    PlatformLaunchWizard wizard = new PlatformLaunchWizard(shell, launchConfig,
+                            project, buildConfig, target, mode, deviceInstallLog,
+                            rootstrapInstallLog, descMsg, isEflApp);
                     PlatformLaunchWizardDialog dlg = new PlatformLaunchWizardDialog(shell, wizard);
                     dlg.create();
                     if (Window.OK == dlg.open()) {
@@ -164,24 +174,25 @@ public class LaunchConfigurationProcessor implements ILaunchConfigurationProcess
         } finally {
             monitor.done();
         }
-        
+
         if (isSetProgramPath(launchConfig)) {
             if (applicationId != null && !applicationId.isEmpty()) {
                 killIfRunningApplication(applicationId);
-            }            
+            }
             return true;
         } else {
             return false;
         }
     }
-   
+
     protected void setOptionAttributes(ILaunchConfigurationWorkingCopy wc, String programPath,
-            String arguments, String applicationId, List<IPackage> devicePackages, List<IPackage> rootstrapPackages, 
-            boolean reinstallOp, boolean selectPkgOp, Map<String, String> environments) {
+            String arguments, String applicationId, List<IPackage> devicePackages,
+            List<IPackage> rootstrapPackages, boolean reinstallOp, boolean selectPkgOp,
+            Map<String, String> environments) {
         setOptionAttributes(wc, programPath, arguments, applicationId, environments);
         setOptionAttributes(wc, devicePackages, rootstrapPackages, reinstallOp);
     }
-    
+
     protected void setOptionAttributes(ILaunchConfigurationWorkingCopy wc, String programPath,
             String arguments, String applicationId, Map<String, String> environments) {
         if (programPath != null) {
@@ -199,7 +210,7 @@ public class LaunchConfigurationProcessor implements ILaunchConfigurationProcess
             wc.setAttribute(ILaunchManager.ATTR_ENVIRONMENT_VARIABLES, environments);
         }
         wc.setAttribute(ILaunchManager.ATTR_APPEND_ENVIRONMENT_VARIABLES, false);
-        
+
         try {
             wc.doSave();
         } catch (CoreException e) {
@@ -207,9 +218,9 @@ public class LaunchConfigurationProcessor implements ILaunchConfigurationProcess
             e.printStackTrace();
         }
     }
-    
-    protected void setOptionAttributes(ILaunchConfigurationWorkingCopy wc, List<IPackage> devicePackages, List<IPackage> rootstrapPackages, 
-            boolean reinstallOp) {        
+
+    protected void setOptionAttributes(ILaunchConfigurationWorkingCopy wc,
+            List<IPackage> devicePackages, List<IPackage> rootstrapPackages, boolean reinstallOp) {
         wc.setAttribute(ITizenLaunchConfigurationConstants.ATTR_REINSTALL_OPTION, reinstallOp);
         if (devicePackages != null) {
             List<String> strs = new ArrayList<String>();
@@ -224,7 +235,7 @@ public class LaunchConfigurationProcessor implements ILaunchConfigurationProcess
                 strs.add(p.getPath());
             }
             wc.setAttribute(ITizenLaunchConfigurationConstants.ATTR_ROOTSTRAP_PACKAGE_LIST, strs);
-        }        
+        }
         try {
             wc.doSave();
         } catch (CoreException e) {
@@ -232,12 +243,12 @@ public class LaunchConfigurationProcessor implements ILaunchConfigurationProcess
             e.printStackTrace();
         }
     }
-    
+
     protected boolean isSetProgramPath(ILaunchConfiguration wc) throws CoreException {
         String path = wc.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, "");
         return !path.isEmpty();
     }
-    
+
     protected void killIfRunningApplication(String appId) throws CoreException {
         if (appId == null || appId.isEmpty()) {
             return;
@@ -248,13 +259,13 @@ public class LaunchConfigurationProcessor implements ILaunchConfigurationProcess
             commander.killApp(appId);
         }
     }
-    
-    protected void newCoreException(String message, Throwable exception) throws CoreException {    
+
+    protected void newCoreException(String message, Throwable exception) throws CoreException {
         Status status = new Status(Status.ERROR, Activator.PLUGIN_ID, message, exception);
         throw new CoreException(status);
     }
-    
+
     protected IConfiguration getBuildConfiguration() {
-        return PlatformConfigurationManager.getDefaultConfiguration(project);       
+        return PlatformConfigurationManager.getDefaultConfiguration(project);
     }
 }
index a463ecd..e1b2aeb 100644 (file)
@@ -832,8 +832,12 @@ public class PlatformLaunchDelegate extends AbstractCLaunchDelegate {
         IPath path = target.getRootstrap().getPath();
         String canonicalPath = target.getRootstrapCommander().canonicalizePath(exePath);
         String rootstrapPath = SmartBuildInterface.getInstance().getPlatformRootstrapPath(path);
-        if (!rootstrapPath.equals("")) {
-            rootstrapPath = rootstrapPath.concat(canonicalPath);
+        if (rootstrapPath != null && !rootstrapPath.isEmpty()) {
+            if (canonicalPath != null && !canonicalPath.isEmpty()) {
+                rootstrapPath = rootstrapPath.concat(canonicalPath);
+            } else {
+                rootstrapPath = rootstrapPath.concat(exePath);
+            }
         }
         return new Path(rootstrapPath);
     }
index 6fac36a..74c3ef0 100644 (file)
@@ -249,7 +249,11 @@ public class PlatformMainTab extends PlatformCommonTab {
                     index = 0;
                 }
                 appIdCombo.select(index);
-                selectedExec = executablePath[index];
+                if (executablePath != null) {
+                    selectedExec = executablePath[index];
+                } else {
+                    selectedExec = "";
+                }
                 String msg = String
                         .format("\"%s\" project is EFL application. Choose application ID to be run or debug.",
                                 proj.getName());
index ad65bde..8bcfbdc 100644 (file)
@@ -52,8 +52,8 @@ public class PlatformEFLLaunchSettingPage extends PlatformLaunchSettingPage {
 
     private String[] appId;
     private String[] executablePath;
-    private String prevAppId;
-    private String prevExec;
+    private String prevAppId = "";
+    private String prevExec = "";
     private String appIdLabelText;
 
     private Combo appIdCombo;
@@ -65,15 +65,19 @@ public class PlatformEFLLaunchSettingPage extends PlatformLaunchSettingPage {
 
         appId = PlatformLaunchUtil.getAppId(project);
         executablePath = PlatformLaunchUtil.getProgramPath(project);
-        prevAppId = appId[0];
-        prevExec = executablePath[0];
+        if (appId.length > 0) {
+            prevAppId = appId[0];
+        }
+        if (executablePath.length > 0) {
+            prevExec = executablePath[0];
+        }
 
         if (isDebug) {
-            commandInitText = executablePath[0];
+            commandInitText = prevExec;
             appIdLabelText = "Application to be debug:";
         } else {
             commandInitText = LAUNCH_APP_COMMAND;
-            argumentsInitText = appId[0];
+            argumentsInitText = prevAppId;
             appIdLabelText = "Application to be run:";
         }
     }
index 879b385..2d27dd7 100644 (file)
@@ -232,8 +232,13 @@ public class PlatformLaunchSettingPage extends PlatformLaunchCommonPage {
             pageNotCompleted("Command contains an argument.");
             return;
         }        
-        
-        if (!cmdTarget.getDeviceCommander().existsFile(command)) {
+        IPkgCommander deviceCommander = cmdTarget.getDeviceCommander();
+        if (deviceCommander == null) {
+            String msg = "Please check to connect device";
+            pageNotCompleted(msg);
+            return;
+        }
+        if (!deviceCommander.existsFile(command)) {
             String msg = String.format("\"%s\" does not exist on the device.", command);
             pageNotCompleted(msg);
             return;
index 96526b7..634336c 100644 (file)
@@ -34,15 +34,10 @@ import java.util.Iterator;
 import java.util.Map;
 import java.util.TreeMap;
 
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
 import org.eclipse.debug.core.DebugPlugin;
 import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchManager;
 import org.eclipse.debug.internal.ui.AbstractDebugCheckboxSelectionDialog;
 import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
 import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
 import org.eclipse.debug.internal.ui.MultipleInputDialog;
 import org.eclipse.debug.internal.ui.launchConfigurations.EnvironmentVariable;
@@ -106,12 +101,11 @@ public class EnvironmentDialog extends Dialog {
     protected Button envSelectButton;
     protected TableViewer environmentTable;
     protected String[] envTableColumnHeaders = {
-            LaunchConfigurationsMessages.EnvironmentTab_Variable_1, 
-            LaunchConfigurationsMessages.EnvironmentTab_Value_2, 
-        };
-    protected static final String NAME_LABEL= LaunchConfigurationsMessages.EnvironmentTab_8; 
-    protected static final String VALUE_LABEL= LaunchConfigurationsMessages.EnvironmentTab_9;        
-       
+            LaunchConfigurationsMessages.EnvironmentTab_Variable_1,
+            LaunchConfigurationsMessages.EnvironmentTab_Value_2, };
+    protected static final String NAME_LABEL = LaunchConfigurationsMessages.EnvironmentTab_8;
+    protected static final String VALUE_LABEL = LaunchConfigurationsMessages.EnvironmentTab_9;
+
     protected static final String TITLE = "Environment variable Configuration";
     protected static final String P_VARIABLE = "variable"; //$NON-NLS-1$
     protected static final String P_VALUE = "value"; //$NON-NLS-1$
@@ -141,24 +135,25 @@ public class EnvironmentDialog extends Dialog {
         composite.setLayout(new GridLayout(2, false));
 
         createDescComposite(composite);
-        //createTextAreaComposite(composite);
+        // createTextAreaComposite(composite);
         createEnvironmentTable(composite);
         createTableButtons(composite);
-        
+
         updateEnvironment();
         return composite;
     }
-    
+
     /**
      * Updates the environment table for the given launch configuration
+     * 
      * @param configuration
      */
     protected void updateEnvironment() {
         environmentTable.setInput(defaultEnvMap);
     }
-    
-    protected void createEnvironmentTable(Composite parent) {        
-        // Create table composite        
+
+    protected void createEnvironmentTable(Composite parent) {
+        // Create table composite
         Composite composite = new Composite(parent, SWT.NONE);
         GridLayout layout = new GridLayout(1, false);
         layout.marginWidth = 0;
@@ -167,7 +162,8 @@ public class EnvironmentDialog extends Dialog {
         GridData gd = new GridData(GridData.FILL_BOTH);
         composite.setLayoutData(gd);
         // Create table
-        environmentTable = new TableViewer(composite, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION);
+        environmentTable = new TableViewer(composite, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL
+                | SWT.MULTI | SWT.FULL_SELECTION);
         Table table = environmentTable.getTable();
         table.setLayout(new GridLayout());
         table.setLayoutData(new GridData(GridData.FILL_BOTH));
@@ -175,7 +171,7 @@ public class EnvironmentDialog extends Dialog {
         table.setLinesVisible(true);
         environmentTable.setContentProvider(new EnvironmentVariableContentProvider());
         environmentTable.setLabelProvider(new EnvironmentVariableLabelProvider());
-        environmentTable.setColumnProperties(new String[] {P_VARIABLE, P_VALUE});
+        environmentTable.setColumnProperties(new String[] { P_VARIABLE, P_VALUE });
         environmentTable.addSelectionChangedListener(new ISelectionChangedListener() {
             public void selectionChanged(SelectionChangedEvent event) {
                 handleTableSelectionChanged(event);
@@ -200,28 +196,30 @@ public class EnvironmentDialog extends Dialog {
                 Rectangle area = comp.getClientArea();
                 Point size = tref.computeSize(SWT.DEFAULT, SWT.DEFAULT);
                 ScrollBar vBar = tref.getVerticalBar();
-                int width = area.width - tref.computeTrim(0,0,0,0).width - 2;
+                int width = area.width - tref.computeTrim(0, 0, 0, 0).width - 2;
                 if (size.y > area.height + tref.getHeaderHeight()) {
                     Point vBarSize = vBar.getSize();
                     width -= vBarSize.x;
                 }
                 Point oldSize = tref.getSize();
                 if (oldSize.x > area.width) {
-                    tc1.setWidth(width/2-1);
+                    tc1.setWidth(width / 2 - 1);
                     tc2.setWidth(width - tc1.getWidth());
                     tref.setSize(area.width, area.height);
                 } else {
                     tref.setSize(area.width, area.height);
-                    tc1.setWidth(width/2-1);
+                    tc1.setWidth(width / 2 - 1);
                     tc2.setWidth(width - tc1.getWidth());
                 }
             }
         });
     }
-    
+
     /**
      * Creates the add/edit/remove buttons for the environment table
-     * @param parent the composite in which the buttons should be created
+     * 
+     * @param parent
+     *            the composite in which the buttons should be created
      */
     protected void createTableButtons(Composite parent) {
         // Create button composite
@@ -232,13 +230,13 @@ public class EnvironmentDialog extends Dialog {
         composite.setLayout(layout);
         GridData gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
         composite.setLayoutData(gd);
-        
+
         GridData btgd = new GridData(GridData.FILL_HORIZONTAL);
 
         // Create buttons
         envAddButton = new Button(composite, SWT.PUSH);
         envAddButton.setLayoutData(btgd);
-        envAddButton.setText(LaunchConfigurationsMessages.EnvironmentTab_New_4); 
+        envAddButton.setText(LaunchConfigurationsMessages.EnvironmentTab_New_4);
         envAddButton.addSelectionListener(new SelectionAdapter() {
             public void widgetSelected(SelectionEvent event) {
                 handleEnvAddButtonSelected();
@@ -246,7 +244,7 @@ public class EnvironmentDialog extends Dialog {
         });
         envSelectButton = new Button(composite, SWT.PUSH);
         envSelectButton.setLayoutData(btgd);
-        envSelectButton.setText(LaunchConfigurationsMessages.EnvironmentTab_18); 
+        envSelectButton.setText(LaunchConfigurationsMessages.EnvironmentTab_18);
         envSelectButton.addSelectionListener(new SelectionAdapter() {
             public void widgetSelected(SelectionEvent event) {
                 handleEnvSelectButtonSelected();
@@ -254,16 +252,16 @@ public class EnvironmentDialog extends Dialog {
         });
         envEditButton = new Button(composite, SWT.PUSH);
         envEditButton.setLayoutData(btgd);
-        envEditButton.setText(LaunchConfigurationsMessages.EnvironmentTab_Edit_5); 
+        envEditButton.setText(LaunchConfigurationsMessages.EnvironmentTab_Edit_5);
         envEditButton.addSelectionListener(new SelectionAdapter() {
             public void widgetSelected(SelectionEvent event) {
                 handleEnvEditButtonSelected();
             }
         });
-        envEditButton.setEnabled(false);        
+        envEditButton.setEnabled(false);
         envRemoveButton = new Button(composite, SWT.PUSH);
         envRemoveButton.setLayoutData(btgd);
-        envRemoveButton.setText(LaunchConfigurationsMessages.EnvironmentTab_Remove_6); 
+        envRemoveButton.setText(LaunchConfigurationsMessages.EnvironmentTab_Remove_6);
         envRemoveButton.addSelectionListener(new SelectionAdapter() {
             public void widgetSelected(SelectionEvent event) {
                 handleEnvRemoveButtonSelected();
@@ -271,111 +269,116 @@ public class EnvironmentDialog extends Dialog {
         });
         envRemoveButton.setEnabled(false);
     }
-    
+
     /**
      * Responds to a selection changed event in the environment table
-     * @param event the selection change event
+     * 
+     * @param event
+     *            the selection change event
      */
     protected void handleTableSelectionChanged(SelectionChangedEvent event) {
-        int size = ((IStructuredSelection)event.getSelection()).size();
+        int size = ((IStructuredSelection) event.getSelection()).size();
         envEditButton.setEnabled(size == 1);
         envRemoveButton.setEnabled(size > 0);
     }
-    
+
     /**
      * Adds a new environment variable to the table.
-     */    
+     */
     protected void handleEnvAddButtonSelected() {
-        MultipleInputDialog dialog = new MultipleInputDialog(getShell(), LaunchConfigurationsMessages.EnvironmentTab_22); 
+        MultipleInputDialog dialog = new MultipleInputDialog(getShell(),
+                LaunchConfigurationsMessages.EnvironmentTab_22);
         dialog.addTextField(NAME_LABEL, null, false);
         dialog.addVariablesField(VALUE_LABEL, null, true);
-        
+
         if (dialog.open() != Window.OK) {
             return;
         }
-        
+
         String name = dialog.getStringValue(NAME_LABEL);
         String value = dialog.getStringValue(VALUE_LABEL);
-        
-        if (name != null && value != null && name.length() > 0 && value.length() >0) {
+
+        if (name != null && value != null && name.length() > 0 && value.length() > 0) {
             addVariable(new EnvironmentVariable(name.trim(), value.trim()));
             updateAppendReplace();
         }
     }
-    
+
     /**
-     * Displays a dialog that allows user to select native environment variables 
+     * Displays a dialog that allows user to select native environment variables
      * to add to the table.
      */
     private void handleEnvSelectButtonSelected() {
-        //get Environment Variables from the OS
+        // get Environment Variables from the OS
         Map envVariables = getNativeEnvironment();
-        
-        //get Environment Variables from the table
+
+        // get Environment Variables from the table
         TableItem[] items = environmentTable.getTable().getItems();
         for (int i = 0; i < items.length; i++) {
             EnvironmentVariable var = (EnvironmentVariable) items[i].getData();
             envVariables.remove(var.getName());
         }
-        
-        NativeEnvironmentSelectionDialog dialog = new NativeEnvironmentSelectionDialog(getShell(), envVariables); 
-        dialog.setTitle(LaunchConfigurationsMessages.EnvironmentTab_20); 
-        
+
+        NativeEnvironmentSelectionDialog dialog = new NativeEnvironmentSelectionDialog(getShell(),
+                envVariables);
+        dialog.setTitle(LaunchConfigurationsMessages.EnvironmentTab_20);
+
         int button = dialog.open();
         if (button == Window.OK) {
-            Object[] selected = dialog.getResult();     
+            Object[] selected = dialog.getResult();
             for (int i = 0; i < selected.length; i++) {
-                environmentTable.add(selected[i]);              
+                environmentTable.add(selected[i]);
             }
         }
-        
-        updateAppendReplace();     
+
+        updateAppendReplace();
     }
-    
+
     /**
      * Removes the selected environment variable from the table.
-     */    
+     */
     private void handleEnvRemoveButtonSelected() {
         IStructuredSelection sel = (IStructuredSelection) environmentTable.getSelection();
         environmentTable.getControl().setRedraw(false);
-        for (Iterator i = sel.iterator(); i.hasNext(); ) {
-            EnvironmentVariable var = (EnvironmentVariable) i.next();   
-        environmentTable.remove(var);
+        for (Iterator i = sel.iterator(); i.hasNext();) {
+            EnvironmentVariable var = (EnvironmentVariable) i.next();
+            environmentTable.remove(var);
         }
         environmentTable.getControl().setRedraw(true);
         updateAppendReplace();
     }
-    
+
     /**
-     * Updates the enablement of the append/replace widgets. The
-     * widgets should disable when there are no environment variables specified.
+     * Updates the enablement of the append/replace widgets. The widgets should
+     * disable when there are no environment variables specified.
      */
     protected void updateAppendReplace() {
-        //boolean enable= environmentTable.getTable().getItemCount() > 0;
-        //appendEnvironment.setEnabled(enable);
-        //replaceEnvironment.setEnabled(enable);
-    }    
-    
+        // boolean enable= environmentTable.getTable().getItemCount() > 0;
+        // appendEnvironment.setEnabled(enable);
+        // replaceEnvironment.setEnabled(enable);
+    }
+
     /**
      * Creates an editor for the value of the selected environment variable.
      */
     private void handleEnvEditButtonSelected() {
-        IStructuredSelection sel= (IStructuredSelection) environmentTable.getSelection();
-        EnvironmentVariable var= (EnvironmentVariable) sel.getFirstElement();
+        IStructuredSelection sel = (IStructuredSelection) environmentTable.getSelection();
+        EnvironmentVariable var = (EnvironmentVariable) sel.getFirstElement();
         if (var == null) {
             return;
         }
-        String originalName= var.getName();
-        String value= var.getValue();
-        MultipleInputDialog dialog= new MultipleInputDialog(getShell(), LaunchConfigurationsMessages.EnvironmentTab_11); 
+        String originalName = var.getName();
+        String value = var.getValue();
+        MultipleInputDialog dialog = new MultipleInputDialog(getShell(),
+                LaunchConfigurationsMessages.EnvironmentTab_11);
         dialog.addTextField(NAME_LABEL, originalName, false);
         dialog.addVariablesField(VALUE_LABEL, value, true);
-        
+
         if (dialog.open() != Window.OK) {
             return;
         }
-        String name= dialog.getStringValue(NAME_LABEL);
-        value= dialog.getStringValue(VALUE_LABEL);
+        String name = dialog.getStringValue(NAME_LABEL);
+        value = dialog.getStringValue(VALUE_LABEL);
         if (!originalName.equals(name)) {
             if (addVariable(new EnvironmentVariable(name, value))) {
                 environmentTable.remove(var);
@@ -385,21 +388,26 @@ public class EnvironmentDialog extends Dialog {
             environmentTable.update(var, null);
         }
     }
-    
+
     /**
-     * Attempts to add the given variable. Returns whether the variable
-     * was added or not (as when the user answers not to overwrite an
-     * existing variable).
-     * @param variable the variable to add
+     * Attempts to add the given variable. Returns whether the variable was
+     * added or not (as when the user answers not to overwrite an existing
+     * variable).
+     * 
+     * @param variable
+     *            the variable to add
      * @return whether the variable was added
      */
     protected boolean addVariable(EnvironmentVariable variable) {
-        String name= variable.getName();
+        String name = variable.getName();
         TableItem[] items = environmentTable.getTable().getItems();
         for (int i = 0; i < items.length; i++) {
             EnvironmentVariable existingVariable = (EnvironmentVariable) items[i].getData();
             if (existingVariable.getName().equals(name)) {
-                boolean overWrite= MessageDialog.openQuestion(getShell(), LaunchConfigurationsMessages.EnvironmentTab_12, MessageFormat.format(LaunchConfigurationsMessages.EnvironmentTab_13, new String[] {name})); // 
+                boolean overWrite = MessageDialog.openQuestion(getShell(),
+                        LaunchConfigurationsMessages.EnvironmentTab_12, MessageFormat.format(
+                                LaunchConfigurationsMessages.EnvironmentTab_13,
+                                new String[] { name })); //
                 if (!overWrite) {
                     return false;
                 }
@@ -427,38 +435,28 @@ public class EnvironmentDialog extends Dialog {
 
     @Override
     protected void okPressed() {
-     // Convert the table's items into a Map so that this can be saved in the
+        // Convert the table's items into a Map so that this can be saved in the
         // configuration's attributes.
         TableItem[] items = environmentTable.getTable().getItems();
         envMap = new HashMap(items.length);
-        for (int i = 0; i < items.length; i++)
-        {
+        for (int i = 0; i < items.length; i++) {
             EnvironmentVariable var = (EnvironmentVariable) items[i].getData();
             envMap.put(var.getName(), var.getValue());
         }
         super.okPressed();
     }
-    
+
     public Map getEnvs() {
         return envMap;
     }
-    
+
     /**
      * Content provider for the environment table
      */
     protected class EnvironmentVariableContentProvider implements IStructuredContentProvider {
         public Object[] getElements(Object inputElement) {
             EnvironmentVariable[] elements = new EnvironmentVariable[0];
-            //ILaunchConfiguration config = (ILaunchConfiguration) inputElement;
-            Map m = (Map)inputElement;
-            /*
-            try {
-                m = config.getAttribute(ILaunchManager.ATTR_ENVIRONMENT_VARIABLES, (Map) null);
-            } catch (CoreException e) {
-                DebugUIPlugin.log(new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), IStatus.ERROR, "Error reading configuration", e)); //$NON-NLS-1$
-                return elements;
-            }
-            */
+            Map m = (Map) inputElement;
             if (m != null && !m.isEmpty()) {
                 elements = new EnvironmentVariable[m.size()];
                 String[] varNames = new String[m.size()];
@@ -469,14 +467,16 @@ public class EnvironmentDialog extends Dialog {
             }
             return elements;
         }
+
         public void dispose() {
         }
+
         public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-            if (newInput == null){
+            if (newInput == null) {
                 return;
             }
-            if (viewer instanceof TableViewer){
-                TableViewer tableViewer= (TableViewer) viewer;
+            if (viewer instanceof TableViewer) {
+                TableViewer tableViewer = (TableViewer) viewer;
                 if (tableViewer.getTable().isDisposed()) {
                     return;
                 }
@@ -487,33 +487,36 @@ public class EnvironmentDialog extends Dialog {
                         } else if (e2 == null) {
                             return 1;
                         } else {
-                            return ((EnvironmentVariable)e1).getName().compareToIgnoreCase(((EnvironmentVariable)e2).getName());
+                            return ((EnvironmentVariable) e1).getName().compareToIgnoreCase(
+                                    ((EnvironmentVariable) e2).getName());
                         }
                     }
                 });
             }
         }
     }
-    
+
     /**
      * Label provider for the environment table
      */
-    public class EnvironmentVariableLabelProvider extends LabelProvider implements ITableLabelProvider {
-        public String getColumnText(Object element, int columnIndex)    {
+    public class EnvironmentVariableLabelProvider extends LabelProvider implements
+            ITableLabelProvider {
+        public String getColumnText(Object element, int columnIndex) {
             String result = null;
             if (element != null) {
                 EnvironmentVariable var = (EnvironmentVariable) element;
                 switch (columnIndex) {
-                    case 0: // variable
-                        result = var.getName();
-                        break;
-                    case 1: // value
-                        result = var.getValue();
-                        break;
+                case 0: // variable
+                    result = var.getName();
+                    break;
+                case 1: // value
+                    result = var.getValue();
+                    break;
                 }
             }
             return result;
         }
+
         public Image getColumnImage(Object element, int columnIndex) {
             if (columnIndex == 0) {
                 return DebugPluginImages.getImage(IDebugUIConstants.IMG_OBJS_ENV_VAR);
@@ -523,88 +526,118 @@ public class EnvironmentDialog extends Dialog {
     }
 
     /**
-     * Gets native environment variable from the LaunchManager. Creates EnvironmentVariable objects.
-     * @return Map of name - EnvironmentVariable pairs based on native environment.
+     * Gets native environment variable from the LaunchManager. Creates
+     * EnvironmentVariable objects.
+     * 
+     * @return Map of name - EnvironmentVariable pairs based on native
+     *         environment.
      */
     private Map getNativeEnvironment() {
-        Map stringVars = DebugPlugin.getDefault().getLaunchManager().getNativeEnvironmentCasePreserved();
+        Map stringVars = DebugPlugin.getDefault().getLaunchManager()
+                .getNativeEnvironmentCasePreserved();
         HashMap vars = new HashMap();
-        for (Iterator i = stringVars.keySet().iterator(); i.hasNext(); ) {
+        for (Iterator i = stringVars.keySet().iterator(); i.hasNext();) {
             String key = (String) i.next();
             String value = (String) stringVars.get(key);
             vars.put(key, new EnvironmentVariable(key, value));
         }
         return vars;
     }
-    
+
     /**
-     * This dialog allows users to select one or more known native environment variables from a list.
+     * This dialog allows users to select one or more known native environment
+     * variables from a list.
      */
-    private class NativeEnvironmentSelectionDialog extends AbstractDebugCheckboxSelectionDialog {
-        
+    private static class NativeEnvironmentSelectionDialog extends
+            AbstractDebugCheckboxSelectionDialog {
+
         private Object fInput;
-        
+
         public NativeEnvironmentSelectionDialog(Shell parentShell, Object input) {
             super(parentShell);
             fInput = input;
             setShellStyle(getShellStyle() | SWT.RESIZE);
             setShowSelectAllButtons(true);
         }
-        
-        /* (non-Javadoc)
-         * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getDialogSettingsId()
+
+        /*
+         * (non-Javadoc)
+         * 
+         * @see org.eclipse.debug.internal.ui.launchConfigurations.
+         * AbstractDebugSelectionDialog#getDialogSettingsId()
          */
         protected String getDialogSettingsId() {
             return IDebugUIConstants.PLUGIN_ID + ".ENVIRONMENT_TAB.NATIVE_ENVIROMENT_DIALOG"; //$NON-NLS-1$
         }
 
-        /* (non-Javadoc)
-         * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getHelpContextId()
+        /*
+         * (non-Javadoc)
+         * 
+         * @see org.eclipse.debug.internal.ui.launchConfigurations.
+         * AbstractDebugSelectionDialog#getHelpContextId()
          */
         protected String getHelpContextId() {
             return IDebugHelpContextIds.SELECT_NATIVE_ENVIRONMENT_DIALOG;
         }
 
-        /* (non-Javadoc)
-         * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerInput()
+        /*
+         * (non-Javadoc)
+         * 
+         * @see org.eclipse.debug.internal.ui.launchConfigurations.
+         * AbstractDebugSelectionDialog#getViewerInput()
          */
         protected Object getViewerInput() {
             return fInput;
         }
 
-        /* (non-Javadoc)
-         * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerLabel()
+        /*
+         * (non-Javadoc)
+         * 
+         * @see org.eclipse.debug.internal.ui.launchConfigurations.
+         * AbstractDebugSelectionDialog#getViewerLabel()
          */
         protected String getViewerLabel() {
             return LaunchConfigurationsMessages.EnvironmentTab_19;
         }
-        
-        /* (non-Javadoc)
-         * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getLabelProvider()
+
+        /*
+         * (non-Javadoc)
+         * 
+         * @see org.eclipse.debug.internal.ui.launchConfigurations.
+         * AbstractDebugSelectionDialog#getLabelProvider()
          */
         protected IBaseLabelProvider getLabelProvider() {
             return new ILabelProvider() {
                 public Image getImage(Object element) {
                     return DebugPluginImages.getImage(IDebugUIConstants.IMG_OBJS_ENVIRONMENT);
                 }
+
                 public String getText(Object element) {
                     EnvironmentVariable var = (EnvironmentVariable) element;
-                    return MessageFormat.format(LaunchConfigurationsMessages.EnvironmentTab_7, new String[] {var.getName(), var.getValue()}); 
+                    return MessageFormat.format(LaunchConfigurationsMessages.EnvironmentTab_7,
+                            new String[] { var.getName(), var.getValue() });
                 }
+
                 public void addListener(ILabelProviderListener listener) {
                 }
+
                 public void dispose() {
                 }
+
                 public boolean isLabelProperty(Object element, String property) {
                     return false;
                 }
+
                 public void removeListener(ILabelProviderListener listener) {
-                }               
+                }
             };
         }
-        
-        /* (non-Javadoc)
-         * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getContentProvider()
+
+        /*
+         * (non-Javadoc)
+         * 
+         * @see org.eclipse.debug.internal.ui.launchConfigurations.
+         * AbstractDebugSelectionDialog#getContentProvider()
          */
         protected IContentProvider getContentProvider() {
             return new IStructuredContentProvider() {
@@ -613,13 +646,13 @@ public class EnvironmentDialog extends Dialog {
                     if (inputElement instanceof HashMap) {
                         Comparator comparator = new Comparator() {
                             public int compare(Object o1, Object o2) {
-                                String s1 = (String)o1;
-                                String s2 = (String)o2;
+                                String s1 = (String) o1;
+                                String s2 = (String) o2;
                                 return s1.compareTo(s2);
                             }
                         };
                         TreeMap envVars = new TreeMap(comparator);
-                        envVars.putAll((Map)inputElement);
+                        envVars.putAll((Map) inputElement);
                         elements = new EnvironmentVariable[envVars.size()];
                         int index = 0;
                         for (Iterator iterator = envVars.keySet().iterator(); iterator.hasNext(); index++) {
@@ -629,8 +662,10 @@ public class EnvironmentDialog extends Dialog {
                     }
                     return elements;
                 }
-                public void dispose() { 
+
+                public void dispose() {
                 }
+
                 public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
                 }
             };
index 3a0537e..656e3b2 100644 (file)
@@ -40,10 +40,8 @@ import org.tizen.nativeplatform.pkg.commander.PkgCommandTarget;
 
 public class PlatformLaunchWizard extends PlatformCommonLaunchWizard {
 
-    protected String deviceLog = "";
-    protected String rootstrapLog = "";
-    protected String descMsg = "";
-    protected boolean isEFL;
+    private String descMsg = "";
+    private boolean isEFL;
 
     private static final String SETTING_BIN_PAGE = "setting_bin";
 
@@ -51,12 +49,11 @@ public class PlatformLaunchWizard extends PlatformCommonLaunchWizard {
         super();
     }
 
-    public PlatformLaunchWizard(Shell shell, ILaunchConfiguration launchConfig,
-            IProject project, IConfiguration config,
-            PkgCommandTarget target, String mode, String deviceLog, String rootstrapLog,
-            String descMsg, boolean isEFL) {
+    public PlatformLaunchWizard(Shell shell, ILaunchConfiguration launchConfig, IProject project,
+            IConfiguration config, PkgCommandTarget target, String mode, String deviceLog,
+            String rootstrapLog, String descMsg, boolean isEFL) {
         super(shell, launchConfig, project, config, target, mode);
-        this.deviceLog = deviceLog;     
+        this.deviceLog = deviceLog;
         this.rootstrapLog = rootstrapLog;
         this.descMsg = descMsg;
         this.isEFL = isEFL;
@@ -64,20 +61,16 @@ public class PlatformLaunchWizard extends PlatformCommonLaunchWizard {
 
     @Override
     public boolean performFinish() {
+        PlatformLaunchSettingPage binPage = null;
         if (isEFL) {
-            PlatformEFLLaunchSettingPage binPage = (PlatformEFLLaunchSettingPage) getPage(SETTING_BIN_PAGE);
-            if (binPage != null) {
-                programPath = binPage.getBinaryPath();
-                arguments = binPage.getArguments();
-                selectedApp = binPage.getSelectedApp();
-            }
+            binPage = (PlatformEFLLaunchSettingPage) getPage(SETTING_BIN_PAGE);
         } else {
-            PlatformLaunchSettingPage binPage = (PlatformLaunchSettingPage) getPage(SETTING_BIN_PAGE);
-            if (binPage != null) {
-                programPath = binPage.getBinaryPath();
-                arguments = binPage.getArguments();
-                selectedApp = binPage.getSelectedApp();
-            }
+            binPage = (PlatformLaunchSettingPage) getPage(SETTING_BIN_PAGE);
+        }
+        if (binPage != null) {
+            programPath = binPage.getBinaryPath();
+            arguments = binPage.getArguments();
+            selectedApp = binPage.getSelectedApp();
         }
         return true;
     }
index 4e7ddd0..76b5d52 100644 (file)
@@ -141,7 +141,7 @@ public abstract class RpmCommanderCommon implements IPkgCommander {
 
     public String getLogs() {
         if (rec == null || rec.getLog() == null) {
-            return null;
+            return "";
         }
         StringBuffer sb = new StringBuffer();
         for (String log : rec.getLog()) {
@@ -387,7 +387,7 @@ public abstract class RpmCommanderCommon implements IPkgCommander {
                         RpmTool.installCommand(value.toArray(new String[0])));
                 status = execute(command, 50000, monitor);
             } else if (type == TOOL.ZYPPER) {
-                String command = makeCommand(getResetRpmDb(),
+                String command = makeCommand(getProxyCommand(), getResetRpmDb(),
                         ZypperTool.installLocalCommand(value.toArray(new String[0])));
                 status = execute(command, 50000, monitor);
             } else if (type == TOOL.PKGCMD) {
@@ -937,7 +937,7 @@ public abstract class RpmCommanderCommon implements IPkgCommander {
         String command = String.format(CMD_FILE_FILE, file);
         PackageManagerOutputReceiver hrec = getNewOuputReceiver();
         ICommandStatus status = execute(command, hrec, null, false);
-        if (!status.isOk()) {
+        if (status == null || !status.isOk()) {
             return ret;
         }
         List<String> value = status.getValues();
@@ -961,7 +961,7 @@ public abstract class RpmCommanderCommon implements IPkgCommander {
         String command = String.format(CMD_READLINK, path);
         PackageManagerOutputReceiver hrec = getNewOuputReceiver();
         ICommandStatus status = execute(command, hrec, null, false);
-        if (!status.isOk()) {
+        if (status == null || !status.isOk()) {
             return null;
         }
         List<String> value = status.getValues();
@@ -991,8 +991,10 @@ public abstract class RpmCommanderCommon implements IPkgCommander {
                 ZypperTool.whatProvideCommandXmlOut(capability));
         PackageManagerOutputReceiver hrec = getNewOuputReceiver();
         ICommandStatus status = execute(command, hrec, 10000, null);
-
         Map<String, PkgStatus> result = null;
+        if (status == null || !status.isOk()) {
+            return result;
+        }
         List<String> value = status.getValues();
         if (value != null && value.size() > 0) {
             String xml = makeNewlineString(value);
@@ -1012,10 +1014,11 @@ public abstract class RpmCommanderCommon implements IPkgCommander {
     
     private Map<String, PkgStatus> getWhatProvidesWithRpm(String capability) {
         String command = makeCommand(RpmTool.whatProvideCommand(capability));
-        PackageManagerOutputReceiver hrec = getNewOuputReceiver();
-        ICommandStatus status  = execute(command, null, true);
-        
+        ICommandStatus status  = execute(command, null, true);        
         Map<String, PkgStatus> result = new HashMap<String, PkgStatus>();
+        if (status == null || !status.isOk()) {
+            return result;
+        }
         List<String> values = status.getValues();
         String pkgName = "";
         String pkgVersion = "";
@@ -1051,7 +1054,6 @@ public abstract class RpmCommanderCommon implements IPkgCommander {
     
     @Override
     public Map<String, PkgStatus> getWhatProvides(String capability, TOOL type) {
-        ICommandStatus status;
         if (type == TOOL.ZYPPER) {
             return getWhatProvidesWithZypper(capability);
         } else if (type == TOOL.RPM) {
index e391703..4ac2241 100644 (file)
@@ -200,11 +200,11 @@ public class RpmPackageLauncher implements IPkgLauncher {
     }
 
     private List<PkgStatus> filterAndUpdatePkgs(CmdTargetTypes cmdTarget) {
-        List<PkgStatus> pkgStatus = null;
+        List<PkgStatus> pkgStatus = new ArrayList<PkgStatus>();
         if (cmdTarget.equals(CmdTargetTypes.DEVICE)) {
-            pkgStatus = pkgUpdater.updateStatus(cmdTarget, devicePackages);
+            pkgStatus.addAll(pkgUpdater.updateStatus(cmdTarget, devicePackages));
         } else if (cmdTarget.equals(CmdTargetTypes.ROOTSTRAP)) {
-            pkgStatus = pkgUpdater.updateStatus(cmdTarget, rootstrapPackages);
+            pkgStatus.addAll(pkgUpdater.updateStatus(cmdTarget, rootstrapPackages));
         }
         applyReinstallOp(pkgStatus, reinstallOp);
         return pkgStatus;