# HG changeset patch # Parent 4f4eca9ab9455c97664278b3211ba0ac2e22c465 Bug 207434 - NPEs in RunProfile as a result of half-done refactoring in *NodeProp constructors diff --git a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/api/configurations/PackagingConfiguration.java b/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/api/configurations/PackagingConfiguration.java --- a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/api/configurations/PackagingConfiguration.java +++ b/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/api/configurations/PackagingConfiguration.java @@ -346,8 +346,8 @@ } private class PackagerIntNodeProp extends IntNodeProp { - public PackagerIntNodeProp(IntConfiguration intConfiguration, boolean canWrite, String unused, String name, String description) { - super(intConfiguration, canWrite, unused, name, description); + public PackagerIntNodeProp(IntConfiguration intConfiguration, boolean canWrite, String name, String displayName, String description) { + super(intConfiguration, canWrite, name, displayName, description); } diff --git a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/api/runprofiles/RunProfile.java b/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/api/runprofiles/RunProfile.java --- a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/api/runprofiles/RunProfile.java +++ b/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/api/runprofiles/RunProfile.java @@ -813,7 +813,7 @@ // until we have cnd.tha module if (thaSupportEnabled()) { - set.put(new IntNodeProp(getRemoveInstrumentation(), true, null, + set.put(new IntNodeProp(getRemoveInstrumentation(), true, "RemoveInstrumentation", // NOI18N getString("RemoveInstrumentation_LBL"), getString("RemoveInstrumentation_HINT"))); // NOI18N } diff --git a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/configurations/ui/BuildPlatformNodeProp.java b/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/configurations/ui/BuildPlatformNodeProp.java deleted file mode 100644 --- a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/configurations/ui/BuildPlatformNodeProp.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 2010 Oracle and/or its affiliates. All rights reserved. - * - * Oracle and Java are registered trademarks of Oracle and/or its affiliates. - * Other names may be trademarks of their respective owners. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common - * Development and Distribution License("CDDL") (collectively, the - * "License"). You may not use this file except in compliance with the - * License. You can obtain a copy of the License at - * http://www.netbeans.org/cddl-gplv2.html - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the - * specific language governing permissions and limitations under the - * License. When distributing the software, include this License Header - * Notice in each file and include the License file at - * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the - * License Header, with the fields enclosed by brackets [] replaced by - * your own identifying information: - * "Portions Copyrighted [year] [name of copyright owner]" - * - * If you wish your version of this file to be governed by only the CDDL - * or only the GPL Version 2, indicate your decision by adding - * "[Contributor] elects to include this software in this distribution - * under the [CDDL or GPL Version 2] license." If you do not indicate a - * single choice of license, a recipient has the option to distribute - * your version of this file under either the CDDL, the GPL Version 2 or - * to extend the choice of license to its licensees as provided above. - * However, if you add GPL Version 2 code and therefore, elected the GPL - * Version 2 license, then the option applies only if the new code is - * made subject to such option by the copyright holder. - * - * Contributor(s): - * - * Portions Copyrighted 2009 Sun Microsystems, Inc. - */ -package org.netbeans.modules.cnd.makeproject.configurations.ui; - -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; -import org.netbeans.modules.cnd.makeproject.api.configurations.BuildPlatformConfiguration; -import org.netbeans.modules.cnd.makeproject.api.configurations.DevelopmentHostConfiguration; -import org.netbeans.modules.cnd.makeproject.api.configurations.ui.IntNodeProp; -import org.netbeans.modules.cnd.makeproject.ui.customizer.MakeCustomizer; - -/** - * - * @author thp - */ -public class BuildPlatformNodeProp extends IntNodeProp implements PropertyChangeListener { - private BuildPlatformConfiguration intConfiguration; - private MakeCustomizer makeCustomizer = null; - - public BuildPlatformNodeProp(BuildPlatformConfiguration intConfiguration, DevelopmentHostConfiguration developmentHost, MakeCustomizer makeCustomizer, boolean canWrite, String unused, String name, String description) { - super(intConfiguration, canWrite, unused, name, description); - this.intConfiguration = intConfiguration; - this.makeCustomizer = makeCustomizer; - developmentHost.addPropertyChangeListener(this); - } - - public void propertyChange(final PropertyChangeEvent evt) { - final boolean isLocalHost = ((DevelopmentHostConfiguration) evt.getNewValue()).isLocalhost(); - intConfiguration.setDefault(intConfiguration.getValue()); - setCanWrite(isLocalHost); - makeCustomizer.validate(); - makeCustomizer.repaint(); - } -} diff --git a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/configurations/ui/ListenableIntNodeProp.java b/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/configurations/ui/ListenableIntNodeProp.java deleted file mode 100644 --- a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/configurations/ui/ListenableIntNodeProp.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 2010 Oracle and/or its affiliates. All rights reserved. - * - * Oracle and Java are registered trademarks of Oracle and/or its affiliates. - * Other names may be trademarks of their respective owners. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common - * Development and Distribution License("CDDL") (collectively, the - * "License"). You may not use this file except in compliance with the - * License. You can obtain a copy of the License at - * http://www.netbeans.org/cddl-gplv2.html - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the - * specific language governing permissions and limitations under the - * License. When distributing the software, include this License Header - * Notice in each file and include the License file at - * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the - * License Header, with the fields enclosed by brackets [] replaced by - * your own identifying information: - * "Portions Copyrighted [year] [name of copyright owner]" - * - * If you wish your version of this file to be governed by only the CDDL - * or only the GPL Version 2, indicate your decision by adding - * "[Contributor] elects to include this software in this distribution - * under the [CDDL or GPL Version 2] license." If you do not indicate a - * single choice of license, a recipient has the option to distribute - * your version of this file under either the CDDL, the GPL Version 2 or - * to extend the choice of license to its licensees as provided above. - * However, if you add GPL Version 2 code and therefore, elected the GPL - * Version 2 license, then the option applies only if the new code is - * made subject to such option by the copyright holder. - * - * Contributor(s): - * - * Portions Copyrighted 2008 Sun Microsystems, Inc. - */ -package org.netbeans.modules.cnd.makeproject.configurations.ui; - -import org.netbeans.modules.cnd.makeproject.api.configurations.ui.IntNodeProp; -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeSupport; -import org.netbeans.modules.cnd.makeproject.api.configurations.IntConfiguration; - -/** - * - * @author Sergey Grinev - */ -public class ListenableIntNodeProp extends IntNodeProp { - - private final PropertyChangeSupport pcs; - - public ListenableIntNodeProp(IntConfiguration intConfiguration, boolean canWrite, String txt1, String txt2, String txt3) { - super(intConfiguration, canWrite, txt1, txt2, txt3); - pcs = new PropertyChangeSupport(this); - } - - public void addPropertyChangeListener(PropertyChangeListener listener) { - pcs.addPropertyChangeListener(listener); - } - - public void remotePropertyChangeListener(PropertyChangeListener listener) { - pcs.removePropertyChangeListener(listener); - } - - @Override - public void setValue(Object v) { - Object oldV = getValue(); - super.setValue(v); - pcs.firePropertyChange(getName(), oldV, v); - } -}