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 9f33841ae TAP5-2813: Hopefully last workaround (attempt #2)
9f33841ae is described below
commit 9f33841ae4f4d65d863deb847eb79283249f6f71
Author: Thiago H. de Paula Figueiredo <[email protected]>
AuthorDate: Sat Feb 21 18:29:38 2026 -0300
TAP5-2813: Hopefully last workaround (attempt #2)
---
justfile | 2 +-
.../internal/services/PageSourceImpl.java | 6 +++++
.../tapestry5/internal/transform/CachedWorker.java | 12 +++++++++-
.../PageClassLoaderContextManagerImpl.java | 4 ++++
.../META-INF/modules/t5/beanvalidator/.gitignore | 1 +
.../resources/META-INF/modules/t5/core/.gitignore | 1 +
.../src/main/typescript/package-lock.json | 13 ++++++-----
.../integration/app1/DogSelectionWizardStep.java | 27 ++++++++++++++++++++++
.../tapestry5/integration/app1/WizardStep.java | 11 +++++++++
.../app1/components/AnimalWizardStep.java | 19 +++++++++++++++
.../app1/components/DogSelectionStep.java | 15 ++++++++++++
.../app1/components/DogSelectionStep.tml | 7 ++++++
.../integration/app1/pages/CachedPage.tml | 4 ++++
13 files changed, 114 insertions(+), 8 deletions(-)
diff --git a/justfile b/justfile
index 21a1516e6..9f94a7125 100644
--- a/justfile
+++ b/justfile
@@ -1,4 +1,4 @@
-gradle-options := "--watch-fs"
+gradle-options := "--watch-fs --info"
# Print all recipes
default:
diff --git
a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PageSourceImpl.java
b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PageSourceImpl.java
index 9c326702d..f9a6b39ff 100644
---
a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PageSourceImpl.java
+++
b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PageSourceImpl.java
@@ -323,6 +323,12 @@ public class PageSourceImpl implements PageSource
abstractClassInfoCache.remove(className);
}
}
+
+ for (int i = 0; i < 5; i++)
+ {
+ System.gc();
+ }
+
}
return Collections.emptyList();
diff --git
a/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/CachedWorker.java
b/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/CachedWorker.java
index 32bf7e64b..54aaff574 100644
---
a/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/CachedWorker.java
+++
b/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/CachedWorker.java
@@ -302,6 +302,12 @@ public class CachedWorker implements
ComponentClassTransformWorker2
CHECKED_EXCEPTION_TYPES, new
JSONArray(description.checkedExceptionTypes),
WATCH, method.getAnnotation(Cached.class).watch());
}
+
+ private static final String OBJECT_SIGNATURE = "Ljava/lang/Object";
+
+ private static final String GENERIC_NON_LIST_METHOD_TYPE_PREFIX = "()T";
+
+ private static final String GENERIC_NON_LIST_METHOD_TYPE = "()" +
OBJECT_SIGNATURE + ";";
private static String getGenericSignature(String signature)
{
@@ -316,7 +322,7 @@ public class CachedWorker implements
ComponentClassTransformWorker2
{
if (types[i].startsWith("T"))
{
- types[i] = "Ljava/lang/Object";
+ types[i] = OBJECT_SIGNATURE;
changed = true;
}
}
@@ -326,6 +332,10 @@ public class CachedWorker implements
ComponentClassTransformWorker2
final String oldGenericTypeSignature =
signature.substring(startIndex, endIndex + 1);
signature = signature.replace(oldGenericTypeSignature,
newGenericTypeSignature);
}
+ } else {
+ if (signature.startsWith(GENERIC_NON_LIST_METHOD_TYPE_PREFIX)) {
+ signature = GENERIC_NON_LIST_METHOD_TYPE;
+ }
}
return signature;
}
diff --git
a/tapestry-core/src/main/java/org/apache/tapestry5/services/pageload/PageClassLoaderContextManagerImpl.java
b/tapestry-core/src/main/java/org/apache/tapestry5/services/pageload/PageClassLoaderContextManagerImpl.java
index 6b83ad044..ccb62240d 100644
---
a/tapestry-core/src/main/java/org/apache/tapestry5/services/pageload/PageClassLoaderContextManagerImpl.java
+++
b/tapestry-core/src/main/java/org/apache/tapestry5/services/pageload/PageClassLoaderContextManagerImpl.java
@@ -642,6 +642,10 @@ public class PageClassLoaderContextManagerImpl implements
PageClassLoaderContext
finally
{
componentDependencyRegistry.enableInvalidations();
+ for (int i = 0; i < 5; i++)
+ {
+ System.gc();
+ }
}
}
diff --git
a/tapestry-core/src/main/resources/META-INF/modules/t5/beanvalidator/.gitignore
b/tapestry-core/src/main/resources/META-INF/modules/t5/beanvalidator/.gitignore
new file mode 100644
index 000000000..48a4a701d
--- /dev/null
+++
b/tapestry-core/src/main/resources/META-INF/modules/t5/beanvalidator/.gitignore
@@ -0,0 +1 @@
+/*.d.ts
diff --git
a/tapestry-core/src/main/resources/META-INF/modules/t5/core/.gitignore
b/tapestry-core/src/main/resources/META-INF/modules/t5/core/.gitignore
new file mode 100644
index 000000000..48a4a701d
--- /dev/null
+++ b/tapestry-core/src/main/resources/META-INF/modules/t5/core/.gitignore
@@ -0,0 +1 @@
+/*.d.ts
diff --git a/tapestry-core/src/main/typescript/package-lock.json
b/tapestry-core/src/main/typescript/package-lock.json
index c4e13ab5a..de9f7e7ca 100644
--- a/tapestry-core/src/main/typescript/package-lock.json
+++ b/tapestry-core/src/main/typescript/package-lock.json
@@ -1,10 +1,12 @@
{
- "name": "tapestry-5",
+ "name": "@thiagohp/tapestry-5",
+ "version": "0.0.3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
- "name": "tapestry-5",
+ "name": "@thiagohp/tapestry-5",
+ "version": "0.0.3",
"license": "Apache-2.0",
"devDependencies": {
"@hpcc-js/wasm": "^2.22.4",
@@ -13,8 +15,7 @@
"moment": "^2.30.1",
"typedoc": "^0.28.1",
"typescript": "^5.0.0"
- },
- "version": "0.0.3"
+ }
},
"node_modules/@gerrit0/mini-shiki": {
"version": "3.2.2",
@@ -368,6 +369,7 @@
"resolved":
"https://registry.npmjs.org/typescript/-/typescript-5.8.2.tgz",
"integrity":
"sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==",
"dev": true,
+ "peer": true,
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
@@ -447,6 +449,5 @@
"node": ">=12"
}
}
- },
- "version": "0.0.3"
+ }
}
diff --git
a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/DogSelectionWizardStep.java
b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/DogSelectionWizardStep.java
new file mode 100644
index 000000000..75ed9f4e4
--- /dev/null
+++
b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/DogSelectionWizardStep.java
@@ -0,0 +1,27 @@
+package org.apache.tapestry5.integration.app1;
+
+public class DogSelectionWizardStep implements WizardStep
+{
+
+ @Override
+ public String getStepName()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public WizardStep getNextStep()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String getBlockName()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
diff --git
a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/WizardStep.java
b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/WizardStep.java
new file mode 100644
index 000000000..2b5d9c425
--- /dev/null
+++
b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/WizardStep.java
@@ -0,0 +1,11 @@
+package org.apache.tapestry5.integration.app1;
+
+
+public interface WizardStep
+{
+ String getStepName();
+
+ WizardStep getNextStep();
+
+ String getBlockName();
+}
diff --git
a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/components/AnimalWizardStep.java
b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/components/AnimalWizardStep.java
new file mode 100644
index 000000000..3d7f07a3b
--- /dev/null
+++
b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/components/AnimalWizardStep.java
@@ -0,0 +1,19 @@
+package org.apache.tapestry5.integration.app1.components;
+
+import org.apache.tapestry5.annotations.Cached;
+import org.apache.tapestry5.annotations.Parameter;
+import org.apache.tapestry5.integration.app1.WizardStep;
+
+public class AnimalWizardStep<T extends WizardStep>
+{
+
+ @Parameter
+ private WizardStep currentStep;
+
+ @Cached // This is what is causing the runtime error
+ public T getCurrentStep()
+ {
+ return (T) currentStep;
+ }
+
+}
diff --git
a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/components/DogSelectionStep.java
b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/components/DogSelectionStep.java
new file mode 100644
index 000000000..a80c46518
--- /dev/null
+++
b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/components/DogSelectionStep.java
@@ -0,0 +1,15 @@
+package org.apache.tapestry5.integration.app1.components;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.tapestry5.integration.app1.DogSelectionWizardStep;
+
+public class DogSelectionStep extends AnimalWizardStep<DogSelectionWizardStep>
+{
+
+ public List<String> getEmptyList()
+ {
+ return new ArrayList<>();
+ }
+}
diff --git
a/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/components/DogSelectionStep.tml
b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/components/DogSelectionStep.tml
new file mode 100644
index 000000000..8412970e6
--- /dev/null
+++
b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/components/DogSelectionStep.tml
@@ -0,0 +1,7 @@
+<div xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd"
+ xmlns:p="tapestry:parameter">
+ <p>
+ Empty list: ${emptyList}
+ Current step: ${currentStep}. Again: ${currentStep}.
+ </p>
+</div>
\ No newline at end of file
diff --git
a/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/CachedPage.tml
b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/CachedPage.tml
index 1da6fe1bd..de4817c31 100644
---
a/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/CachedPage.tml
+++
b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/CachedPage.tml
@@ -18,4 +18,8 @@
<t:atCachedSuperclass/>
</div>
+ <div>
+ <t:dogSelectionStep/>
+ </div>
+
</html>