Skip to content

Commit f994343

Browse files
committed
glue ASM <-> GenASM, the only part of scala.tools.asm to maintain manually
1 parent df4df0a commit f994343

File tree

2 files changed

+67
-0
lines changed

2 files changed

+67
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/* NSC -- new Scala compiler
2+
* Copyright 2005-2012 LAMP/EPFL
3+
*/
4+
5+
package scala.tools.asm;
6+
7+
import scala.tools.asm.Attribute;
8+
9+
/**
10+
* A subclass of ASM's Attribute for the sole purpose of accessing a protected field there.
11+
*
12+
*/
13+
public class CustomAttr extends Attribute {
14+
15+
public CustomAttr(final String type, final byte[] value) {
16+
super(type);
17+
super.value = value;
18+
}
19+
20+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/* NSC -- new Scala compiler
2+
* Copyright 2005-2012 LAMP/EPFL
3+
*/
4+
5+
package scala.tools.asm.util;
6+
7+
import scala.tools.asm.util.CheckMethodAdapter;
8+
import scala.tools.asm.MethodVisitor;
9+
10+
/**
11+
* A subclass of ASM's CheckMethodAdapter for the sole purpose of accessing some protected methods there.
12+
*
13+
*/
14+
public class SignatureChecker extends CheckMethodAdapter {
15+
16+
public SignatureChecker(final MethodVisitor mv) {
17+
super(mv);
18+
}
19+
20+
/**
21+
* Checks a class signature.
22+
*
23+
* @param signature a string containing the signature that must be checked.
24+
*/
25+
public static void checkClassSignature(final String signature) {
26+
CheckMethodAdapter.checkClassSignature(signature);
27+
}
28+
29+
/**
30+
* Checks a method signature.
31+
*
32+
* @param signature a string containing the signature that must be checked.
33+
*/
34+
public static void checkMethodSignature(final String signature) {
35+
CheckMethodAdapter.checkMethodSignature(signature);
36+
}
37+
38+
/**
39+
* Checks a field signature.
40+
*
41+
* @param signature a string containing the signature that must be checked.
42+
*/
43+
public static void checkFieldSignature(final String signature) {
44+
CheckMethodAdapter.checkFieldSignature(signature);
45+
}
46+
47+
}

0 commit comments

Comments
 (0)