Author: nkinder
Update of /cvs/dirsec/console/src/com/netscape/management/client/topology/customview In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv22640/src/com/netscape/management/client/topology/customview
Modified Files: CustomView.java ViewInfo.java Log Message: Bug(s) fixed: 180544 Bug Description: Building Console fails with Java 1.5. This is because "enum" has been added as a reserved keyword in Java 1.5, and we use it as a variable name.
There is also a warning issued during build time about our usage of Method.invoke(). We are passing a "null" as the second parameter, but invoke() is overloaded and the compiler has to guess about which method to use. Reviewed by: Rich Files: see diffs Branch: HEAD Fix Description: Renamed our "enum" variable names. Added a cast to our usage of Method.invoke() to avoid a compiler warning. Platforms tested: RHEL4 Flag Day: no Doc impact: no QA impact: should be covered by regular nightly and manual testing New Tests integrated into TET: none
Index: CustomView.java =================================================================== RCS file: /cvs/dirsec/console/src/com/netscape/management/client/topology/customview/CustomView.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- CustomView.java 18 Jul 2005 00:34:20 -0000 1.1.1.1 +++ CustomView.java 8 Feb 2006 22:13:24 -0000 1.2 @@ -134,10 +134,10 @@ String name) { LDAPAttribute attr = ldapEntry.getAttribute(name); if (attr != null) { - Enumeration enum = attr.getStringValues(); - if (enum != null) + Enumeration attr_enum = attr.getStringValues(); + if (attr_enum != null) try { - return (String) enum.nextElement(); + return (String) attr_enum.nextElement(); } catch (Exception e)// if value stored was null, enum fails { Debug.println(0, "CustomView: no configuration data"); @@ -159,9 +159,9 @@ return; }
- Enumeration enum = attr.getStringValues(); - while (enum != null && enum.hasMoreElements()) { - String flag = ((String)enum.nextElement()).trim(); + Enumeration attr_enum = attr.getStringValues(); + while (attr_enum != null && attr_enum.hasMoreElements()) { + String flag = ((String)attr_enum.nextElement()).trim(); if (flag.equalsIgnoreCase("showTopContainer")) { _fShowTopContainer = true; }
Index: ViewInfo.java =================================================================== RCS file: /cvs/dirsec/console/src/com/netscape/management/client/topology/customview/ViewInfo.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- ViewInfo.java 18 Jul 2005 00:34:20 -0000 1.1.1.1 +++ ViewInfo.java 8 Feb 2006 22:13:24 -0000 1.2 @@ -87,10 +87,10 @@ String name) { LDAPAttribute attr = ldapEntry.getAttribute(name); if (attr != null) { - Enumeration enum = attr.getStringValues(); - if (enum != null) + Enumeration attr_enum = attr.getStringValues(); + if (attr_enum != null) try { - return (String) enum.nextElement(); + return (String) attr_enum.nextElement(); } catch (Exception e)// if value stored was null, enum fails { } @@ -110,9 +110,9 @@ String name, String value) { LDAPAttribute attr = ldapEntry.getAttribute(name); if (attr != null) { - Enumeration enum = attr.getStringValues(); - while (enum.hasMoreElements()) { - String v = (String)enum.nextElement(); + Enumeration attr_enum = attr.getStringValues(); + while (attr_enum.hasMoreElements()) { + String v = (String)attr_enum.nextElement(); if (v.equalsIgnoreCase(value)) { return true; } @@ -305,4 +305,4 @@ } return null; } -} \ No newline at end of file +}