File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,7 +56,10 @@ private List<Expression> getMutations(UnaryExpression from) throws ParseTreeExce
5656 boolean isZero = isZero (from .getExpression ());
5757 boolean isOne = isOne (from .getExpression ());
5858 UnaryExpression originalCopy = (UnaryExpression ) from .makeRecursiveCopy_keepOriginalID ();
59- if (compatibleAssignTypeStrict (OJClass .forClass (Integer .class ), exprType , true )) {
59+ if (compatibleAssignTypeStrict (OJClass .forClass (Integer .class ), exprType , true )
60+ || compatibleAssignTypeStrict (OJClass .forClass (Byte .class ), exprType , true )
61+ || compatibleAssignTypeStrict (OJClass .forClass (Short .class ), exprType , true ))
62+ {
6063 if (!(isZero && (isNeg || isPlus ))) {
6164 expressions .add (Literal .makeLiteral (new Integer (0 )));
6265 }
@@ -115,6 +118,8 @@ private List<Expression> getMutations(UnaryExpression from) throws ParseTreeExce
115118 mutMinusOne .forceParenthesis (true );
116119 expressions .add (mutPlusOne );
117120 expressions .add (mutMinusOne );
121+ } else {
122+ throw new ParseTreeException ("getMutations called with incompatible type" );
118123 }
119124 if (!isZero ) expressions .add (new UnaryExpression (originalCopy , UnaryExpression .MINUS ));
120125 return expressions ;
You can’t perform that action at this time.
0 commit comments