public void load ( InputStream input , final boolean checkRewrite ) throws IOException { new TaintConfigLoader ( ) . load ( input , new TaintConfigLoader . TaintConfigReceiver ( ) { @ Override public void receiveTaintConfig ( String typeSignature , String config ) throws IOException { if ( TaintMethodConfig . accepts ( typeSignature , config ) ) { if ( checkRewrite && containsKey ( typeSignature ) ) { throw new IllegalStateException ( "Config for " + typeSignature + " already loaded" ) ; } TaintMethodConfig taintMethodConfig = new TaintMethodConfig ( true ) . load ( config ) ; taintMethodConfig . setTypeSignature ( typeSignature ) ; put ( typeSignature , taintMethodConfig ) ; return ; } if ( TaintClassConfig . accepts ( typeSignature , config ) ) { if ( checkRewrite && taintClassConfigMap . containsKey ( typeSignature ) ) { throw new IllegalStateException ( "Config for " + typeSignature + " already loaded" ) ; } TaintClassConfig taintClassConfig = new TaintClassConfig ( ) . load ( config ) ; taintClassConfigMap . put ( typeSignature , taintClassConfig ) ; return ; } if ( TaintMethodConfigWithArgumentsAndLocation . accepts ( typeSignature , config ) ) { if ( checkRewrite && taintMethodConfigWithArgumentsAndLocationMap . containsKey ( typeSignature ) ) { throw new IllegalStateException ( "Config for " + typeSignature + " already loaded" ) ; } TaintMethodConfigWithArgumentsAndLocation methodConfig = new TaintMethodConfigWithArgumentsAndLocation ( ) . load ( config ) ; methodConfig . setTypeSignature ( typeSignature ) ; String key = typeSignature + ' ' + methodConfig . getLocation ( ) ; taintMethodConfigWithArgumentsAndLocationMap . put ( key , methodConfig ) ; return ; } throw new IllegalArgumentException ( "Invalid full method name " + typeSignature + " configured" ) ; } } ) ; }
Loads summaries from stream checking the format