< prev index next >

test/java/lang/instrument/IsModifiableClassAgent.java

Print this page




  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /**
  25  * @test
  26  * @bug 6331574
  27  * @summary test isModifiableClass
  28  * @author Robert Field, Sun Microsystems
  29  *
  30  * @modules java.instrument
  31  * @run build IsModifiableClassApp IsModifiableClassAgent
  32  * @run shell MakeJAR3.sh IsModifiableClassAgent 'Can-Retransform-Classes: true'
  33  * @run main/othervm -javaagent:IsModifiableClassAgent.jar IsModifiableClassApp
  34  */
  35 import java.lang.instrument.*;
  36 
  37 public class IsModifiableClassAgent
  38 {
  39     public static boolean fail = false;
  40     public static boolean completed = false;
  41 
  42     public static void
  43     premain(    String agentArgs,
  44                 Instrumentation instrumentation)
  45         {
  46             System.out.println("IsModifiableClassAgent started");
  47 
  48             Class[] allClasses = instrumentation.getAllLoadedClasses();
  49             int modCount = 0;
  50             int unmodCount = 0;




  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /**
  25  * @test
  26  * @bug 6331574
  27  * @summary test isModifiableClass
  28  * @author Robert Field, Sun Microsystems
  29  *

  30  * @run build IsModifiableClassApp IsModifiableClassAgent
  31  * @run shell MakeJAR3.sh IsModifiableClassAgent 'Can-Retransform-Classes: true'
  32  * @run main/othervm -javaagent:IsModifiableClassAgent.jar IsModifiableClassApp
  33  */
  34 import java.lang.instrument.*;
  35 
  36 public class IsModifiableClassAgent
  37 {
  38     public static boolean fail = false;
  39     public static boolean completed = false;
  40 
  41     public static void
  42     premain(    String agentArgs,
  43                 Instrumentation instrumentation)
  44         {
  45             System.out.println("IsModifiableClassAgent started");
  46 
  47             Class[] allClasses = instrumentation.getAllLoadedClasses();
  48             int modCount = 0;
  49             int unmodCount = 0;


< prev index next >