summaryrefslogtreecommitdiff
path: root/runtime/common_throws.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/common_throws.cc')
-rw-r--r--runtime/common_throws.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/runtime/common_throws.cc b/runtime/common_throws.cc
index 0808999e24..b401066f7c 100644
--- a/runtime/common_throws.cc
+++ b/runtime/common_throws.cc
@@ -283,8 +283,7 @@ void ThrowNegativeArraySizeException(const char* msg) {
// NoSuchFieldError
void ThrowNoSuchFieldError(const StringPiece& scope, mirror::Class* c,
- const StringPiece& type, const StringPiece& name)
- SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
+ const StringPiece& type, const StringPiece& name) {
std::ostringstream msg;
std::string temp;
msg << "No " << scope << "field " << name << " of type " << type
@@ -292,6 +291,13 @@ void ThrowNoSuchFieldError(const StringPiece& scope, mirror::Class* c,
ThrowException("Ljava/lang/NoSuchFieldError;", c, msg.str().c_str());
}
+void ThrowNoSuchFieldException(mirror::Class* c, const StringPiece& name) {
+ std::ostringstream msg;
+ std::string temp;
+ msg << "No field " << name << " in class " << c->GetDescriptor(&temp);
+ ThrowException("Ljava/lang/NoSuchFieldException;", c, msg.str().c_str());
+}
+
// NoSuchMethodError
void ThrowNoSuchMethodError(InvokeType type, mirror::Class* c, const StringPiece& name,