(tapestry-5) 03/04: TAP5-2770: fixing JavaDoc errors
This is an automated email from the ASF dual-hosted git repository. thiagohp pushed a commit to branch javax in repository https://gitbox.apache.org/repos/asf/tapestry-5.git commit b632f5e0a75d1b1f49aadb3746c261bf4b1d872a Author: Thiago H. de Paula Figueiredo AuthorDate: Wed Dec 20 21:42:51 2023 -0300 TAP5-2770: fixing JavaDoc errors --- .../tapestry5/plastic/FieldValueProvider.java | 2 +- .../org/apache/tapestry5/plastic/PlasticUtils.java | 29 - .../tapestry5/plastic/PropertyValueProvider.java | 8 +++--- .../apache/tapestry5/plastic/PlasticUtilsTest.java | 30 ++ 4 files changed, 46 insertions(+), 23 deletions(-) diff --git a/plastic/src/main/java/org/apache/tapestry5/plastic/FieldValueProvider.java b/plastic/src/main/java/org/apache/tapestry5/plastic/FieldValueProvider.java index 79087e8b8..c964530f5 100644 --- a/plastic/src/main/java/org/apache/tapestry5/plastic/FieldValueProvider.java +++ b/plastic/src/main/java/org/apache/tapestry5/plastic/FieldValueProvider.java @@ -19,7 +19,7 @@ package org.apache.tapestry5.plastic; * Interface that can be implemented to provide access to field values based on their name. * Usually implemented with {@linkplain PlasticUtils#implementFieldValueProvider(PlasticClass, java.util.Set)}, * which doesn't use reflection. - * + * * * The name of its abstract method is intended to avoid clashes with other existing methods * in the class. diff --git a/plastic/src/main/java/org/apache/tapestry5/plastic/PlasticUtils.java b/plastic/src/main/java/org/apache/tapestry5/plastic/PlasticUtils.java index 9c35d3428..e9d469c3b 100644 --- a/plastic/src/main/java/org/apache/tapestry5/plastic/PlasticUtils.java +++ b/plastic/src/main/java/org/apache/tapestry5/plastic/PlasticUtils.java @@ -39,10 +39,13 @@ public class PlasticUtils private static final MethodDescription PROPERTY_VALUE_PROVIDER_METHOD_DESCRIPTION; +private static final MethodDescription FIELD_VALUE_PROVIDER_METHOD_DESCRIPTION; + static { try { PROPERTY_VALUE_PROVIDER_METHOD_DESCRIPTION = new MethodDescription(PropertyValueProvider.class.getMethod("__propertyValueProvider__get", String.class)); +FIELD_VALUE_PROVIDER_METHOD_DESCRIPTION = new MethodDescription(FieldValueProvider.class.getMethod("__fieldValueProvider__get", String.class)); } catch (Exception e) { throw new ExceptionInInitializerError(e); } @@ -185,10 +188,10 @@ public class PlasticUtils * an {@linkplain IllegalAccessError}. * * @param plasticClass a {@linkplain PlasticClass} instance. - * @param fieldNames a {@linkplain Set} of {@linkplain String}s containing the field names. + * @param fieldInfos a {@linkplain Set} of {@linkplain String}s containing the field names. * @since 5.8.4 */ -public static void implementFieldValueProvider(PlasticClass plasticClass, Set fields) +public static void implementFieldValueProvider(PlasticClass plasticClass, Set fieldInfos) { final Set methods = plasticClass.introduceInterface(FieldValueProvider.class); @@ -199,7 +202,7 @@ public class PlasticUtils method.changeImplementation((builder) -> { -for (FieldInfo field : fields) +for (FieldInfo field : fieldInfos) { builder.loadArgument(0); builder.loadConstant(field.name); @@ -212,6 +215,18 @@ public class PlasticUtils }); } +builder.loadThis(); +builder.instanceOf(FieldValueProvider.class); + +builder.when(Condition.NON_ZERO, ifBuilder -> { +builder.loadThis(); +builder.loadArgument(0); +ifBuilder.invokeSpecial( +plasticClass.getSuperClassName(), +FIELD_VALUE_PROVIDER_METHOD_DESCRIPTION); +ifBuilder.returnResult(); +}); + builder.throwException(RuntimeException.class, "Field not found or not supported"); }); @@ -227,17 +242,17 @@ public class PlasticUtils * of direct fields access. * * @param plasticClass a {@linkplain PlasticClass} instance. - * @param fieldNames a {@linkplain Set} of {@linkplain String}s containing the filed (i.e. property) names. + * @param fieldInfos a {@linkplain Set} of {@linkplain String}s containing the filed (i.e. property) names. * @since 5.8.4 */ -public static void implementPropertyValueProvider(PlasticClass plasticClass, Set fields) +public static void implementPropertyValueProvider(PlasticClass plasticClass, Set fieldInfos) { final Set methods =
(tapestry-5) 03/04: TAP5-2770: fixing JavaDoc errors
This is an automated email from the ASF dual-hosted git repository. thiagohp pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/tapestry-5.git commit 3e667bda1d5a912a4b6b59f20ab8c3617877ebd1 Author: Thiago H. de Paula Figueiredo AuthorDate: Wed Dec 20 21:42:51 2023 -0300 TAP5-2770: fixing JavaDoc errors --- .../tapestry5/plastic/FieldValueProvider.java | 2 +- .../org/apache/tapestry5/plastic/PlasticUtils.java | 29 - .../tapestry5/plastic/PropertyValueProvider.java | 8 +++--- .../apache/tapestry5/plastic/PlasticUtilsTest.java | 30 ++ 4 files changed, 46 insertions(+), 23 deletions(-) diff --git a/plastic/src/main/java/org/apache/tapestry5/plastic/FieldValueProvider.java b/plastic/src/main/java/org/apache/tapestry5/plastic/FieldValueProvider.java index 79087e8b8..c964530f5 100644 --- a/plastic/src/main/java/org/apache/tapestry5/plastic/FieldValueProvider.java +++ b/plastic/src/main/java/org/apache/tapestry5/plastic/FieldValueProvider.java @@ -19,7 +19,7 @@ package org.apache.tapestry5.plastic; * Interface that can be implemented to provide access to field values based on their name. * Usually implemented with {@linkplain PlasticUtils#implementFieldValueProvider(PlasticClass, java.util.Set)}, * which doesn't use reflection. - * + * * * The name of its abstract method is intended to avoid clashes with other existing methods * in the class. diff --git a/plastic/src/main/java/org/apache/tapestry5/plastic/PlasticUtils.java b/plastic/src/main/java/org/apache/tapestry5/plastic/PlasticUtils.java index 9c35d3428..e9d469c3b 100644 --- a/plastic/src/main/java/org/apache/tapestry5/plastic/PlasticUtils.java +++ b/plastic/src/main/java/org/apache/tapestry5/plastic/PlasticUtils.java @@ -39,10 +39,13 @@ public class PlasticUtils private static final MethodDescription PROPERTY_VALUE_PROVIDER_METHOD_DESCRIPTION; +private static final MethodDescription FIELD_VALUE_PROVIDER_METHOD_DESCRIPTION; + static { try { PROPERTY_VALUE_PROVIDER_METHOD_DESCRIPTION = new MethodDescription(PropertyValueProvider.class.getMethod("__propertyValueProvider__get", String.class)); +FIELD_VALUE_PROVIDER_METHOD_DESCRIPTION = new MethodDescription(FieldValueProvider.class.getMethod("__fieldValueProvider__get", String.class)); } catch (Exception e) { throw new ExceptionInInitializerError(e); } @@ -185,10 +188,10 @@ public class PlasticUtils * an {@linkplain IllegalAccessError}. * * @param plasticClass a {@linkplain PlasticClass} instance. - * @param fieldNames a {@linkplain Set} of {@linkplain String}s containing the field names. + * @param fieldInfos a {@linkplain Set} of {@linkplain String}s containing the field names. * @since 5.8.4 */ -public static void implementFieldValueProvider(PlasticClass plasticClass, Set fields) +public static void implementFieldValueProvider(PlasticClass plasticClass, Set fieldInfos) { final Set methods = plasticClass.introduceInterface(FieldValueProvider.class); @@ -199,7 +202,7 @@ public class PlasticUtils method.changeImplementation((builder) -> { -for (FieldInfo field : fields) +for (FieldInfo field : fieldInfos) { builder.loadArgument(0); builder.loadConstant(field.name); @@ -212,6 +215,18 @@ public class PlasticUtils }); } +builder.loadThis(); +builder.instanceOf(FieldValueProvider.class); + +builder.when(Condition.NON_ZERO, ifBuilder -> { +builder.loadThis(); +builder.loadArgument(0); +ifBuilder.invokeSpecial( +plasticClass.getSuperClassName(), +FIELD_VALUE_PROVIDER_METHOD_DESCRIPTION); +ifBuilder.returnResult(); +}); + builder.throwException(RuntimeException.class, "Field not found or not supported"); }); @@ -227,17 +242,17 @@ public class PlasticUtils * of direct fields access. * * @param plasticClass a {@linkplain PlasticClass} instance. - * @param fieldNames a {@linkplain Set} of {@linkplain String}s containing the filed (i.e. property) names. + * @param fieldInfos a {@linkplain Set} of {@linkplain String}s containing the filed (i.e. property) names. * @since 5.8.4 */ -public static void implementPropertyValueProvider(PlasticClass plasticClass, Set fields) +public static void implementPropertyValueProvider(PlasticClass plasticClass, Set fieldInfos) { final Set methods =