Snippets

Michael Eichberg [OPAL - 1.0.0] Running an analysis (here PurityAnalysis) using the PropertyStore (the FixpointComputationsFramework)

Updated by Michael Eichberg

File PropertyStoreUsage.scala Modified

  • Ignore whitespace
  • Hide word diff
+// sbt project OPAL-DeveloperTools
 import org.opalj.collection.immutable._; import org.opalj.br._ ; import org.opalj.br.analyses._; import org.opalj.br.instructions._; import org.opalj.collection.immutable.ConstArray.find; import org.opalj.util.PerformanceEvaluation.time
 // create a project
-implicit val p = Project(new java.io.File("OPAL/bi/target/scala-2.11/resource_managed/test/pureness-1.8-g-parameters-genericsignature.jar"))
+implicit val p = Project(new java.io.File("OPAL/bi/target/scala-2.12/resource_managed/test/pureness-1.8-g-parameters-genericsignature.jar"))
 // get the central property store
 implicit val ps = p.get(PropertyStoreKey)
-ps.debug = true
 
 // run the analysis (asynchronously)
-org.opalj.fpcf.analysis.PurityAnalysis.start(p,ps); Thread.sleep(500)
+org.opalj.fpcf.analyses.PurityAnalysis.start(p,ps); Thread.sleep(500)
 
 // make sure that all computations have finished (this is a blocking operation)
 ps.waitOnPropertyComputationCompletion(true)
Updated by Michael Eichberg

File PropertyStoreUsage.scala Modified

  • Ignore whitespace
  • Hide word diff
 import org.opalj.collection.immutable._; import org.opalj.br._ ; import org.opalj.br.analyses._; import org.opalj.br.instructions._; import org.opalj.collection.immutable.ConstArray.find; import org.opalj.util.PerformanceEvaluation.time
 // create a project
-implicit val p = Project(new java.io.File("OPAL/bi/target/scala-2.11/resource_managed/test/pureness.jar"))
+implicit val p = Project(new java.io.File("OPAL/bi/target/scala-2.11/resource_managed/test/pureness-1.8-g-parameters-genericsignature.jar"))
 // get the central property store
 implicit val ps = p.get(PropertyStoreKey)
 ps.debug = true
 
 // query the property store
 ps.collect{
-    case (method : Method, purity : org.opalj.fpcf.properties.Purity) => method.toJava(p.classFile(method),purity.toString)
+    case (method : Method, purity : org.opalj.fpcf.properties.Purity) => method.toJava(purity.toString)
 }.toList.sorted.foreach(println)
Updated by Michael Eichberg

File PropertyStoreUsage.scala Modified

  • Ignore whitespace
  • Hide word diff
 import org.opalj.collection.immutable._; import org.opalj.br._ ; import org.opalj.br.analyses._; import org.opalj.br.instructions._; import org.opalj.collection.immutable.ConstArray.find; import org.opalj.util.PerformanceEvaluation.time
 // create a project
-implicit val p = Project(new java.io.File("/Users/Michael/Code/OPAL/OPAL/bi/target/scala-2.11/resource_managed/test/pureness.jar"))
+implicit val p = Project(new java.io.File("OPAL/bi/target/scala-2.11/resource_managed/test/pureness.jar"))
 // get the central property store
-implicit val ps = p.get(SourceElementsPropertyStoreKey)
+implicit val ps = p.get(PropertyStoreKey)
 ps.debug = true
 
 // run the analysis (asynchronously)
Updated by Michael Eichberg

File PropertyStoreUsage.scala Modified

  • Ignore whitespace
  • Hide word diff
 import org.opalj.collection.immutable._; import org.opalj.br._ ; import org.opalj.br.analyses._; import org.opalj.br.instructions._; import org.opalj.collection.immutable.ConstArray.find; import org.opalj.util.PerformanceEvaluation.time
 // create a project
-implicit val p = Project(new java.io.File("/Users/eichberg/Code/OPAL/OPAL/ai/src/test/resources/classfiles/pureness.jar"))
+implicit val p = Project(new java.io.File("/Users/Michael/Code/OPAL/OPAL/bi/target/scala-2.11/resource_managed/test/pureness.jar"))
 // get the central property store
 implicit val ps = p.get(SourceElementsPropertyStoreKey)
 ps.debug = true
Created by Michael Eichberg

File PropertyStoreUsage.scala Added

  • Ignore whitespace
  • Hide word diff
+import org.opalj.collection.immutable._; import org.opalj.br._ ; import org.opalj.br.analyses._; import org.opalj.br.instructions._; import org.opalj.collection.immutable.ConstArray.find; import org.opalj.util.PerformanceEvaluation.time
+// create a project
+implicit val p = Project(new java.io.File("/Users/eichberg/Code/OPAL/OPAL/ai/src/test/resources/classfiles/pureness.jar"))
+// get the central property store
+implicit val ps = 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 store
+ps.collect{
+    case (method : Method, purity : org.opalj.fpcf.properties.Purity) => method.toJava(p.classFile(method),purity.toString)
+}.toList.sorted.foreach(println)
HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.