Index: nucleus/common/common-util/src/main/java/org/glassfish/common/util/admin/GenericCommandModel.java =================================================================== --- nucleus/common/common-util/src/main/java/org/glassfish/common/util/admin/GenericCommandModel.java (revision 53612) +++ nucleus/common/common-util/src/main/java/org/glassfish/common/util/admin/GenericCommandModel.java (working copy) @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011-2012 Oracle and/or its affiliates. All rights reserved. * * 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 @@ -106,20 +106,21 @@ if (m.isAnnotationPresent(Param.class)) { Param p = m.getAnnotation(Param.class); if (p.name() != null && !p.name().isEmpty()) { - params.put(p.name(), new ParamBasedModel(p.name(), p, paramI18n)); + // GLASSFISH-18654: make sure password params are handled + String name = CommandModel.getParamName(p, m); + params.put(name, new ParamBasedModel(name, p, paramI18n)); + } else if (m.isAnnotationPresent(Attribute.class)) { + Attribute attr = m.getAnnotation(Attribute.class); + if (attr.value() != null && !attr.value().isEmpty()) { + params.put(attr.value(), new AttributeBasedModel(attr.value(), attr, paramI18n)); + } else { + params.put(attributeName, new AttributeBasedModel(attributeName, attr, paramI18n)); + } } else { - if (m.isAnnotationPresent(Attribute.class)) { - Attribute attr = m.getAnnotation(Attribute.class); - if (attr.value() != null && !attr.value().isEmpty()) { - params.put(attr.value(), new AttributeBasedModel(attr.value(), attr, paramI18n)); - } else { - params.put(attributeName, new AttributeBasedModel(attributeName, attr, paramI18n)); - } - } else { // use method name. - String name = cm.trimPrefix(m.getName()); + // GLASSFISH-18654: make sure password params are handled + String name = CommandModel.getParamName(p, m); params.put(name, new ParamBasedModel(name, p, paramI18n)); - } } } } Index: nucleus/common/glassfish-api/src/main/java/org/glassfish/api/admin/CommandModel.java =================================================================== --- nucleus/common/glassfish-api/src/main/java/org/glassfish/api/admin/CommandModel.java (revision 53612) +++ nucleus/common/glassfish-api/src/main/java/org/glassfish/api/admin/CommandModel.java (working copy) @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright (c) 2008-2011 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008-2012 Oracle and/or its affiliates. All rights reserved. * * 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 @@ -149,7 +149,11 @@ name = ((Field) annotated).getName(); } if (annotated instanceof Method) { - name = ((Method) annotated).getName().substring(3); + if ( ((Method) annotated).getName().startsWith("is")) { + name = ((Method) annotated).getName().substring(2); + } else { + name = ((Method) annotated).getName().substring(3); + } name = Introspector.decapitalize(name); } }