Re: Default permission: "*" or "-"
Jeremy Boynes <[email protected]>
| Newsgroups | gmane.comp.java.mx4j.devel |
|---|---|
| Message-ID | <[email protected]> |
Bordet, Simone wrote: > I'm not sure. > I think MX4J behaves correctly when parsing the permission name passed > as a string, while only the interpretation between MX4J and RI in case > of 4-args constructor is different. > Although I think RI interpretation is wrong, I think there is no other > choice than adequate MX4J, since now RI is in J2SE. > > Jeremy, can you confirm the problems you have in the tests are only > because of the 4 args constructor ? > Yes. If I apply the attached patch (which explicitly forces "-" into the name for a 4-arg constructor) then all the TCK security tests and MBeanPermissionTest pass. -- Jeremy
mx4j_mbpermission2.patch
(text/x-patch, 972 B)
Index: src/core/javax/management/MBeanPermission.java
===================================================================
RCS file: /cvsroot/mx4j/mx4j/src/core/javax/management/MBeanPermission.java,v
retrieving revision 1.10
diff -r1.10 MBeanPermission.java
95,110c95,100
< if (className != null) target.append(className);
<
< if (memberName != null)
< {
< target.append("#");
< target.append(memberName);
< }
<
< if (objectName != null)
< {
< target.append("[");
< target.append(objectName.getCanonicalName());
< target.append("]");
< }
<
< if (target.length() == 0) return "-#-[-]";
---
> target.append(className == null ? "-" : className);
> target.append('#');
> target.append(memberName == null ? "-" : memberName);
> target.append('[');
> target.append(objectName == null ? "-" : objectName.getCanonicalName());
> target.append(']');