Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

review: fix: Use wildcard type in CtUnaryOperator get/setOperand #5399

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1399,7 +1399,7 @@ public <T> void visitCtUnaryOperator(CtUnaryOperator<T> operator)
case PREINC:
case POSTDEC:
case PREDEC:
CtExpression<T> operand = operator.getOperand();
CtExpression<?> operand = operator.getOperand();
Expr prevExpr;
if (operand instanceof CtArrayWrite)
{
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/spoon/reflect/code/CtUnaryOperator.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ public interface CtUnaryOperator<T> extends CtExpression<T>, CtStatement {
* Gets the expression to which the operator is applied.
*/
@PropertyGetter(role = EXPRESSION)
CtExpression<T> getOperand();
CtExpression<?> getOperand();

/**
* Sets the expression to which the operator is applied.
*/
@PropertySetter(role = EXPRESSION)
<C extends CtUnaryOperator> C setOperand(CtExpression<T> expression);
<C extends CtUnaryOperator> C setOperand(CtExpression<?> expression);

/**
* Sets the kind of this operator.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ public class CtUnaryOperatorImpl<T> extends CtExpressionImpl<T> implements CtUna
String label;

@MetamodelPropertyField(role = EXPRESSION)
CtExpression<T> operand;
CtExpression<?> operand;

@Override
public void accept(CtVisitor visitor) {
visitor.visitCtUnaryOperator(this);
}

@Override
public CtExpression<T> getOperand() {
public CtExpression<?> getOperand() {
return operand;
}

Expand Down Expand Up @@ -76,7 +76,7 @@ public <C extends CtStatement> C insertBefore(CtStatementList statements) {
}

@Override
public <C extends CtUnaryOperator> C setOperand(CtExpression<T> expression) {
public <C extends CtUnaryOperator> C setOperand(CtExpression<?> expression) {
if (expression != null) {
expression.setParent(this);
}
Expand Down
Loading