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
The following commit(s) were added to refs/heads/javax by this push: new e3e4944e5 TAP5-2786: fixing broken test e3e4944e5 is described below commit e3e4944e5675646bd6bb6a8e290977b88d63ef26 Author: Thiago H. de Paula Figueiredo <thi...@arsmachina.com.br> AuthorDate: Sat Aug 24 17:38:44 2024 -0300 TAP5-2786: fixing broken test --- .../tapestry5/internal/transform/PropertyWorker.java | 18 ++++++++++++++++-- .../org/apache/tapestry5/modules/TapestryModule.java | 2 +- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/PropertyWorker.java b/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/PropertyWorker.java index 05677467c..74327c626 100644 --- a/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/PropertyWorker.java +++ b/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/PropertyWorker.java @@ -1,4 +1,4 @@ -// Copyright 2008, 2010, 2011 The Apache Software Foundation +// Copyright 2008, 2010, 2011, 2024 The Apache Software Foundation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ package org.apache.tapestry5.internal.transform; +import org.apache.tapestry5.SymbolConstants; import org.apache.tapestry5.annotations.Property; +import org.apache.tapestry5.ioc.annotations.Symbol; import org.apache.tapestry5.model.MutableComponentModel; import org.apache.tapestry5.plastic.MethodAlreadyExistsException; import org.apache.tapestry5.plastic.PlasticClass; @@ -32,6 +34,14 @@ import org.apache.tapestry5.services.transform.TransformationSupport; */ public class PropertyWorker implements ComponentClassTransformWorker2 { + + final private boolean multipleClassloaders; + + public PropertyWorker(@Symbol(SymbolConstants.MULTIPLE_CLASSLOADERS) final boolean multipleClassloaders) + { + super(); + this.multipleClassloaders = multipleClassloaders; + } public void transform(PlasticClass plasticClass, TransformationSupport support, MutableComponentModel model) { @@ -44,7 +54,11 @@ public class PropertyWorker implements ComponentClassTransformWorker2 catch (MethodAlreadyExistsException e) { // Method was already created somewhere else, so - // nothing to do here + // nothing to do here + if (!multipleClassloaders) + { + throw e; + } } } } diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/modules/TapestryModule.java b/tapestry-core/src/main/java/org/apache/tapestry5/modules/TapestryModule.java index b5a2cf557..e3c47e86f 100644 --- a/tapestry-core/src/main/java/org/apache/tapestry5/modules/TapestryModule.java +++ b/tapestry-core/src/main/java/org/apache/tapestry5/modules/TapestryModule.java @@ -687,7 +687,7 @@ public final class TapestryModule @Symbol(SymbolConstants.PRODUCTION_MODE) boolean productionMode, @Symbol(SymbolConstants.MULTIPLE_CLASSLOADERS) boolean multipleClassloaders) { - configuration.add("Property", new PropertyWorker()); + configuration.add("Property", new PropertyWorker(multipleClassloaders)); // Order this one pretty early: