Skip to content

Commit efdd7ea

Browse files
committed
Introduced ExpInstanceOp as parent class of ExpObjOp and ExpInstanceConstructor
1 parent b4f80ea commit efdd7ea

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

use-core/src/main/java/org/tzi/use/parser/ocl/ASTOperationExpression.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,10 +629,10 @@ private Expression genObjOperation(Context ctx, MClassifier srcClassifier, Expre
629629
}
630630

631631
try {
632+
// constructor performs additional checks
632633
if (op.isConstructor()) {
633634
res = new ExpInstanceConstructor(op, fArgExprs);
634635
} else {
635-
// constructor performs additional checks
636636
res = new ExpObjOp(op, fArgExprs);
637637
}
638638
res.setSourcePosition(new SrcPos(fOp));

use-core/src/main/java/org/tzi/use/uml/ocl/expr/ExpInstanceConstructor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ public ExpInstanceConstructor(MOperation constructor, Expression[] args) throws
4545

4646
if (!(args[0].type().isTypeOfClass() || args[0].type().isTypeOfDataType()))
4747
throw new ExpInvalidException(
48-
"Target expression of constructor must have " +
48+
"Target expression of instance constructor must have " +
4949
"object type, found `" + args[0].type() + "'.");
5050

5151
// check for matching arguments
5252
VarDeclList params = fOp.paramList();
5353
if (params.size() != (args.length - 1) )
5454
throw new ExpInvalidException(
55-
"Number of arguments does not match declaration of constructor `" +
55+
"Number of arguments does not match declaration of instance constructor `" +
5656
fOp.name() + "'. Expected " + params.size() + " argument(s), found " +
5757
(args.length - 1) + ".");
5858

0 commit comments

Comments
 (0)