<commit_before>package jpower.core.internal;

import jpower.core.reflect.FieldAccessor;
import sun.misc.Unsafe;

import java.lang.instrument.Instrumentation;
import java.util.Vector;

public class PowerInternalSystem
{
   private static Instrumentation inst;

   public static void premain(String args, Instrumentation inst)
   {
      PowerInternalSystem.inst = inst;
   }

   public static void agentmain(String args, Instrumentation inst)
   {
      PowerInternalSystem.inst = inst;
   }

   @SuppressWarnings({"unchecked", "UseOfObsoleteCollectionType"})
   public static Class[] getLoadedClasses(ClassLoader loader)
   {
      try
      {
         Vector<Class> classList = (Vector<Class>) new FieldAccessor(ClassLoader.class, loader).get("classes");
         return classList.toArray(new Class[classList.size()]);
      }
      catch (NoSuchFieldException | IllegalAccessException e)
      {
         return null;
      }
   }

   public static Instrumentation getInstrumentation()
   {
      return inst;
   }

   public static Unsafe getUnsafe()
   {
      try
      {<commit_msg>Core: PowerInternalSystem: Use Generics for getLoadedClasses<commit_after>package jpower.core.internal;

import jpower.core.reflect.FieldAccessor;
import sun.misc.Unsafe;

import java.lang.instrument.Instrumentation;
import java.util.Vector;

public class PowerInternalSystem
{
   private static Instrumentation inst;

   public static void premain(String args, Instrumentation inst)
   {
      PowerInternalSystem.inst = inst;
   }

   public static void agentmain(String args, Instrumentation inst)
   {
      PowerInternalSystem.inst = inst;
   }

   @SuppressWarnings({"unchecked", "UseOfObsoleteCollectionType"})
   public static Class<?>[] getLoadedClasses(ClassLoader loader)
   {
      try
      {
         Vector<Class<?>> classList = (Vector<Class<?>>) new FieldAccessor(ClassLoader.class, loader).get("classes");
         return classList.toArray(new Class<?>[classList.size()]);
      }
      catch (NoSuchFieldException | IllegalAccessException e)
      {
         return null;
      }
   }

   public static Instrumentation getInstrumentation()
   {
      return inst;
   }

   public static Unsafe getUnsafe()
   {
      try
      {
{'fraction_non_alphanumeric': 0.09306487695749441, 'fraction_numerical': 0.0, 'mean_word_length': 3.350194552529183, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4265851', 'n_tokens_mistral': 636, 'n_tokens_neox': 620, 'n_words': 143}