aboutsummaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorakuznetsov <akuznetsov@tradingview.com>2023-10-04 14:22:28 +0400
committerakuznetsov <akuznetsov@tradingview.com>2023-10-04 14:22:28 +0400
commit15d56cfb702000400ff7d888e6084da72530221e (patch)
treeba9a83625af43ec9ce0be18f49fcb01a148108df /src/test
parentd5a7881381080fa4953b24c069675ca435598b95 (diff)
downloadjavassist-15d56cfb702000400ff7d888e6084da72530221e.tar.gz
javassist-15d56cfb702000400ff7d888e6084da72530221e.zip
save line number count though all methods/ctors
Diffstat (limited to 'src/test')
-rw-r--r--src/test/javassist/bytecode/BytecodeTest.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/test/javassist/bytecode/BytecodeTest.java b/src/test/javassist/bytecode/BytecodeTest.java
index b7ab1f33..cc02801d 100644
--- a/src/test/javassist/bytecode/BytecodeTest.java
+++ b/src/test/javassist/bytecode/BytecodeTest.java
@@ -317,6 +317,31 @@ public class BytecodeTest extends TestCase {
fail("should not happen");
}
+ public void testLineNumberCompiler2() {
+ CtClass testClass = loader.makeClass("javassist.bytecode.LineNumberCompilerClass2");
+ String ctor = String.join("\n",
+ "public LineNumberCompilerClass2() {",
+ " super();",
+ "}");
+ String run = String.join("\n",
+ "public void run() {",
+ " return;",
+ "}");
+ String run2 = String.join("\n",
+ "public void run2() {",
+ " run()",
+ "}");
+ try {
+ testClass.addConstructor(CtNewConstructor.make(ctor, testClass));
+ testClass.addMethod(CtMethod.make(run, testClass));
+ testClass.addMethod(CtMethod.make(run2, testClass));
+ } catch (CannotCompileException e) {
+ assertEquals("line 9: ; is missing", e.getCause().getMessage());
+ return;
+ }
+ fail("should not happen");
+ }
+
public void testLineNumberException() {
CtClass testClass = loader.makeClass("javassist.bytecode.LineNumberExceptionClass");
String run = String.join("\n",