/* BSD 2-Clause License - see OPAL/LICENSE for details. */ package org.opalj package issues import scala.xml.Node import scala.xml.Text import scala.xml.Comment import play.api.libs.json.Json import play.api.libs.json.JsValue import play.api.libs.json.JsNull import org.opalj.collection.mutable.Locals import org.opalj.br.PC import org.opalj.br.Code /** * @param localVariables The register values at the given location. */ class LocalVariables( val code: Code, val pc: PC, val localVariables: Locals[_ <: AnyRef] ) extends IssueDetails { def toXHTML(basicInfoOnly: Boolean): Node = { val localVariableDefinitions = code.localVariablesAt(pc) if (localVariableDefinitions.isEmpty) return Comment("local variable information are not found in the class file"); if (basicInfoOnly) return Text(""); val sortedLVDefs = localVariableDefinitions.toSeq.sortWith((a, b) => a._1 < b._1) val lvsAsXHTML = for ((index, theLV) <- sortedLVDefs) yield { val localValue = localVariables(index) val localValueAsXHTML = if (localValue == null) unused else Text(localVariableToString(theLV, localValue))
Index | Name | Value |
---|