Fix wrong generated module infos

This commit is contained in:
Marian Koncek 2022-09-02 11:26:10 +02:00
parent defa5f5301
commit 3f843be340
2 changed files with 35 additions and 1 deletions

View File

@ -0,0 +1,27 @@
From b4a0366b3c17fcc0d8187cffbcdd2e1bd61ab0fb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mari=C3=A1n=20Kon=C4=8Dek?= <marian.koncek@mailbox.org>
Date: Fri, 2 Sep 2022 09:41:23 +0200
Subject: [PATCH] Replace slash for dot in generated module infos
Forwarded: no
---
.../src/main/java/org/objectweb/asm/tools/Retrofitter.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/retrofitter/src/main/java/org/objectweb/asm/tools/Retrofitter.java b/tools/retrofitter/src/main/java/org/objectweb/asm/tools/Retrofitter.java
index b3d51e63..43002cea 100644
--- a/tools/retrofitter/src/main/java/org/objectweb/asm/tools/Retrofitter.java
+++ b/tools/retrofitter/src/main/java/org/objectweb/asm/tools/Retrofitter.java
@@ -187,7 +187,7 @@ public class Retrofitter {
throw new IllegalArgumentException("Module name can't be infered from classes");
}
ModuleVisitor moduleVisitor =
- classWriter.visitModule(moduleNames.get(0), Opcodes.ACC_OPEN, version);
+ classWriter.visitModule(moduleNames.get(0).replace('/', '.'), Opcodes.ACC_OPEN, version);
for (String importName : imports) {
if (isAsmModule(importName) && !exports.contains(importName)) {
--
2.37.2

View File

@ -2,7 +2,7 @@
Name: objectweb-asm
Version: 9.3
Release: 3%{?dist}
Release: 4%{?dist}
Summary: Java bytecode manipulation and analysis framework
License: BSD
URL: https://asm.ow2.org/
@ -29,6 +29,9 @@ Source10: tools-retrofitter.pom
# https://gitlab.ow2.org/asm/asm/-/commit/5921eb2a141f0dcc83c6a5d7dcd5035a30c5edfc
Patch1: 0001-Generate-the-module-info-classes-without-Bnd.-Delete.patch
# Attempted fix for: https://gitlab.ow2.org/asm/asm/-/issues/317983
Patch2: 0002-Replace-slash-for-dot-in-generated-module-infos.patch
%if %{with bootstrap}
BuildRequires: javapackages-bootstrap
%else
@ -58,6 +61,7 @@ This package provides %{summary}.
%setup -q
%patch1 -p1
%patch2 -p1
# A custom parent pom to aggregate the build
cp -p %{SOURCE1} pom.xml
@ -95,6 +99,9 @@ done
%license LICENSE.txt
%changelog
* Fri Sep 02 2022 Marian Koncek <mkoncek@redhat.com> - 9.3-4
- Fix wrong generated module infos
* Mon Aug 29 2022 Marian Koncek <mkoncek@redhat.com> - 9.3-3
- Generate module-info without bnd-plugin
- Resolves: rhbz#2106272