aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/javassist/expr
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/javassist/expr')
-rw-r--r--src/main/javassist/expr/Cast.java10
-rw-r--r--src/main/javassist/expr/FieldAccess.java20
-rw-r--r--src/main/javassist/expr/Instanceof.java10
-rw-r--r--src/main/javassist/expr/NewArray.java10
-rw-r--r--src/main/javassist/expr/NewExpr.java10
5 files changed, 30 insertions, 30 deletions
diff --git a/src/main/javassist/expr/Cast.java b/src/main/javassist/expr/Cast.java
index 31522e5a..29f91f3e 100644
--- a/src/main/javassist/expr/Cast.java
+++ b/src/main/javassist/expr/Cast.java
@@ -163,26 +163,26 @@ public class Cast extends Expr {
}
@Override
- public void doit(JvstCodeGen gen, Bytecode bytecode, ASTList args)
+ public void doit(JvstCodeGen gen, Bytecode bytecode, ASTList args, int lineNumber)
throws CompileError
{
if (gen.getMethodArgsLength(args) != 1)
throw new CompileError(Javac.proceedName
+ "() cannot take more than one parameter "
- + "for cast");
+ + "for cast", lineNumber);
gen.atMethodArgs(args, new int[1], new int[1], new String[1]);
bytecode.addOpcode(Opcode.CHECKCAST);
bytecode.addIndex(index);
- gen.setType(retType);
+ gen.setType(retType, lineNumber);
}
@Override
- public void setReturnType(JvstTypeChecker c, ASTList args)
+ public void setReturnType(JvstTypeChecker c, ASTList args, int lineNumber)
throws CompileError
{
c.atMethodArgs(args, new int[1], new int[1], new String[1]);
- c.setType(retType);
+ c.setType(retType, lineNumber);
}
}
}
diff --git a/src/main/javassist/expr/FieldAccess.java b/src/main/javassist/expr/FieldAccess.java
index 335314a5..9075e5fa 100644
--- a/src/main/javassist/expr/FieldAccess.java
+++ b/src/main/javassist/expr/FieldAccess.java
@@ -259,12 +259,12 @@ public class FieldAccess extends Expr {
}
@Override
- public void doit(JvstCodeGen gen, Bytecode bytecode, ASTList args)
+ public void doit(JvstCodeGen gen, Bytecode bytecode, ASTList args, int lineNumber)
throws CompileError
{
if (args != null && !gen.isParamListName(args))
throw new CompileError(Javac.proceedName
- + "() cannot take a parameter for field reading");
+ + "() cannot take a parameter for field reading", lineNumber);
int stack;
if (isStatic(opcode))
@@ -282,14 +282,14 @@ public class FieldAccess extends Expr {
bytecode.add(opcode);
bytecode.addIndex(index);
bytecode.growStack(stack);
- gen.setType(fieldType);
+ gen.setType(fieldType, lineNumber);
}
@Override
- public void setReturnType(JvstTypeChecker c, ASTList args)
+ public void setReturnType(JvstTypeChecker c, ASTList args, int lineNumber)
throws CompileError
{
- c.setType(fieldType);
+ c.setType(fieldType, lineNumber);
}
}
@@ -309,13 +309,13 @@ public class FieldAccess extends Expr {
}
@Override
- public void doit(JvstCodeGen gen, Bytecode bytecode, ASTList args)
+ public void doit(JvstCodeGen gen, Bytecode bytecode, ASTList args, int lineNumber)
throws CompileError
{
if (gen.getMethodArgsLength(args) != 1)
throw new CompileError(Javac.proceedName
+ "() cannot take more than one parameter "
- + "for field writing");
+ + "for field writing", lineNumber);
int stack;
if (isStatic(opcode))
@@ -335,16 +335,16 @@ public class FieldAccess extends Expr {
bytecode.add(opcode);
bytecode.addIndex(index);
bytecode.growStack(stack);
- gen.setType(CtClass.voidType);
+ gen.setType(CtClass.voidType, lineNumber);
gen.addNullIfVoid();
}
@Override
- public void setReturnType(JvstTypeChecker c, ASTList args)
+ public void setReturnType(JvstTypeChecker c, ASTList args, int lineNumber)
throws CompileError
{
c.atMethodArgs(args, new int[1], new int[1], new String[1]);
- c.setType(CtClass.voidType);
+ c.setType(CtClass.voidType, lineNumber);
c.addNullIfVoid();
}
}
diff --git a/src/main/javassist/expr/Instanceof.java b/src/main/javassist/expr/Instanceof.java
index a046ddbc..e56a3819 100644
--- a/src/main/javassist/expr/Instanceof.java
+++ b/src/main/javassist/expr/Instanceof.java
@@ -167,26 +167,26 @@ public class Instanceof extends Expr {
}
@Override
- public void doit(JvstCodeGen gen, Bytecode bytecode, ASTList args)
+ public void doit(JvstCodeGen gen, Bytecode bytecode, ASTList args, int lineNumber)
throws CompileError
{
if (gen.getMethodArgsLength(args) != 1)
throw new CompileError(Javac.proceedName
+ "() cannot take more than one parameter "
- + "for instanceof");
+ + "for instanceof", lineNumber);
gen.atMethodArgs(args, new int[1], new int[1], new String[1]);
bytecode.addOpcode(Opcode.INSTANCEOF);
bytecode.addIndex(index);
- gen.setType(CtClass.booleanType);
+ gen.setType(CtClass.booleanType, lineNumber);
}
@Override
- public void setReturnType(JvstTypeChecker c, ASTList args)
+ public void setReturnType(JvstTypeChecker c, ASTList args, int lineNumber)
throws CompileError
{
c.atMethodArgs(args, new int[1], new int[1], new String[1]);
- c.setType(CtClass.booleanType);
+ c.setType(CtClass.booleanType, lineNumber);
}
}
}
diff --git a/src/main/javassist/expr/NewArray.java b/src/main/javassist/expr/NewArray.java
index df30e26f..33dc417f 100644
--- a/src/main/javassist/expr/NewArray.java
+++ b/src/main/javassist/expr/NewArray.java
@@ -270,13 +270,13 @@ public class NewArray extends Expr {
}
@Override
- public void doit(JvstCodeGen gen, Bytecode bytecode, ASTList args)
+ public void doit(JvstCodeGen gen, Bytecode bytecode, ASTList args, int lineNumber)
throws CompileError
{
int num = gen.getMethodArgsLength(args);
if (num != dimension)
throw new CompileError(Javac.proceedName
- + "() with a wrong number of parameters");
+ + "() with a wrong number of parameters", lineNumber);
gen.atMethodArgs(args, new int[num],
new int[num], new String[num]);
@@ -291,14 +291,14 @@ public class NewArray extends Expr {
bytecode.growStack(1 - dimension);
}
- gen.setType(arrayType);
+ gen.setType(arrayType, lineNumber);
}
@Override
- public void setReturnType(JvstTypeChecker c, ASTList args)
+ public void setReturnType(JvstTypeChecker c, ASTList args, int lineNumber)
throws CompileError
{
- c.setType(arrayType);
+ c.setType(arrayType, lineNumber);
}
}
}
diff --git a/src/main/javassist/expr/NewExpr.java b/src/main/javassist/expr/NewExpr.java
index ee065167..e45a4c54 100644
--- a/src/main/javassist/expr/NewExpr.java
+++ b/src/main/javassist/expr/NewExpr.java
@@ -263,7 +263,7 @@ public class NewExpr extends Expr {
}
@Override
- public void doit(JvstCodeGen gen, Bytecode bytecode, ASTList args)
+ public void doit(JvstCodeGen gen, Bytecode bytecode, ASTList args, int lineNumber)
throws CompileError
{
bytecode.addOpcode(NEW);
@@ -271,15 +271,15 @@ public class NewExpr extends Expr {
bytecode.addOpcode(DUP);
gen.atMethodCallCore(newType, MethodInfo.nameInit, args,
false, true, -1, null);
- gen.setType(newType);
+ gen.setType(newType, lineNumber);
}
@Override
- public void setReturnType(JvstTypeChecker c, ASTList args)
+ public void setReturnType(JvstTypeChecker c, ASTList args, int lineNumber)
throws CompileError
{
- c.atMethodCallCore(newType, MethodInfo.nameInit, args);
- c.setType(newType);
+ c.atMethodCallCore(newType, MethodInfo.nameInit, args, lineNumber);
+ c.setType(newType, lineNumber);
}
}
}