From 2681f31ca1a42c0baacd83aec59c9ec48b7169afa82c6593b9a27db1e8504e30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Fri, 3 May 2024 17:41:43 +0200 Subject: [PATCH] Sync from SUSE:SLFO:Main parboiled revision 23c15231289eee81c527ea58c1c7b641 --- .gitattributes | 23 +++ 1.4.1.tar.gz | 3 + parboiled-build.tar.xz | 3 + parboiled-core-1.4.1.pom | 47 ++++++ parboiled-java-1.4.1.pom | 72 ++++++++ parboiled-scala_2.13-1.4.1.pom | 57 +++++++ parboiled.changes | 76 +++++++++ parboiled.spec | 127 ++++++++++++++ restore-java8-compatibility.patch | 268 ++++++++++++++++++++++++++++++ 9 files changed, 676 insertions(+) create mode 100644 .gitattributes create mode 100644 1.4.1.tar.gz create mode 100644 parboiled-build.tar.xz create mode 100644 parboiled-core-1.4.1.pom create mode 100644 parboiled-java-1.4.1.pom create mode 100644 parboiled-scala_2.13-1.4.1.pom create mode 100644 parboiled.changes create mode 100644 parboiled.spec create mode 100644 restore-java8-compatibility.patch diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/1.4.1.tar.gz b/1.4.1.tar.gz new file mode 100644 index 0000000..6417806 --- /dev/null +++ b/1.4.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5f396cd6f51939efed94f37736440238a86291ed02bcd523aa97aa2eff8de1f2 +size 230536 diff --git a/parboiled-build.tar.xz b/parboiled-build.tar.xz new file mode 100644 index 0000000..e5629d3 --- /dev/null +++ b/parboiled-build.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f025ae37bf8ca2a94f5a59b975c1a3c5efee1ff6153fc68c4df4665ee7c1b08c +size 2832 diff --git a/parboiled-core-1.4.1.pom b/parboiled-core-1.4.1.pom new file mode 100644 index 0000000..0950ea8 --- /dev/null +++ b/parboiled-core-1.4.1.pom @@ -0,0 +1,47 @@ + + + 4.0.0 + org.parboiled + parboiled-core + jar + Elegant parsing in Java and Scala - lightweight, easy-to-use, powerful + http://parboiled.org + 1.4.1 + + + Apache 2 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + parboiled-core + 2009 + + org.parboiled + http://parboiled.org + + + git@github.com:sirthias/parboiled.git + scm:git:git@github.com:sirthias/parboiled.git + + + + sirthias + Mathias Doenitz + + + + + org.scalatestplus + testng-7-5_2.13 + 3.2.11.0 + test + + + org.scalatest + scalatest_2.13 + 3.2.11 + test + + + \ No newline at end of file diff --git a/parboiled-java-1.4.1.pom b/parboiled-java-1.4.1.pom new file mode 100644 index 0000000..e6f0d65 --- /dev/null +++ b/parboiled-java-1.4.1.pom @@ -0,0 +1,72 @@ + + + 4.0.0 + org.parboiled + parboiled-java + jar + Elegant parsing in Java and Scala - lightweight, easy-to-use, powerful + http://parboiled.org + 1.4.1 + + + Apache 2 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + parboiled-java + 2009 + + org.parboiled + http://parboiled.org + + + git@github.com:sirthias/parboiled.git + scm:git:git@github.com:sirthias/parboiled.git + + + + sirthias + Mathias Doenitz + + + + + org.parboiled + parboiled-core + 1.4.1 + + + org.scalatestplus + testng-7-5_2.13 + 3.2.11.0 + test + + + org.scalatest + scalatest_2.13 + 3.2.11 + test + + + org.ow2.asm + asm + 9.2 + + + org.ow2.asm + asm-tree + 9.2 + + + org.ow2.asm + asm-analysis + 9.2 + + + org.ow2.asm + asm-util + 9.2 + + + \ No newline at end of file diff --git a/parboiled-scala_2.13-1.4.1.pom b/parboiled-scala_2.13-1.4.1.pom new file mode 100644 index 0000000..5d0222a --- /dev/null +++ b/parboiled-scala_2.13-1.4.1.pom @@ -0,0 +1,57 @@ + + + 4.0.0 + org.parboiled + parboiled-scala_2.13 + jar + Elegant parsing in Java and Scala - lightweight, easy-to-use, powerful + http://parboiled.org + 1.4.1 + + + Apache 2 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + parboiled-scala + 2009 + + org.parboiled + http://parboiled.org + + + git@github.com:sirthias/parboiled.git + scm:git:git@github.com:sirthias/parboiled.git + + + + sirthias + Mathias Doenitz + + + + + org.scala-lang + scala-library + 2.13.8 + + + org.parboiled + parboiled-core + 1.4.1 + + + org.scalatestplus + testng-7-5_2.13 + 3.2.11.0 + test + + + org.scalatest + scalatest_2.13 + 3.2.11 + test + + + \ No newline at end of file diff --git a/parboiled.changes b/parboiled.changes new file mode 100644 index 0000000..97432ea --- /dev/null +++ b/parboiled.changes @@ -0,0 +1,76 @@ +------------------------------------------------------------------- +Thu Feb 15 14:23:14 UTC 2024 - Fridrich Strba + +- Remove the _multibuild file in order not to build unnecessary + parboiled:scala flavour + +------------------------------------------------------------------- +Fri Oct 6 11:26:05 UTC 2023 - Fridrich Strba + +- Upgrade to upstream version 1.4.1 + * Changes of 1.4.1 + + Improved support for Java 16+ + + Dropped support for Java 8 + * Changes of 1.4.0 + + Support Java 17 + + Upgraded to ASM 9.2 + + Dropped support for Scala 2.11 + * Changes of 1.3.1 + + Upgraded to ASM 7.1 + + Fixed class loader in parser generation + + Added cross-build for Scala 2.13.0 + + Dropped support for Scala 2.10 + * Changes of 1.3.0 + + Upgraded to ASM 7.0 + + Added Scala 2.13.0-M5 build + * Changes of 1.2.0 + + Added support for '~~>' and friends in ReductionRules + + Added support for PushRules to chain after ReductionRules + + Upgraded to ASM 6.2.1 + + Added Scala 2.13.0-M4 build + + Dropped support for Java 1.5 + * Changes of 1.1.8 + + Cross build for Scala 2.10, 2.11 and 2.12 + + Upgrade to ASM 5.2 + + Fixed "Utils.findConstructor doesn't match boolean parameter" + + Added method for clearing class cache in AsmUtil + * Changes of 1.1.7 + + Upgrade to Scala 2.11.4, cross build for Scala 2.9.2, 2.9.3, + 2.10 and 2.11 + + Upgrade to ASM 5.0.3, closed #76 + + Make parboiled-java relocatable, closed #80 +- Added patch: + * restore-java8-compatibility.patch + + revert upstream commit making changes incompatible with + Java 8 +- Removed patch: + * parboiled-port-to-objectweb-asm-5.0.1.patch + + not needed with this version + +------------------------------------------------------------------- +Sun Mar 20 15:24:52 UTC 2022 - Fridrich Strba + +- Build with source and target levels 1.8 + +------------------------------------------------------------------- +Mon Dec 2 07:30:47 UTC 2019 - Fridrich Strba + +- Require scala >= 2.10.7 for build: allows buiding with jdk9+ + +------------------------------------------------------------------- +Wed Nov 27 06:37:29 UTC 2019 - Fridrich Strba + +- Split the scala subpackage from the main parboiled package in + order to split build dependencies: build them as _multibuild + package + +------------------------------------------------------------------- +Tue Apr 9 08:17:03 UTC 2019 - Jan Engelhardt + +- Ensure neutrality of description. + +------------------------------------------------------------------- +Wed Apr 3 09:09:39 UTC 2019 - Fridrich Strba + +- Initial packaging of parboiled 1.1.6 +- Generate and customize ant build files diff --git a/parboiled.spec b/parboiled.spec new file mode 100644 index 0000000..42602e9 --- /dev/null +++ b/parboiled.spec @@ -0,0 +1,127 @@ +# +# spec file +# +# Copyright (c) 2023 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%global flavor @BUILD_FLAVOR@%{nil} +%if "%{flavor}" == "scala" +%bcond_without scala +%else +%bcond_with scala +%endif +%global scala_short_version 2.13 +%global base_name parboiled +%if %{with scala} +Name: %{base_name}-scala +Summary: Parboiled for Scala +%else +Name: %{base_name} +Summary: Java library providing parsing of input text based on PEGs +%endif +Version: 1.4.1 +Release: 0 +License: Apache-2.0 +Group: Development/Libraries/Java +URL: http://parboiled.org/ +Source0: https://github.com/sirthias/parboiled/archive/%{version}.tar.gz +Source1: %{base_name}-build.tar.xz +# for build see https://github.com/sirthias/parboiled/wiki/Building-parboiled +Source2: https://repo1.maven.org/maven2/org/parboiled/%{base_name}-core/%{version}/%{base_name}-core-%{version}.pom +Source3: https://repo1.maven.org/maven2/org/parboiled/%{base_name}-java/%{version}/%{base_name}-java-%{version}.pom +Source4: https://repo1.maven.org/maven2/org/parboiled/%{base_name}-scala_%{scala_short_version}/%{version}/%{base_name}-scala_%{scala_short_version}-%{version}.pom +Patch0: restore-java8-compatibility.patch +BuildRequires: ant +BuildRequires: fdupes +BuildRequires: java-devel >= 1.8 +BuildRequires: javapackages-local >= 6 +%if %{with scala} +BuildRequires: parboiled +BuildRequires: scala-ant +%else +BuildRequires: objectweb-asm +%endif +BuildArch: noarch + +%description +%if %{with scala} +An internal Scala DSL for efficiently defining your parser rules. + +%endif +parboiled is a mixed Java library providing parsing of +arbitrary input text based on Parsing expression grammars (PEGs). +PEGs are an alternative to context free grammars (CFGs) for formally +specifying syntax, they make a replacement for regular expressions +and generally have some advantages over the "traditional" way of +building parser via CFGs. + +%package javadoc +Summary: Javadoc for %{name} +Group: Documentation/HTML + +%description javadoc +This package contains javadoc for %{base_name}. + +%prep +%setup -q -n %{base_name}-%{version} -a1 +%patch0 -p1 + +cp %{SOURCE2} %{base_name}-core/pom.xml +cp %{SOURCE3} %{base_name}-java/pom.xml +cp %{SOURCE4} %{base_name}-scala/pom.xml + +%build +mkdir -p lib +build-jar-repository -s lib \ +%if %{with scala} + %{base_name} scala +%else + objectweb-asm +%endif +%{ant} \ +%if %{with scala} + -f build-scala.xml \ +%endif + package javadoc + +%install +%if %{with scala} +%global modules scala +%else +%global modules core java +%endif +install -dm 0755 %{buildroot}%{_javadir}/%{base_name} +install -dm 0755 %{buildroot}%{_mavenpomdir}/%{base_name} +for i in %{modules}; do + # jar + install -pm 0644 %{base_name}-${i}/target/%{base_name}-${i}*%{version}.jar %{buildroot}%{_javadir}/%{base_name}/${i}.jar + # pom + %{mvn_install_pom} %{base_name}-${i}/pom.xml %{buildroot}%{_mavenpomdir}/%{base_name}/${i}.pom + %add_maven_depmap %{base_name}/${i}.pom %{base_name}/${i}.jar + # javadoc + install -dm 0755 %{buildroot}%{_javadocdir}/%{base_name}/${i} + cp -pr %{base_name}-${i}/target/site/apidocs/* %{buildroot}%{_javadocdir}/%{base_name}/${i}/ +done +%fdupes -s %{buildroot}%{_javadocdir} + +%files -f .mfiles +%doc CHANGELOG README.markdown +%license LICENSE + +%files javadoc +%license LICENSE +%{_javadocdir}/%{base_name} + +%changelog diff --git a/restore-java8-compatibility.patch b/restore-java8-compatibility.patch new file mode 100644 index 0000000..cd239e8 --- /dev/null +++ b/restore-java8-compatibility.patch @@ -0,0 +1,268 @@ +--- parboiled-1.4.1/parboiled-java/src/main/java/org/parboiled/transform/AsmUtils.java 2023-10-11 09:54:38.742121727 +0200 ++++ parboiled-1.4.1/parboiled-java/src/main/java/org/parboiled/transform/AsmUtils.java 2023-10-11 09:54:51.432202375 +0200 +@@ -35,7 +35,6 @@ + + import java.io.IOException; + import java.io.InputStream; +-import java.lang.invoke.MethodHandles; + import java.lang.reflect.Array; + import java.lang.reflect.Constructor; + import java.lang.reflect.Field; +@@ -47,8 +46,6 @@ + + class AsmUtils { + +- private static final LookupFactory lookupFactory = new LookupFactory(); +- + public static ClassReader createClassReader(Class clazz) throws IOException { + checkArgNotNull(clazz, "clazz"); + String classFilename = clazz.getName().replace('.', '/') + ".class"; +@@ -199,17 +196,22 @@ + * Otherwise the method returns null. + * + * @param className the full name of the class to be loaded +- * @param parentClass the parent class of the class with the given className ++ * @param classLoader the class loader to use + * @return the class instance or null + */ +- public static Class loadClass(String className, Class parentClass) { ++ public static Class findLoadedClass(String className, ClassLoader classLoader) { + checkArgNotNull(className, "className"); +- checkArgNotNull(parentClass, "parentClass"); ++ checkArgNotNull(classLoader, "classLoader"); + try { ++ Class classLoaderBaseClass = Class.forName("java.lang.ClassLoader"); ++ Method findLoadedClassMethod = classLoaderBaseClass.getDeclaredMethod("findLoadedClass", String.class); ++ ++ // protected method invocation ++ findLoadedClassMethod.setAccessible(true); + try { +- return parentClass.getClassLoader().loadClass(className); +- } catch (ClassNotFoundException cnfe) { +- return null; ++ return (Class) findLoadedClassMethod.invoke(classLoader, className); ++ } finally { ++ findLoadedClassMethod.setAccessible(false); + } + } catch (Exception e) { + throw new RuntimeException("Could not determine whether class '" + className + +@@ -218,30 +220,22 @@ + } + + /** +- * Defines a new class with the given name and bytecode within the package of the given parent class. +- * Since package and class identity includes the ClassLoader instance used to load a class we use reflection ++ * Loads the class defined with the given name and bytecode using the given class loader. ++ * Since package and class idendity includes the ClassLoader instance used to load a class we use reflection + * on the given class loader to define generated classes. If we used our own class loader (in order to be able + * to access the protected "defineClass" method) we would likely still be able to load generated classes, + * however, they would not have access to package-private classes and members of their super classes. + * + * @param className the full name of the class to be loaded + * @param code the bytecode of the class to load +- * @param parentClass the parent class of the new class ++ * @param classLoader the class loader to use + * @return the class instance + */ +- public static Class defineClass(String className, byte[] code, Class parentClass) { ++ public static Class loadClass(String className, byte[] code, ClassLoader classLoader) { + checkArgNotNull(className, "className"); + checkArgNotNull(code, "code"); +- checkArgNotNull(parentClass, "parentClass"); +- ++ checkArgNotNull(classLoader, "classLoader"); + try { +- if (lookupFactory != null) { +- MethodHandles.Lookup lookup = lookupFactory.lookupFor(parentClass); +- if (lookup != null) { +- return lookup.defineClass(code); +- } +- } +- + Class classLoaderBaseClass = Class.forName("java.lang.ClassLoader"); + Method defineClassMethod = classLoaderBaseClass.getDeclaredMethod("defineClass", + String.class, byte[].class, int.class, int.class); +@@ -249,7 +243,7 @@ + // protected method invocation + defineClassMethod.setAccessible(true); + try { +- return (Class) defineClassMethod.invoke(parentClass.getClassLoader(), className, code, 0, code.length); ++ return (Class) defineClassMethod.invoke(classLoader, className, code, 0, code.length); + } finally { + defineClassMethod.setAccessible(false); + } +--- parboiled-1.4.1/parboiled-java/src/main/java/org/parboiled/transform/GroupClassGenerator.java 2023-10-11 09:54:38.758788500 +0200 ++++ parboiled-1.4.1/parboiled-java/src/main/java/org/parboiled/transform/GroupClassGenerator.java 2023-10-11 09:58:14.413389233 +0200 +@@ -23,7 +23,8 @@ + import org.objectweb.asm.tree.*; + + import static org.objectweb.asm.Opcodes.*; +-import static org.parboiled.transform.AsmUtils.defineClass; ++import static org.parboiled.transform.AsmUtils.findLoadedClass; ++import static org.parboiled.transform.AsmUtils.loadClass; + + abstract class GroupClassGenerator implements RuleMethodProcessor { + +@@ -53,15 +54,16 @@ + private void loadGroupClass(InstructionGroup group) { + createGroupClassType(group); + String className = group.getGroupClassType().getClassName(); ++ ClassLoader classLoader = classNode.getParentClass().getClassLoader(); + + Class groupClass; + synchronized (lock) { +- groupClass = AsmUtils.loadClass(className, classNode.getParentClass()); ++ groupClass = findLoadedClass(className, classLoader); + if (groupClass == null || forceCodeBuilding) { + byte[] groupClassCode = generateGroupClassCode(group); + group.setGroupClassCode(groupClassCode); + if (groupClass == null) { +- AsmUtils.defineClass(className, groupClassCode, classNode.getParentClass()); ++ loadClass(className, groupClassCode, classLoader); + } + } + } +@@ -71,7 +73,7 @@ + String s = classNode.name; + int lastSlash = classNode.name.lastIndexOf('/'); + // do not prepend a slash if class is in the default package (lastSlash == -1) +- String groupClassInternalName = (lastSlash >= 0 ? s.substring(0, lastSlash) + '/' : "") + group.getName(); ++ String groupClassInternalName = (lastSlash >= 0 ? s.substring(0, lastSlash) : s)+ '/' + group.getName(); + group.setGroupClassType(Type.getObjectType(groupClassInternalName)); + } + +--- parboiled-1.4.1/parboiled-java/src/main/java/org/parboiled/transform/LookupFactory.java 2023-10-11 09:54:38.758788500 +0200 ++++ parboiled-1.4.1/parboiled-java/src/main/java/org/parboiled/transform/LookupFactory.java 1970-01-01 01:00:00.000000000 +0100 +@@ -1,105 +0,0 @@ +-/* +- * Copyright (C) 2022 parboiled contributors +- * +- * Licensed under the Apache License, Version 2.0 (the "License"); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an "AS IS" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- */ +- +-package org.parboiled.transform; +- +-import java.lang.invoke.MethodHandles.Lookup; +-import java.lang.reflect.Field; +-import java.lang.reflect.Method; +-import java.util.WeakHashMap; +- +-/** +- * Helper that can be used to create {@link Lookup} instances for +- * specific classes. +- */ +-final class LookupFactory { +- +- private WeakHashMap, Lookup> lookups = new WeakHashMap<>(); +- private Lookup trustedLookup; +- +- LookupFactory() { +- loadTrustedLookup(); +- } +- +- /** +- * Tries to load a trusted {@link Lookup} instance. +- * +- *

