Skip to content

Commit

Permalink
🎨
Browse files Browse the repository at this point in the history
  • Loading branch information
TAKETODAY committed Feb 23, 2025
1 parent 131b1d4 commit 6737bee
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 20 deletions.
5 changes: 0 additions & 5 deletions checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,6 @@
<property name="illegalClasses" value="^org\.jetbrains\.annotations\..+" />
</module>

<!-- Javadoc Comments -->
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTypeCheck">
<property name="scope" value="package" />
<!-- <property name="authorFormat" value=".+\s.+" />-->
</module>
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck">
<property name="allowMissingParamTags" value="true" />
<property name="allowMissingReturnTag" value="true" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 - 2024 the original author or authors.
* Copyright 2017 - 2025 the original author or authors.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -152,8 +152,7 @@ void shouldProcessDifferentAnnotationsOnTypeAndField() {
@Test
void shouldInvokeCustomProcessor() {
process(SampleCustomProcessor.class);
assertThat(RuntimeHintsPredicates.reflection()
.onMethod(SampleCustomProcessor.class, "managed")).accepts(this.runtimeHints);
assertThat(RuntimeHintsPredicates.reflection().onMethodInvocation(SampleCustomProcessor.class, "managed")).accepts(this.runtimeHints);
assertThat(RuntimeHintsPredicates.reflection().onType(String.class)
.withMemberCategory(MemberCategory.INVOKE_DECLARED_METHODS)).accepts(this.runtimeHints);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017 - 2024 the original author or authors.
* Copyright 2017 - 2025 the original author or authors.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -41,23 +41,23 @@ void registerReflectionForBindingOnClass() {
processor.registerReflectionHints(hints.reflection(), ClassLevelAnnotatedBean.class);
assertThat(RuntimeHintsPredicates.reflection().onType(SampleClassWithGetter.class)).accepts(hints);
assertThat(RuntimeHintsPredicates.reflection().onType(String.class)).accepts(hints);
assertThat(RuntimeHintsPredicates.reflection().onMethod(SampleClassWithGetter.class, "getName")).accepts(hints);
assertThat(RuntimeHintsPredicates.reflection().onMethodInvocation(SampleClassWithGetter.class, "getName")).accepts(hints);
}

@Test
void registerReflectionForBindingOnMethod() throws NoSuchMethodException {
processor.registerReflectionHints(hints.reflection(), MethodLevelAnnotatedBean.class.getMethod("method"));
assertThat(RuntimeHintsPredicates.reflection().onType(SampleClassWithGetter.class)).accepts(hints);
assertThat(RuntimeHintsPredicates.reflection().onType(String.class)).accepts(hints);
assertThat(RuntimeHintsPredicates.reflection().onMethod(SampleClassWithGetter.class, "getName")).accepts(hints);
assertThat(RuntimeHintsPredicates.reflection().onMethodInvocation(SampleClassWithGetter.class, "getName")).accepts(hints);
}

@Test
void registerReflectionForBindingOnClassItself() {
processor.registerReflectionHints(hints.reflection(), SampleClassWithoutAnnotationAttribute.class);
assertThat(RuntimeHintsPredicates.reflection().onType(SampleClassWithoutAnnotationAttribute.class)).accepts(hints);
assertThat(RuntimeHintsPredicates.reflection().onType(String.class)).accepts(hints);
assertThat(RuntimeHintsPredicates.reflection().onMethod(SampleClassWithoutAnnotationAttribute.class, "getName")).accepts(hints);
assertThat(RuntimeHintsPredicates.reflection().onMethodInvocation(SampleClassWithoutAnnotationAttribute.class, "getName")).accepts(hints);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
/*
* Original Author -> Harry Yang ([email protected]) https://taketoday.cn
* Copyright © Harry Yang & 2017 - 2023 All Rights Reserved.
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER
* Copyright 2017 - 2025 the original author or authors.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -15,7 +12,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see [http://www.gnu.org/licenses/]
* along with this program. If not, see [https://www.gnu.org/licenses/]
*/

package infra.aot.hint.support;
Expand Down Expand Up @@ -53,13 +50,13 @@ void setup() {

@Test
void javaSqlDateHasHints() throws NoSuchMethodException {
assertThat(RuntimeHintsPredicates.reflection().onMethod(java.sql.Date.class, "toLocalDate")).accepts(this.hints);
assertThat(RuntimeHintsPredicates.reflection().onMethod(java.sql.Date.class.getMethod("valueOf", LocalDate.class))).accepts(this.hints);
assertThat(RuntimeHintsPredicates.reflection().onMethodInvocation(java.sql.Date.class, "toLocalDate")).accepts(this.hints);
assertThat(RuntimeHintsPredicates.reflection().onMethodInvocation(java.sql.Date.class.getMethod("valueOf", LocalDate.class))).accepts(this.hints);
}

@Test
void uriHasHints() throws NoSuchMethodException {
assertThat(RuntimeHintsPredicates.reflection().onConstructor(URI.class.getConstructor(String.class))).accepts(this.hints);
assertThat(RuntimeHintsPredicates.reflection().onConstructorInvocation(URI.class.getConstructor(String.class))).accepts(this.hints);
}

}

0 comments on commit 6737bee

Please sign in to comment.