Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR feedback #1574

Merged
merged 1 commit into from
Sep 11, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 9 additions & 12 deletions shark/src/main/java/shark/ReferencePattern.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ sealed class ReferencePattern : Serializable {
data class JavaLocalPattern(
val threadName: String
) : ReferencePattern() {
override fun toString(): String {
return "local variable on thread $threadName"
}
override fun toString() = "local variable on thread $threadName"
}

/**
Expand All @@ -25,9 +23,7 @@ sealed class ReferencePattern : Serializable {
val className: String,
val fieldName: String
) : ReferencePattern() {
override fun toString(): String {
return "static field $className#$fieldName"
}
override fun toString() = "static field $className#$fieldName"
}

/**
Expand All @@ -42,14 +38,15 @@ sealed class ReferencePattern : Serializable {
val className: String,
val fieldName: String
) : ReferencePattern() {
override fun toString(): String {
return "instance field $className#$fieldName"
}
override fun toString() = "instance field $className#$fieldName"
}

/**
* Matches native global variables (also known as jni global gc roots) that reference
* Java objects. The class name will match against classes, instances and object arrays with
* a matching class name.
*/
data class NativeGlobalVariablePattern(val className: String) : ReferencePattern() {
override fun toString(): String {
return "native global variable referencing $className"
}
override fun toString() = "native global variable referencing $className"
}
}