+- * Adapted from HiddenClassDefiner +- * of Google Guice. +- *

+- */ +- private void loadTrustedLookup() { +- try { +- Class unsafeType = Class.forName("sun.misc.Unsafe"); +- Field theUnsafeField = unsafeType.getDeclaredField("theUnsafe"); +- theUnsafeField.setAccessible(true); +- Object unsafeInstance = theUnsafeField.get(null); +- Field trustedLookupField = Lookup.class.getDeclaredField("IMPL_LOOKUP"); +- Method baseMethod = unsafeType.getMethod("staticFieldBase", Field.class); +- Object trustedLookupBase = baseMethod.invoke(unsafeInstance, trustedLookupField); +- Method offsetMethod = unsafeType.getMethod("staticFieldOffset", Field.class); +- Object trustedLookupOffset = offsetMethod.invoke(unsafeInstance, trustedLookupField); +- Method getObjectMethod = unsafeType.getMethod("getObject", Object.class, long.class); +- this.trustedLookup = +- (Lookup) getObjectMethod.invoke(unsafeInstance, trustedLookupBase, trustedLookupOffset); +- } catch (Exception e) { +- // Unsafe and trusted lookup is not available +- } +- } +- +- /** +- * Determines a {@link Lookup} instance for the given hostClass. +- *

+- * The method first tries to use a static method of the hostClass with the +- * following signature: +- *

+- *

+- * +- * public static {@link Lookup} lookup(); +- * +- *

+- *

+- * If this fails then it tries to use a trusted lookup +- * instance created via sun.misc.Unsafe. +- *

+- * +- * @param hostClass The target class of the lookup instance +- * @return a lookup instance or null if not found +- */ +- Lookup lookupFor(Class hostClass) { +- Lookup lookup = lookups.get(hostClass); +- if (lookup == null) { +- try { +- // try to find a lookup() method first +- Method lookupMethod = hostClass.getMethod("lookup"); +- lookup = (Lookup) lookupMethod.invoke(null); +- } catch (Exception e) { +- // failed to use lookup() method +- } +- +- if (lookup == null && trustedLookup != null) { +- // use trusted lookup instance if available +- lookup = trustedLookup.in(hostClass); +- } +- +- if (lookup != null) { +- lookups.put(hostClass, lookup); +- } +- } +- return lookup; +- } +-} +\ No newline at end of file +--- parboiled-1.4.1/parboiled-java/src/main/java/org/parboiled/transform/ParserTransformer.java 2023-10-11 09:54:38.758788500 +0200 ++++ parboiled-1.4.1/parboiled-java/src/main/java/org/parboiled/transform/ParserTransformer.java 2023-10-11 09:55:09.205648662 +0200 +@@ -32,8 +32,8 @@ + public static synchronized Class transformParser(Class parserClass) throws Exception { + checkArgNotNull(parserClass, "parserClass"); + // first check whether we did not already create and load the extension of the given parser class +- Class extendedClass = AsmUtils.loadClass( +- getExtendedParserClassName(parserClass.getName()), parserClass ++ Class extendedClass = findLoadedClass( ++ getExtendedParserClassName(parserClass.getName()), parserClass.getClassLoader() + ); + return (Class) + (extendedClass != null ? extendedClass : extendParserClass(parserClass).getExtendedClass()); +@@ -102,10 +102,10 @@ + }; + classNode.accept(classWriter); + classNode.setClassCode(classWriter.toByteArray()); +- classNode.setExtendedClass(defineClass( ++ classNode.setExtendedClass(loadClass( + classNode.name.replace('/', '.'), + classNode.getClassCode(), +- classNode.getParentClass() ++ classNode.getParentClass().getClassLoader() + )); + } +