summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2012-02-14 10:44:29 -0800
committerElliott Hughes <enh@google.com>2012-02-14 11:24:47 -0800
commitb305770f45e9cec66c3bdf792c4e7fa9cff5ec6e (patch)
tree65edf838d32560b88d2221743f2232e235888e4f
parentedad6a280cfc63cba9646a83724957c71f1c31ba (diff)
downloadart-b305770f45e9cec66c3bdf792c4e7fa9cff5ec6e.zip
art-b305770f45e9cec66c3bdf792c4e7fa9cff5ec6e.tar.gz
art-b305770f45e9cec66c3bdf792c4e7fa9cff5ec6e.tar.bz2
Only JDWP exposes ACC_SUPER.
Also track the use of suppressed exceptions with ClassNotFoundException. Change-Id: I5349d2e397f94c162cf44435cd36cab71f233480
-rw-r--r--src/class_linker.cc2
-rw-r--r--src/jdwp/jdwp_handler.cc8
-rw-r--r--test/003-omnibus-opcodes/expected.txt12
3 files changed, 15 insertions, 7 deletions
diff --git a/src/class_linker.cc b/src/class_linker.cc
index 62d3df7..bc8e333 100644
--- a/src/class_linker.cc
+++ b/src/class_linker.cc
@@ -1386,8 +1386,6 @@ void ClassLinker::LoadClass(const DexFile& dex_file,
uint32_t access_flags = dex_class_def.access_flags_;
// Make sure that none of our runtime-only flags are set.
CHECK_EQ(access_flags & ~kAccJavaFlagsMask, 0U);
- // Set ACC_SUPER; dex files don't contain this flag, but all classes are supposed to have it set.
- access_flags |= kAccSuper;
klass->SetAccessFlags(access_flags);
klass->SetClassLoader(class_loader);
DCHECK_EQ(klass->GetPrimitiveType(), Primitive::kPrimNot);
diff --git a/src/jdwp/jdwp_handler.cc b/src/jdwp/jdwp_handler.cc
index 99916bd..7914aa7 100644
--- a/src/jdwp/jdwp_handler.cc
+++ b/src/jdwp/jdwp_handler.cc
@@ -469,15 +469,17 @@ static JdwpError handleRT_Signature(JdwpState* state, const uint8_t* buf, int da
return ERR_NONE;
}
-/*
- * Return the modifiers (a/k/a access flags) for a reference type.
- */
static JdwpError handleRT_Modifiers(JdwpState* state, const uint8_t* buf, int dataLen, ExpandBuf* pReply) {
RefTypeId refTypeId = ReadRefTypeId(&buf);
uint32_t access_flags;
if (!Dbg::GetAccessFlags(refTypeId, access_flags)) {
return ERR_INVALID_CLASS;
}
+
+ // Set ACC_SUPER; dex files don't contain this flag, but all classes are supposed to have it set.
+ // Class.getModifiers doesn't return it, but JDWP does, so we set it here.
+ access_flags |= kAccSuper;
+
expandBufAdd4BE(pReply, access_flags);
return ERR_NONE;
}
diff --git a/test/003-omnibus-opcodes/expected.txt b/test/003-omnibus-opcodes/expected.txt
index 3e7ce84..33322eb 100644
--- a/test/003-omnibus-opcodes/expected.txt
+++ b/test/003-omnibus-opcodes/expected.txt
@@ -69,11 +69,19 @@ UnresTest1...
UnresTest1...
UnresTest2...
java.lang.ClassNotFoundException: Didn't find class "UnresClass" on path: /data/art-test/003-omnibus-opcodes.jar
- at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
- at java.lang.ClassLoader.loadClass(ClassLoader.java:509)
+ at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:64)
+ at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at UnresTest2.run(UnresTest2.java:33)
at Main.run(Main.java:64)
at Main.main(Main.java:26)
+ Suppressed: java.lang.ClassNotFoundException: UnresClass
+ at java.lang.Class.classForName(Native Method)
+ at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
+ at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
+ at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
+ ... 4 more
+ Caused by: java.lang.NoClassDefFoundError: Class "LUnresClass;" not found
+ ... 8 more
InternedString.run
Done!