Snippets

Michael Eichberg [OPAL - 1.1.0] Setting a Property Store Tracer

Updated by Michael Eichberg

File PropertyStoreTracer.scala Modified

  • Ignore whitespace
  • Hide word diff
-// Let's assume that you have a project "project" and that you want to trace
+// Let's assume that you have a project "p" and that you want to trace
 // the execution of the property store to hunt down bugs.
 // BEFORE using the PropertyStore by any means, you have to update the 
 // configuration using "ProjectInformationKeyInitializationData" as shown
 // next:
-project.getOrCreateProjectInformationKeyInitializationData(
+
+// 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
+import org.opalj.fpcf._; import org.opalj.fpcf.par._
+
+// create a project
+implicit val p = Project(new java.io.File("OPAL/bi/target/scala-2.12/resource_managed/test/pureness-1.8-g-parameters-genericsignature.jar"))
+implicit val logContext = p.logContext
+p.getOrCreateProjectInformationKeyInitializationData(
     PropertyStoreKey,
     (context : List[PropertyStoreContext[AnyRef]]) => 
         PKEParallelTasksPropertyStore.create(new RecordAllPropertyStoreTracer,context.map(_.asTuple).toMap)
 )
+
+// NOW, get the central property store
+implicit val ps = p.get(PropertyStoreKey)
         
Created by Michael Eichberg

File PropertyStoreTracer.scala Added

  • Ignore whitespace
  • Hide word diff
+// Let's assume that you have a project "project" and that you want to trace
+// the execution of the property store to hunt down bugs.
+// BEFORE using the PropertyStore by any means, you have to update the 
+// configuration using "ProjectInformationKeyInitializationData" as shown
+// next:
+project.getOrCreateProjectInformationKeyInitializationData(
+    PropertyStoreKey,
+    (context : List[PropertyStoreContext[AnyRef]]) => 
+        PKEParallelTasksPropertyStore.create(new RecordAllPropertyStoreTracer,context.map(_.asTuple).toMap)
+)
+        
HTTPS SSH

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