<commit_before>/*
 * Copyright 2002-2022 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.springframework.aot.hint.support;

import org.springframework.aot.hint.RuntimeHints;
import org.springframework.core.annotation.AliasFor;
import org.springframework.core.annotation.MergedAnnotation;
import org.springframework.core.annotation.SynthesizedAnnotation;

/**
 * Utility methods for runtime hints support code.
 *
 * @author <NAME>
 * @author <NAME>
 * @since 6.0
 */
public abstract class RuntimeHintsUtils {

	/**
	 * Register the necessary hints so that the specified annotation is visible
	 * at runtime.
	 * @param hints the {@link RuntimeHints} instance to use
	 * @param annotationType the annotation type
	 * @see SynthesizedAnnotation
	 * @deprecated as annotation attributes are visible without additional hints
	 */
	@Deprecated
	public static void registerAnnotation(RuntimeHints hints, Class<?> annotationType) {
		registerSynthesizedAnnotation(hints, annotationType);
	}

	/**
	 * Register the necessary hints so that the specified annotation can be
	 * synthesized at runtime if necessary. Such hints are usually required
	 * if any of the following apply:
	 * <ul>
	 * <li>Use {@link AliasFor} for local aliases</li>
	 * <li>Has a meta-annotation that uses {@link AliasFor} for attribute overrides</li>
	 * <li>Has nested annotations or arrays of annotations that are synthesizable</li><commit_msg>Restore ANNOTATION_HINT in a deprecated form for the time being<commit_after>/*
 * Copyright 2002-2022 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.springframework.aot.hint.support;

import java.util.function.Consumer;

import org.springframework.aot.hint.MemberCategory;
import org.springframework.aot.hint.RuntimeHints;
import org.springframework.aot.hint.TypeHint;
import org.springframework.aot.hint.TypeHint.Builder;
import org.springframework.core.annotation.AliasFor;
import org.springframework.core.annotation.MergedAnnotation;
import org.springframework.core.annotation.SynthesizedAnnotation;

/**
 * Utility methods for runtime hints support code.
 *
 * @author <NAME>
 * @author <NAME>
 * @since 6.0
 */
public abstract class RuntimeHintsUtils {

	/**
	 * A {@link TypeHint} customizer suitable for an annotation. Make sure
	 * that its attributes are visible.
	 * @deprecated as annotation attributes are visible without additional hints
	 */
	@Deprecated
	public static final Consumer<Builder> ANNOTATION_HINT = hint ->
			hint.withMembers(MemberCategory.INVOKE_DECLARED_METHODS);

	/**
	 * Register the necessary hints so that the specified annotation is visible
	 * at runtime.
	 * @param hints the {@link RuntimeHints} instance to use
	 * @param annotationType the annotation type
	 * @see SynthesizedAnnotation
	 * @deprecated as annotation attributes are visible without additional hints
	 */
	@Deprecated
	public static void registerAnnotation(RuntimeHints hints, Class<?> annotationType) {
		registerSynthesizedAnnotation(hints, annotationType);
	}

	/**
	 * Register the necessary hints so that the specified annotation can be
	 * synthesized at runtime if necessary. Such hints are usually required
	 * if any of the following apply:
	 * <ul>
	 * <li>Use {@link AliasFor} for local aliases</li>
	 * <li>Has a meta-annotation that uses {@link AliasFor} for attribute overrides</li>
	 * <li>Has nested annotations or arrays of annotations that are synthesizable</li>
{'fraction_non_alphanumeric': 0.08023872679045092, 'fraction_numerical': 0.00618921308576481, 'mean_word_length': 4.451807228915663, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 25, 'https://': 2, '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': '3113979', 'n_tokens_mistral': 1240, 'n_tokens_neox': 1135, 'n_words': 476}