Buggy code:
public abstract class Record implements Cloneable , Comparable { protected Name name ; protected int type ; protected int dclass ; protected long ttl ; private boolean empty ; private static final Record [ ] knownRecords = new Record [ 256 ] ; private static final Record unknownRecord = new UNKRecord ( ) ; private static final Class [ ] emptyClassArray = new Class [ 0 ] ; private static final Object [ ] emptyObjectArray = new Object [ 0 ] ; private static final DecimalFormat byteFormat = new DecimalFormat ( ) ; protected Record ( ) { } Record ( Name name , int type , int dclass , long ttl ) { } abstract Record getObject ( ) { } private static final Record getTypedObject ( int type ) { if ( ( type < 0 ) || ( type > ( Record . knownRecords . length ) ) ) return Record . unknownRecord . getObject ( ) ; if ( ( Record . knownRecords [ type ] ) != null ) return Record . knownRecords [ type ] ; String s = Record . class . getName ( ) ; StringBuffer sb = new StringBuffer ( s ) ; sb . insert ( s . lastIndexOf ( "Record" ) , java . lang . reflect . Type . string ( type ) ) ; try { <START_BUG> Class c = Class . forName ( sb . toString ( ) ) ; <END_BUG> Constructor m = c . getDeclaredConstructor ( Record . emptyClassArray ) ; Record . knownRecords [ type ] = ( ( Record ) ( m . newInstance ( Record . emptyObjectArray ) ) ) ; } catch ( ClassNotFoundException e ) { } catch ( Exception e ) { if ( Options . check ( "verbose" ) ) System . err . println ( e ) ; } if ( ( Record . knownRecords [ type ] ) == null ) Record . knownRecords [ type ] = Record . unknownRecord . getObject ( ) ; return Record . knownRecords [ type ] ; } private static final Record getEmptyRecord ( Name name , int type , int dclass , long ttl ) { } abstract void rrFromWire ( DNSInput in ) throws IOException { } private static Record newRecord ( Name name , int type , int dclass , long ttl , int length , DNSInput in ) throws IOException { } public static Record newRecord ( Name name , int type , int dclass , long ttl , int length , byte [ ] data ) { } public static Record newRecord ( Name name , int type , int dclass , long ttl , byte [ ] data ) { } public static Record newRecord ( Name name , int type , int dclass , long ttl ) { } public static Record newRecord ( Name name , int type , int dclass ) { } static Record fromWire ( DNSInput in , int section ) throws IOException { } public static Record fromWire ( byte [ ] b , int section ) throws IOException { } void toWire ( DNSOutput out , int section , Compression c ) { } public byte [ ] toWire ( int section ) { } private void toWireCanonical ( DNSOutput out , boolean noTTL ) { } private byte [ ] toWireCanonical ( boolean noTTL ) { } public byte [ ] toWireCanonical ( ) { } public byte [ ] rdataToWireCanonical ( ) { } abstract String rrToString ( ) { } public String rdataToString ( ) { } public String toString ( ) { } abstract void rdataFromString ( Tokenizer st , Name origin ) throws IOException { } protected static byte [ ] byteArrayFromString ( String s ) throws TextParseException { } protected static String byteArrayToString ( byte [ ] array , boolean quote ) { } protected static String unknownToString ( byte [ ] data ) { } public static Record fromString ( Name name , int type , int dclass , long ttl , Tokenizer st , Name origin ) throws IOException { } public static Record fromString ( Name name , int type , int dclass , long ttl , String s , Name origin ) throws IOException { } public Name getName ( ) { } public int getType ( ) { } public int getRRsetType ( ) { } public int getDClass ( ) { } public long getTTL ( ) { } abstract void rrToWire ( DNSOutput out , Compression c , boolean canonical ) { } public boolean equals ( Object arg ) { } public int hashCode ( ) { } private Record cloneRecord ( ) { } public Record withName ( Name name ) { } Record withDClass ( int dclass , long ttl ) { } public int compareTo ( Object o ) { } public Name getAdditionalName ( ) { } static int checkU8 ( String field , int val ) { } static int checkU16 ( String field , int val ) { } static long checkU32 ( String field , long val ) { } static Name checkName ( String field , Name name ) { } }

Fix:
Class c = Class . forName ( sb . toString ( ) . replace ( '-' , '_' ) ) ;