<commit_before>package org.jgroups.demos;

import org.jgroups.annotations.MBean;
import org.jgroups.annotations.ManagedAttribute;
import org.jgroups.annotations.ManagedOperation;
import org.jgroups.jmx.Registration;
import org.jgroups.util.Util;

import javax.management.MBeanServer;

/**
 * Shows how annotations can be used to expose attributes and operations
 * @author <NAME>
 * @version $Id: JmxDemo.java,v 1.6 2008/03/10 07:06:21 belaban Exp $
 */
@MBean
public class JmxDemo {
    @ManagedAttribute
    private int age;   // exposed as read-only 'age'

    @ManagedAttribute
    private static final String last_name="Ban";  // read-only (because final) 'last_name'

    @ManagedAttribute
    private static final String first_name="Bela";  // read-only (final) 'first_name'

    @ManagedAttribute(description="social security number") // read-only
    private static final long id=322649L;

    public void foo() { // must be exposed because we have @MBean on the class
        System.out.println("foo(" + number + "): age=" + age + ", name=" + first_name + " " + last_name);
    }

    @ManagedAttribute
    private int number=10; // writeable because we have the (non-annnotated) setter below !!

    public int setNumber(int num) {number=num; return num;}
<commit_msg>wrong return type for setter<commit_after>package org.jgroups.demos;

import org.jgroups.annotations.MBean;
import org.jgroups.annotations.ManagedAttribute;
import org.jgroups.annotations.ManagedOperation;
import org.jgroups.jmx.Registration;
import org.jgroups.util.Util;

import javax.management.MBeanServer;

/**
 * Shows how annotations can be used to expose attributes and operations
 * @author <NAME>
 * @version $Id: JmxDemo.java,v 1.7 2008/03/10 08:57:57 vlada Exp $
 */
@MBean
public class JmxDemo {
    @ManagedAttribute
    private int age;   // exposed as read-only 'age'

    @ManagedAttribute
    private static final String last_name="Ban";  // read-only (because final) 'last_name'

    @ManagedAttribute
    private static final String first_name="Bela";  // read-only (final) 'first_name'

    @ManagedAttribute(description="social security number") // read-only
    private static final long id=322649L;

    public void foo() { // must be exposed because we have @MBean on the class
        System.out.println("foo(" + number + "): age=" + age + ", name=" + first_name + " " + last_name);
    }

    @ManagedAttribute
    private int number=10; // writeable because we have the (non-annnotated) setter below !!

    public void setNumber(int num) {number=num;}

{'fraction_non_alphanumeric': 0.112890625, 'fraction_numerical': 0.01875, 'mean_word_length': 3.859582542694497, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '228841', 'n_tokens_mistral': 806, 'n_tokens_neox': 755, 'n_words': 230}