@Override
public MBeanNotificationInfo[] getNotificationInfo() {
- MBeanNotificationInfo[] pres = super.getNotificationInfo();
- MBeanNotificationInfo[] loc = getDefaultNotificationInfo();
- MBeanNotificationInfo[] aug = new MBeanNotificationInfo[
- pres.length + loc.length
- ];
- System.arraycopy(pres, 0, aug, 0, pres.length);
- System.arraycopy(loc, 0, aug, pres.length+1, loc.length);
-
+ MBeanNotificationInfo[] pres = super.getNotificationInfo();
+ MBeanNotificationInfo[] loc = getDefaultNotificationInfo();
+ MBeanNotificationInfo[] aug = new MBeanNotificationInfo[pres.length + loc.length];
+ if (pres.length>0) System.arraycopy(pres, 0, aug, 0, pres.length);
+ if (loc.length >0) System.arraycopy(loc, 0, aug, pres.length>0?pres.length+1:0, loc.length);
return aug;
}