You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2023/12/30 11:33:44 UTC
(groovy) branch master updated (31ebe71d84 -> 4ab2408134)
This is an automated email from the ASF dual-hosted git repository.
sunlan pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git
from 31ebe71d84 Tweak doc
new 4d82ac28b2 Load DGM classes concurrently
new 4ab2408134 Update verification metadata
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
gradle/verification-metadata.xml | 9 +++++++
.../groovy/reflection/GeneratedMetaMethod.java | 30 ++++++++++++----------
2 files changed, 26 insertions(+), 13 deletions(-)
(groovy) 02/02: Update verification metadata
Posted by su...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sunlan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git
commit 4ab2408134abf6b36fdd99ea774d93b5aed5e577
Author: Daniel Sun <su...@apache.org>
AuthorDate: Sat Dec 30 19:33:25 2023 +0800
Update verification metadata
---
gradle/verification-metadata.xml | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml
index 6f14e54099..862d882af0 100644
--- a/gradle/verification-metadata.xml
+++ b/gradle/verification-metadata.xml
@@ -220,6 +220,7 @@
</component>
<component group="com.github.stephenc.jcip" name="jcip-annotations" version="1.0-1">
<artifact name="jcip-annotations-1.0-1.jar">
+ <pgp value="042b29e928995b9db963c636c7ca19b7b620d787"/>
<sha512 value="02fcd16a30d0e68b3e9e4899731181c6abb7117baa15c096ca940e01dde08bb86101cbeae552c497f8a90d923b5fa2f2b6f3850baf8dc94dbd399887924a9069" origin="Generated by Gradle" reason="A key couldn't be downloaded"/>
</artifact>
</component>
@@ -751,6 +752,14 @@
<sha512 value="9e10e38117d3cadcdfb1ec4cd7bbb4abee1a8007912ef4c2295c119d393ef9893a0f8617e5bfcaa078dad1f6c231148a8420a77528ee54b30d15f35686a9d44e" origin="Generated by Gradle" reason="PGP signature verification failed!"/>
</artifact>
</component>
+ <component group="org.jfrog.buildinfo" name="build-info-extractor-gradle" version="5.1.13">
+ <artifact name="build-info-extractor-gradle-5.1.13.jar">
+ <ignored-keys>
+ <ignored-key id="49bc0306deb0ece16cdd09652ee4988c55528f25" reason="PGP verification failed"/>
+ </ignored-keys>
+ <sha512 value="f68c3c187715369496eac451df67e31129ae24ea0ce9c443a33e930670c86e3aee4f8360d424c3282cb049d400d7140fefa03c833c7720ac0df73be1b99563f9" origin="Generated by Gradle" reason="PGP signature verification failed!"/>
+ </artifact>
+ </component>
<component group="org.jfrog.filespecs" name="file-specs-java" version="1.1.2">
<artifact name="file-specs-java-1.1.2.jar">
<sha512 value="6516f8fa86867c261d8c1f6ebc26b7d6c3d59f14f820c6054afbb886653530c613a134e484bb999a00f82ade9b22dcab304e4a3df1496971e788b15c5054ae2a" origin="Generated by Gradle" reason="A key couldn't be downloaded"/>
(groovy) 01/02: Load DGM classes concurrently
Posted by su...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sunlan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git
commit 4d82ac28b200392738d6f6024289aade941dc297
Author: Daniel Sun <su...@apache.org>
AuthorDate: Sat Dec 30 19:05:08 2023 +0800
Load DGM classes concurrently
---
.../groovy/reflection/GeneratedMetaMethod.java | 30 ++++++++++++----------
1 file changed, 17 insertions(+), 13 deletions(-)
diff --git a/src/main/java/org/codehaus/groovy/reflection/GeneratedMetaMethod.java b/src/main/java/org/codehaus/groovy/reflection/GeneratedMetaMethod.java
index 2507139616..ce3a69aed5 100644
--- a/src/main/java/org/codehaus/groovy/reflection/GeneratedMetaMethod.java
+++ b/src/main/java/org/codehaus/groovy/reflection/GeneratedMetaMethod.java
@@ -35,6 +35,7 @@ import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
public abstract class GeneratedMetaMethod extends MetaMethod {
private final String name;
@@ -190,15 +191,16 @@ public abstract class GeneratedMetaMethod extends MetaMethod {
new BufferedInputStream(
loader.getResourceAsStream("META-INF/dgminfo")))) {
- Map<Integer, Class> classes = new HashMap<Integer, Class>();
+ final int initialCapacity = 2048;
+ Map<Integer, Class> classes = new ConcurrentHashMap<>(initialCapacity);
for (int i = 0; i < PRIMITIVE_CLASSES.length; i++) {
classes.put(i, PRIMITIVE_CLASSES[i]);
}
-
+ final Map<Integer, String> names = new HashMap<>(initialCapacity);
int skip = 0;
- for (; ; ) {
+ for (;;) {
String name = in.readUTF();
- if (name.length() == 0)
+ if (name.isEmpty())
break;
int key = in.readInt();
@@ -206,16 +208,17 @@ public abstract class GeneratedMetaMethod extends MetaMethod {
if (skip++ < PRIMITIVE_CLASSES.length)
continue;
- Class cls = null;
+ names.put(key, name);
+ }
+ names.entrySet().parallelStream().forEach(e -> {
try {
- cls = loader.loadClass(name);
- } catch (ClassNotFoundException e) {
+ Class<?> cls = loader.loadClass(e.getValue());
+ classes.put(e.getKey(), cls);
+ } catch (ClassNotFoundException ex) {
// under certain restrictive environments, loading certain classes may be forbidden
// and could yield a ClassNotFoundException (Google App Engine)
- continue;
}
- classes.put(key, cls);
- }
+ });
int size = in.readInt();
List<DgmMethodRecord> res = new ArrayList<DgmMethodRecord>(size);
@@ -232,10 +235,11 @@ public abstract class GeneratedMetaMethod extends MetaMethod {
int psize = in.readInt();
record.parameters = new Class[psize];
- for (int j = 0; j < record.parameters.length; j++) {
- record.parameters[j] = classes.get(in.readInt());
+ for (int j = 0, n = record.parameters.length; j < n; j++) {
+ final Class<?> cls = classes.get(in.readInt());
+ record.parameters[j] = cls;
- if (record.parameters[j] == null) {
+ if (cls == null) {
skipRecord = true;
}
}