Author: rmeggins
Update of /cvs/dirsec/directoryconsole/src/com/netscape/admin/dirserv/panel
In directory
cvs1.fedora.phx.redhat.com:/tmp/cvs-serv18920/directoryconsole/src/com/netscape/admin/dirserv/panel
Modified Files:
BlankPanel.java DSTabbedPanel.java PluginPanel.java
Log Message:
Resolves: bug 487831
Bug Description: Tabbed Panel display throws NullPointerException
Reviewed by: nkinder (Thanks!)
Fix Description: A couple of panels were defining an isValid method to use for clean/dirty
validation. However, the Component class which these panels inherit from also defines the
isValid method for a different purpose. Our code must not use the isValid method, so I
renamed those methods to something more meaningful in their context. I also found another
problem with a null pointer access in some schema code.
Platforms tested: RHEL5 - with Sun JRE 1.6 and OpenJDK 1.6
Flag Day: no
Doc impact: no
Index: BlankPanel.java
===================================================================
RCS file:
/cvs/dirsec/directoryconsole/src/com/netscape/admin/dirserv/panel/BlankPanel.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- BlankPanel.java 2 Dec 2008 15:27:37 -0000 1.3
+++ BlankPanel.java 2 Mar 2009 16:28:34 -0000 1.4
@@ -611,7 +611,7 @@
*
* @return true if valid
*/
- public boolean isValid() {
+ public boolean panelIsValid() {
return _validFlag;
}
Index: DSTabbedPanel.java
===================================================================
RCS file:
/cvs/dirsec/directoryconsole/src/com/netscape/admin/dirserv/panel/DSTabbedPanel.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- DSTabbedPanel.java 18 Jul 2005 00:55:56 -0000 1.1.1.1
+++ DSTabbedPanel.java 2 Mar 2009 16:28:34 -0000 1.2
@@ -245,7 +245,7 @@
/* need to check that there is panels with */
/* invalid data */
- if (isModified() && isValid ())
+ if (isModified() && tabbedPanelsAreValid ())
setValidFlag ();
}
@@ -301,11 +301,14 @@
* @return true if they are
*/
- public boolean isValid (){
+ public boolean tabbedPanelsAreValid (){
+ if (_tabbedPane == null) {
+ return true; // valid if not initialized
+ }
int nTabs = _tabbedPane.getTabCount();
for (int ii = 0; ii < nTabs; ++ii) {
BlankPanel p = (BlankPanel)_tabbedPane.getComponentAt(ii);
- if (!p.isValid()) {
+ if (!p.panelIsValid()) {
return false;
}
}
@@ -336,7 +339,7 @@
}
}
- protected JTabbedPane _tabbedPane;
+ protected JTabbedPane _tabbedPane = null;
private static final String _tabImageName = "tab-gif";
private static RemoteImage _markImage = null;
}
Index: PluginPanel.java
===================================================================
RCS file:
/cvs/dirsec/directoryconsole/src/com/netscape/admin/dirserv/panel/PluginPanel.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- PluginPanel.java 16 Oct 2007 15:43:48 -0000 1.3
+++ PluginPanel.java 2 Mar 2009 16:28:34 -0000 1.4
@@ -439,7 +439,7 @@
private void validateButtons() {
if (isModified()){
setDirtyFlag();
- if (isValid())
+ if (panelIsValid())
setValidFlag();
else
clearValidFlag();
@@ -1117,7 +1117,7 @@
return false;
}
- public boolean isValid() {
+ public boolean panelIsValid() {
for( int i = 0; i < EDITABLE_ATTRNAMES.length; i++ ) {
if
(((DSEntryTextStrict)_dsEntryFields.get(EDITABLE_ATTRNAMES[i])).validate()==DSEntryTextStrict.ERROR_EMPTY_FIELD)
return false;
Show replies by date