Skip to content

Commit 0c7bd12

Browse files
committed
Merge branch 'hotfix-0.4.2'
2 parents 709d4c6 + 714d145 commit 0c7bd12

File tree

5 files changed

+45
-5
lines changed

5 files changed

+45
-5
lines changed

bombe/src/main/java/org/cadixdev/bombe/analysis/asm/ClassProviderInheritanceProvider.java

+22-2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import org.cadixdev.bombe.analysis.InheritanceProvider;
3434
import org.cadixdev.bombe.jar.ClassProvider;
3535
import org.objectweb.asm.ClassReader;
36+
import org.objectweb.asm.Opcodes;
3637

3738
import java.util.Optional;
3839

@@ -45,19 +46,38 @@
4546
*/
4647
public class ClassProviderInheritanceProvider implements InheritanceProvider {
4748

49+
private final int api;
4850
private final ClassProvider provider;
4951

50-
public ClassProviderInheritanceProvider(final ClassProvider provider) {
52+
/**
53+
* Creates a new inheritance provider backed by a class provider.
54+
*
55+
* @param api The ASM API version to use
56+
* @param provider The class provider
57+
* @since 0.3.3
58+
*/
59+
public ClassProviderInheritanceProvider(final int api, final ClassProvider provider) {
60+
this.api = api;
5161
this.provider = provider;
5262
}
5363

64+
/**
65+
* Creates a new inheritance provider backed by a class provider, defaulting to
66+
* {@link Opcodes#ASM7}.
67+
*
68+
* @param provider The class provider
69+
*/
70+
public ClassProviderInheritanceProvider(final ClassProvider provider) {
71+
this(Opcodes.ASM7, provider);
72+
}
73+
5474
@Override
5575
public Optional<ClassInfo> provide(final String klass) {
5676
final byte[] classBytes = this.provider.get(klass);
5777
if (classBytes == null) return Optional.empty();
5878

5979
final ClassReader reader = new ClassReader(classBytes);
60-
final InheritanceClassInfoVisitor classInfoVisitor = new InheritanceClassInfoVisitor();
80+
final InheritanceClassInfoVisitor classInfoVisitor = new InheritanceClassInfoVisitor(this.api);
6181
reader.accept(classInfoVisitor, ClassReader.SKIP_CODE | ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES);
6282
return Optional.of(classInfoVisitor.create());
6383
}

bombe/src/main/java/org/cadixdev/bombe/analysis/asm/InheritanceClassInfoVisitor.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ class InheritanceClassInfoVisitor extends ClassVisitor {
5656
private final Map<String, InheritanceType> fieldsByName = new HashMap<>();
5757
private final Map<MethodSignature, InheritanceType> methods = new HashMap<>();
5858

59-
InheritanceClassInfoVisitor() {
60-
super(Opcodes.ASM6);
59+
InheritanceClassInfoVisitor(final int api) {
60+
super(api);
6161
}
6262

6363
InheritanceProvider.ClassInfo create() {

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ subprojects {
1616

1717
group = 'org.cadixdev'
1818
archivesBaseName = project.name.toLowerCase()
19-
version = '0.4.1'
19+
version = '0.4.2'
2020

2121
repositories {
2222
mavenCentral()

changelogs/0.3.3.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Bombe 0.3.3
2+
===========
3+
4+
Bombe 0.3.3 resolves an oversight when bumping to ASM 7, notably that our
5+
`ClassProviderInheritanceProvider` was still using `ASM6` - this has now been
6+
resolved to use `ASM7`, in addition to a new constructor to allow for
7+
third-parties to specify which ASM API version they wish to use.
8+
9+
*As Bombe 0.3.x is still in use by the latest version of Lorenz and Atlas, and
10+
used in software running today - this is why a further release to 0.3 is being
11+
made*.

changelogs/0.4.2.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Bombe 0.4.2
2+
===========
3+
4+
Bombe 0.4.2 resolves an oversight when bumping to ASM 7, notably that our
5+
`ClassProviderInheritanceProvider` was still using `ASM6` - this has now been
6+
resolved to use `ASM7`, in addition to a new constructor to allow for
7+
third-parties to specify which ASM API version they wish to use.
8+
9+
An equivalent change was made in Bombe 0.3.3.

0 commit comments

Comments
 (0)