private static Attribute throwBadLength(int expected) {
    throw new ParseException("bad attribute length; expected length " + Hex.u4(expected));
  }
Throws the right exception when an attribute has an unexpected length (given its contents).

@param expected expected length
@return never
@throws ParseException always thrown
android/android_framework/dex-maker/src/main/java/com/android/dx/cf/direct/StdAttributeFactory.java