summaryrefslogtreecommitdiff
path: root/runtime/utils.cc
diff options
context:
space:
mode:
author Andreas Gampe <agampe@google.com> 2014-09-23 10:38:30 -0700
committer Andreas Gampe <agampe@google.com> 2014-09-29 11:40:16 -0700
commitc0d8229898c44c0f604f08a5df1de83ff56c18fd (patch)
tree13b150e68e806204c547e04bc071246c06199c37 /runtime/utils.cc
parentc70535b4f9f1ff3e3da451734bb7d9601012ccc1 (diff)
ART: Better IllegalAccessException message
Bug: 17618578 Bug: 17614623 Change-Id: I0e3f15e676acd6ed5844fc86e136f75cc335372d
Diffstat (limited to 'runtime/utils.cc')
-rw-r--r--runtime/utils.cc29
1 files changed, 29 insertions, 0 deletions
diff --git a/runtime/utils.cc b/runtime/utils.cc
index dbd22139ea..0496d97ae7 100644
--- a/runtime/utils.cc
+++ b/runtime/utils.cc
@@ -474,6 +474,35 @@ std::string PrettyClassAndClassLoader(mirror::Class* c) {
return result;
}
+std::string PrettyJavaAccessFlags(uint32_t access_flags) {
+ std::string result;
+ if ((access_flags & kAccPublic) != 0) {
+ result += "public ";
+ }
+ if ((access_flags & kAccProtected) != 0) {
+ result += "protected ";
+ }
+ if ((access_flags & kAccPrivate) != 0) {
+ result += "private ";
+ }
+ if ((access_flags & kAccFinal) != 0) {
+ result += "final ";
+ }
+ if ((access_flags & kAccStatic) != 0) {
+ result += "static ";
+ }
+ if ((access_flags & kAccTransient) != 0) {
+ result += "transient ";
+ }
+ if ((access_flags & kAccVolatile) != 0) {
+ result += "volatile ";
+ }
+ if ((access_flags & kAccSynchronized) != 0) {
+ result += "synchronized ";
+ }
+ return result;
+}
+
std::string PrettySize(int64_t byte_count) {
// The byte thresholds at which we display amounts. A byte count is displayed
// in unit U when kUnitThresholds[U] <= bytes < kUnitThresholds[U+1].