<commit_before>/*
 * Copyright 2015-2016 the original author or authors.
 *
 * All rights reserved. This program and the accompanying materials are
 * made available under the terms of the Eclipse Public License v1.0 which
 * accompanies this distribution and is available at
 *
 * http://www.eclipse.org/legal/epl-v10.html
 */

package org.junit.jupiter.migrationsupport.rules.member;

import static org.junit.platform.commons.meta.API.Usage.Internal;

import java.lang.reflect.Field;
import java.util.logging.Logger;

import org.junit.platform.commons.meta.API;
import org.junit.rules.TestRule;

@API(Internal)
public class RuleAnnotatedField extends AbstractRuleAnnotatedMember {

	private static final Logger LOG = Logger.getLogger(RuleAnnotatedField.class.getName());

	public RuleAnnotatedField(Object testInstance, Field testRuleField) {
		try {
			testRuleField.setAccessible(true);
			this.testRuleInstance = (TestRule) testRuleField.get(testInstance);
		}
		catch (IllegalAccessException exception) {
			LOG.warning(exception.getMessage());
		}
	}

}<commit_msg>Throw IllegalAccessException like in RuleAnnotatedMethod<commit_after>/*
 * Copyright 2015-2016 the original author or authors.
 *
 * All rights reserved. This program and the accompanying materials are
 * made available under the terms of the Eclipse Public License v1.0 which
 * accompanies this distribution and is available at
 *
 * http://www.eclipse.org/legal/epl-v10.html
 */

package org.junit.jupiter.migrationsupport.rules.member;

import static org.junit.platform.commons.meta.API.Usage.Internal;

import java.lang.reflect.Field;
import java.util.logging.Logger;

import org.junit.platform.commons.meta.API;
import org.junit.platform.commons.util.ExceptionUtils;
import org.junit.rules.TestRule;

@API(Internal)
public class RuleAnnotatedField extends AbstractRuleAnnotatedMember {

	private static final Logger LOG = Logger.getLogger(RuleAnnotatedField.class.getName());

	public RuleAnnotatedField(Object testInstance, Field testRuleField) {
		try {
			testRuleField.setAccessible(true);
			this.testRuleInstance = (TestRule) testRuleField.get(testInstance);
		}
		catch (IllegalAccessException exception) {
			throw ExceptionUtils.throwAsUncheckedException(exception);
		}
	}

}
{'fraction_non_alphanumeric': 0.09231448763250884, 'fraction_numerical': 0.01060070671378092, 'mean_word_length': 5.154891304347826, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '4498279', 'n_tokens_mistral': 684, 'n_tokens_neox': 643, 'n_words': 161}