private java . lang . reflect . Method findConstr ( String name ) { Selection slkt ; int i ; slkt = Method . forName ( name ) ; slkt = slkt . restrictArgumentCount ( fields . length ) ; for ( i = 0 ; i < fields . length ; i ++ ) { slkt . restrictArgumentType ( i , fields [ i ] . getReturnType ( ) ) ; } switch ( slkt . size ( ) ) { case 0 : throw new RuntimeException ( "no such constructor: " + name ) ; case 1 : return ( ( Method ) slkt . getFunction ( ) ) . getRaw ( ) ; default : throw new RuntimeException ( "constructor ambiguous: " + name ) ; } }
Helper method for the constructor .