importorg.opalj.collection.immutable._;importorg.opalj.br._;importorg.opalj.br.analyses._;importorg.opalj.br.instructions._;importorg.opalj.collection.immutable.ConstArray.find;importorg.opalj.util.PerformanceEvaluation.time// create a projectimplicitvalp=Project(newjava.io.File("/Users/Michael/Code/OPAL/OPAL/bi/target/scala-2.11/resource_managed/test/pureness.jar"))// get the central property storeimplicitvalps=p.get(SourceElementsPropertyStoreKey)ps.debug=true// run the analysis (asynchronously)org.opalj.fpcf.analysis.PurityAnalysis.start(p,ps);Thread.sleep(500)// make sure that all computations have finished (this is a blocking operation)ps.waitOnPropertyComputationCompletion(true)// query the property storeps.collect{case(method:Method,purity:org.opalj.fpcf.properties.Purity)=>method.toJava(p.classFile(method),purity.toString)}.toList.sorted.foreach(println)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.