Skip to content

Commit fce2f16

Browse files
committed
Merge branch 'hotfix-0.3.3' into master-0.3.x
2 parents 9a7b020 + f16ea72 commit fce2f16

File tree

4 files changed

+36
-5
lines changed

4 files changed

+36
-5
lines changed

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

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import org.cadixdev.bombe.analysis.InheritanceProvider;
3434
import org.cadixdev.bombe.asm.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-asm/src/main/java/org/cadixdev/bombe/asm/analysis/InheritanceClassInfoVisitor.java

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ subprojects {
77

88
group = 'org.cadixdev'
99
archivesBaseName = project.name.toLowerCase()
10-
version = '0.3.2'
10+
version = '0.3.3'
1111

1212
repositories {
1313
mavenCentral()

changelogs/0.3.3.md

Lines changed: 11 additions & 0 deletions
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*.

0 commit comments

Comments
 (0)