リフレクション API を使用して同期メソッドを取得しようとしています。
以下にサンプルコードスニペットを示します。
class ABC {
class XYZ {
synchronized List methodOfXYZ() {
System.out.println("Im in Method");
// do sum stuff
return <Obj-List>;
}
}
}
次のような実行時例外が発生します。
java.lang.IllegalAccessException: Class "com.TestReflection" can not access a member of class "com.ABC$XYZ" with modifiers "synchronized".