I read quite a few questions about Stackoverflow about this question, but couldn't stop finding a solution or answer my problems. If there is already one, I would be grateful if someone gave a hint ...
My problem / question is, can reflection be completely disabled for untrusted code? Functions like getDeclaredMethods()
(see Test.java). I already have a Java security manager that throws security exceptions if the code tries to write / read / etc ....
If possible, can someone show me?
Bruno
test.java
TestClass cls = new TestClass(); Class c = cls.getClass(); // returns the array of Method objects Method[] m = c.getDeclaredMethods(); for(int i = 0; i < m.length; i++) { System.out.println("method = " + m[i].toString()); }
Bruno source share