<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MonoJavaBridge
{
    public abstract class JavaObject : IJavaObject
    {
        internal JniGlobalHandle mJvmHandle;

        public JniGlobalHandle JvmHandle
        {
            get { return mJvmHandle; }
        }
  
        bool mIsClrObject;
        public virtual bool IsClrObject
        {
            get
            {
                return mIsClrObject;
            }
        }
        
        public JavaObject(JNIEnv env)
        {
            Type type = GetType();
            mIsClrObject = type.GetCustomAttributes(typeof(JavaClassAttribute), false).Length == 0 && type.GetCustomAttributes(typeof(JavaProxyAttribute), false).Length == 0;
        }
        
        public void Init(JNIEnv env, JniLocalHandle handle)
        {
            if (JniLocalHandle.IsNull(handle))
                mJvmHandle = null;
            else
                mJvmHandle = env.NewGlobalRef(handle);
        }
        
        public void Init(JNIEnv env, JniGlobalHandle handle)
        {
            mJvmHandle = handle;
        }
        
        ~JavaObject()
        {
            MonoJavaBridge.JavaBridge.AddToMortuary(this);
        }
    }
}<commit_msg>only clr objects are added to the mortuary<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MonoJavaBridge
{
    public abstract class JavaObject : IJavaObject
    {
        internal JniGlobalHandle mJvmHandle;

        public JniGlobalHandle JvmHandle
        {
            get { return mJvmHandle; }
        }
  
        bool mIsClrObject;
        public virtual bool IsClrObject
        {
            get
            {
                return mIsClrObject;
            }
        }
        
        public JavaObject(JNIEnv env)
        {
            Type type = GetType();
            mIsClrObject = type.GetCustomAttributes(typeof(JavaClassAttribute), false).Length == 0 && type.GetCustomAttributes(typeof(JavaProxyAttribute), false).Length == 0;
        }
        
        public void Init(JNIEnv env, JniLocalHandle handle)
        {
            if (JniLocalHandle.IsNull(handle))
                mJvmHandle = null;
            else
                mJvmHandle = env.NewGlobalRef(handle);
        }
        
        public void Init(JNIEnv env, JniGlobalHandle handle)
        {
            mJvmHandle = handle;
        }
        
        ~JavaObject()
        {
            if (IsClrObject)
                MonoJavaBridge.JavaBridge.AddToMortuary(this);
        }
    }
}
{'fraction_non_alphanumeric': 0.07192042846212701, 'fraction_numerical': 0.001530221882172915, 'mean_word_length': 1.599403578528827, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4658821', 'n_tokens_mistral': 724, 'n_tokens_neox': 709, 'n_words': 147}