private static boolean checkSerial(StringMethodDesc[] descs) throws InvalidObjectException{ try { return check(descs); } catch (RuntimeException e) { rethrow(e); } return true; }
/** * Creates an instance with the specified ordered array of descriptors. * The {@link #getConstraints getConstraints} method searches the * descriptors in the specified order. For any given descriptor in the * array, no preceding descriptor can match at least the same methods as * the given descriptor; that is, more specific descriptors must precede * less specific descriptors. The array passed to the constructor is * neither modified nor retained; subsequent changes to that array have * no effect on the instance created. * * @param descs the descriptors * @throws NullPointerException if the argument is <code>null</code> or * any element of the argument is <code>null</code> * @throws IllegalArgumentException if the descriptors array is empty, or * if any descriptor is preceded by another descriptor that matches at * least the same methods */ public StringMethodConstraints(StringMethodDesc[] descs) { this(check(descs), descs.clone()); }
return new StringMethodConstraints(check(combinedDescs), combinedDescs);
private static StringMethodDesc[] convert(MethodDesc[] descs){ int len = descs.length; StringMethodDesc[] result = new StringMethodDesc[len]; for (int i = 0; i < len; i++){ result [i] = descs[i].getName() != null ? new StringMethodDesc( descs[i].getName(), descs[i].getParameterTypes(), descs[i].getConstraints() ) : new StringMethodDesc(descs[i].getConstraints()); } check(result); return result; }