From 0991ca6fd9dd9ff7c468512f835a59587a14d673 Mon Sep 17 00:00:00 2001 From: Vivian Kong Date: Tue, 19 Jan 2010 15:47:08 +0000 Subject: [PATCH] Bug 300011 - NPE in XLCompilerPropertiesPage --- .../cdt/managedbuilder/xlc/ui/messages.properties | 6 +++--- .../xlc/ui/properties/XLCompilerPropertyPage.java | 14 +++++++++----- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/messages.properties b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/messages.properties index 018e0aa5604..af1ec281d67 100644 --- a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/messages.properties +++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/messages.properties @@ -1,5 +1,5 @@ ############################################################################### -# Copyright (c) 2007, 2009 IBM Corporation and others. +# Copyright (c) 2007, 2010 IBM Corporation and others. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at @@ -9,8 +9,8 @@ # IBM Corporation - initial API and implementation ############################################################################### -XLCompiler_v8=8.0 -XLCompiler_v9=9.0 +XLCompiler_v8=v8.0 +XLCompiler_v9=v9.0 XLCompiler_v10=v10.1 XLCompilerPreferencePage_0=XL C/C++ Compiler Preferences XLCompilerPreferencePage_1=Compiler Root Path: diff --git a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/XLCompilerPropertyPage.java b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/XLCompilerPropertyPage.java index 65bdded5b2f..717af4cc2a4 100644 --- a/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/XLCompilerPropertyPage.java +++ b/xlc/org.eclipse.cdt.managedbuilder.xlc.ui/src/org/eclipse/cdt/managedbuilder/xlc/ui/properties/XLCompilerPropertyPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2009 IBM Corporation and others. + * Copyright (c) 2007, 2010 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -157,10 +157,14 @@ public class XLCompilerPropertyPage extends FieldEditorPreferencePage implements project.setPersistentProperty(new QualifiedName("", //$NON-NLS-1$ PreferenceConstants.P_XL_COMPILER_ROOT), fPathEditor .getStringValue()); - - String version = PreferenceConstants.getVersion(fVersionEditor.getSelection()); - project.setPersistentProperty(new QualifiedName("", //$NON-NLS-1$ - PreferenceConstants.P_XLC_COMPILER_VERSION), version); + + String version = null; + if (fVersionEditor.getSelection() != null) { + version = PreferenceConstants.getVersion(fVersionEditor.getSelection()); + + project.setPersistentProperty(new QualifiedName("", //$NON-NLS-1$ + PreferenceConstants.P_XLC_COMPILER_VERSION), version); + } } catch (CoreException e) { return false; }