Skip to content

Commit 2be5f66

Browse files
committed
Add additional properties on class reader representation.
1 parent 25ef7d0 commit 2be5f66

File tree

2 files changed

+60
-3
lines changed

2 files changed

+60
-3
lines changed

byte-buddy-dep/src/main/java/net/bytebuddy/utility/AsmClassReader.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616
package net.bytebuddy.utility;
1717

18-
import jdk.internal.org.objectweb.asm.Opcodes;
1918
import net.bytebuddy.ClassFileVersion;
2019
import net.bytebuddy.build.AccessControllerPlugin;
2120
import net.bytebuddy.build.HashCodeAndEqualsPlugin;

byte-buddy-dep/src/main/java/net/bytebuddy/utility/AsmClassWriter.java

Lines changed: 60 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
import java.lang.reflect.Method;
3333
import java.security.PrivilegedAction;
34+
import java.util.List;
3435

3536
/**
3637
* A facade for creating a {@link ClassVisitor} that writes a class file.
@@ -257,18 +258,46 @@ protected enum EmptyAsmClassReader implements AsmClassReader {
257258
* {@inheritDoc}
258259
*/
259260
@AlwaysNull
260-
public <T> T unwrap(Class<T> type) {
261+
public AsmClassWriter toWriter(int flags, TypePool typePool) {
261262
return null;
262263
}
263264

264265
/**
265266
* {@inheritDoc}
266267
*/
267268
@AlwaysNull
268-
public AsmClassWriter toWriter(int flags, TypePool typePool) {
269+
public <T> T unwrap(Class<T> type) {
269270
return null;
270271
}
271272

273+
/**
274+
* {@inheritDoc}
275+
*/
276+
public int getModifiers() {
277+
throw new UnsupportedOperationException();
278+
}
279+
280+
/**
281+
* {@inheritDoc}
282+
*/
283+
public String getInternalName() {
284+
throw new UnsupportedOperationException();
285+
}
286+
287+
/**
288+
* {@inheritDoc}
289+
*/
290+
public String getSuperClassInternalName() {
291+
throw new UnsupportedOperationException();
292+
}
293+
294+
/**
295+
* {@inheritDoc}
296+
*/
297+
public List<String> getInterfaceInternalNames() {
298+
throw new UnsupportedOperationException();
299+
}
300+
272301
/**
273302
* {@inheritDoc}
274303
*/
@@ -312,6 +341,35 @@ public AsmClassWriter toWriter(int flags, TypePool typePool) {
312341
return null;
313342
}
314343

344+
/**
345+
* {@inheritDoc}
346+
*/
347+
public int getModifiers() {
348+
return delegate.getModifiers();
349+
}
350+
351+
/**
352+
* {@inheritDoc}
353+
*/
354+
public String getInternalName() {
355+
return delegate.getInternalName();
356+
}
357+
358+
/**
359+
* {@inheritDoc}
360+
*/
361+
@MaybeNull
362+
public String getSuperClassInternalName() {
363+
return delegate.getSuperClassInternalName();
364+
}
365+
366+
/**
367+
* {@inheritDoc}
368+
*/
369+
public List<String> getInterfaceInternalNames() {
370+
return delegate.getInterfaceInternalNames();
371+
}
372+
315373
/**
316374
* {@inheritDoc}
317375
*/

0 commit comments

Comments
 (0)