NoWhitespaceAfterCheck.java

1
////////////////////////////////////////////////////////////////////////////////
2
// checkstyle: Checks Java source code for adherence to a set of rules.
3
// Copyright (C) 2001-2017 the original author or authors.
4
//
5
// This library is free software; you can redistribute it and/or
6
// modify it under the terms of the GNU Lesser General Public
7
// License as published by the Free Software Foundation; either
8
// version 2.1 of the License, or (at your option) any later version.
9
//
10
// This library is distributed in the hope that it will be useful,
11
// but WITHOUT ANY WARRANTY; without even the implied warranty of
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
// Lesser General Public License for more details.
14
//
15
// You should have received a copy of the GNU Lesser General Public
16
// License along with this library; if not, write to the Free Software
17
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
////////////////////////////////////////////////////////////////////////////////
19
20
package com.puppycrawl.tools.checkstyle.checks.whitespace;
21
22
import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
23
import com.puppycrawl.tools.checkstyle.api.DetailAST;
24
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
25
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
26
27
/**
28
 * <p>
29
 * Checks that there is no whitespace after a token.
30
 * More specifically, it checks that it is not followed by whitespace,
31
 * or (if linebreaks are allowed) all characters on the line after are
32
 * whitespace. To forbid linebreaks after a token, set property
33
 * allowLineBreaks to false.
34
 * </p>
35
  * <p> By default the check will check the following operators:
36
 *  {@link TokenTypes#ARRAY_INIT ARRAY_INIT},
37
 *  {@link TokenTypes#BNOT BNOT},
38
 *  {@link TokenTypes#DEC DEC},
39
 *  {@link TokenTypes#DOT DOT},
40
 *  {@link TokenTypes#INC INC},
41
 *  {@link TokenTypes#LNOT LNOT},
42
 *  {@link TokenTypes#UNARY_MINUS UNARY_MINUS},
43
 *  {@link TokenTypes#UNARY_PLUS UNARY_PLUS},
44
 *  {@link TokenTypes#TYPECAST TYPECAST},
45
 *  {@link TokenTypes#ARRAY_DECLARATOR ARRAY_DECLARATOR},
46
 *  {@link TokenTypes#INDEX_OP INDEX_OP}.
47
 * </p>
48
 * <p>
49
 * The check processes
50
 * {@link TokenTypes#ARRAY_DECLARATOR ARRAY_DECLARATOR},
51
 * {@link TokenTypes#INDEX_OP INDEX_OP}
52
 * specially from other tokens. Actually it is checked that there is
53
 * no whitespace before this tokens, not after them.
54
 * Annotation before {@link TokenTypes#ARRAY_DECLARATOR ARRAY_DECLARATOR}
55
 * and {@link TokenTypes#INDEX_OP INDEX_OP} will be ignored.
56
 * </p>
57
 * <p>
58
 * An example of how to configure the check is:
59
 * </p>
60
 * <pre>
61
 * &lt;module name="NoWhitespaceAfter"/&gt;
62
 * </pre>
63
 * <p> An example of how to configure the check to forbid linebreaks after
64
 * a {@link TokenTypes#DOT DOT} token is:
65
 * </p>
66
 * <pre>
67
 * &lt;module name="NoWhitespaceAfter"&gt;
68
 *     &lt;property name="tokens" value="DOT"/&gt;
69
 *     &lt;property name="allowLineBreaks" value="false"/&gt;
70
 * &lt;/module&gt;
71
 * </pre>
72
 * @author Rick Giles
73
 * @author lkuehne
74
 * @author <a href="mailto:nesterenko-aleksey@list.ru">Aleksey Nesterenko</a>
75
 * @author attatrol
76
 */
77
public class NoWhitespaceAfterCheck extends AbstractCheck {
78
79
    /**
80
     * A key is pointing to the warning message text in "messages.properties"
81
     * file.
82
     */
83
    public static final String MSG_KEY = "ws.followed";
84
85
    /** Whether whitespace is allowed if the AST is at a linebreak. */
86
    private boolean allowLineBreaks = true;
87
88
    @Override
89
    public int[] getDefaultTokens() {
90 1 1. getDefaultTokens : mutated return of Object value for com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceAfterCheck::getDefaultTokens to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return new int[] {
91
            TokenTypes.ARRAY_INIT,
92
            TokenTypes.INC,
93
            TokenTypes.DEC,
94
            TokenTypes.UNARY_MINUS,
95
            TokenTypes.UNARY_PLUS,
96
            TokenTypes.BNOT,
97
            TokenTypes.LNOT,
98
            TokenTypes.DOT,
99
            TokenTypes.ARRAY_DECLARATOR,
100
            TokenTypes.INDEX_OP,
101
        };
102
    }
103
104
    @Override
105
    public int[] getAcceptableTokens() {
106 1 1. getAcceptableTokens : mutated return of Object value for com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceAfterCheck::getAcceptableTokens to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return new int[] {
107
            TokenTypes.ARRAY_INIT,
108
            TokenTypes.INC,
109
            TokenTypes.DEC,
110
            TokenTypes.UNARY_MINUS,
111
            TokenTypes.UNARY_PLUS,
112
            TokenTypes.BNOT,
113
            TokenTypes.LNOT,
114
            TokenTypes.DOT,
115
            TokenTypes.TYPECAST,
116
            TokenTypes.ARRAY_DECLARATOR,
117
            TokenTypes.INDEX_OP,
118
            TokenTypes.LITERAL_SYNCHRONIZED,
119
            TokenTypes.METHOD_REF,
120
        };
121
    }
122
123
    @Override
124
    public int[] getRequiredTokens() {
125 1 1. getRequiredTokens : mutated return of Object value for com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceAfterCheck::getRequiredTokens to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return CommonUtils.EMPTY_INT_ARRAY;
126
    }
127
128
    /**
129
     * Control whether whitespace is flagged at linebreaks.
130
     * @param allowLineBreaks whether whitespace should be
131
     *     flagged at linebreaks.
132
     */
133
    public void setAllowLineBreaks(boolean allowLineBreaks) {
134
        this.allowLineBreaks = allowLineBreaks;
135
    }
136
137
    @Override
138
    public void visitToken(DetailAST ast) {
139
        final DetailAST whitespaceFollowedAst = getWhitespaceFollowedNode(ast);
140
141 1 1. visitToken : negated conditional → KILLED
        if (whitespaceFollowedAst.getNextSibling() == null
142 1 1. visitToken : negated conditional → KILLED
                || whitespaceFollowedAst.getNextSibling().getType() != TokenTypes.ANNOTATIONS) {
143
            final int whitespaceColumnNo = getPositionAfter(whitespaceFollowedAst);
144
            final int whitespaceLineNo = whitespaceFollowedAst.getLineNo();
145
146 1 1. visitToken : negated conditional → KILLED
            if (hasTrailingWhitespace(ast, whitespaceColumnNo, whitespaceLineNo)) {
147 1 1. visitToken : removed call to com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceAfterCheck::log → KILLED
                log(whitespaceLineNo, whitespaceColumnNo,
148
                        MSG_KEY, whitespaceFollowedAst.getText());
149
            }
150
        }
151
    }
152
153
    /**
154
     * For a visited ast node returns node that should be checked
155
     * for not being followed by whitespace.
156
     * @param ast
157
     *        , visited node.
158
     * @return node before ast.
159
     */
160
    private static DetailAST getWhitespaceFollowedNode(DetailAST ast) {
161
        final DetailAST whitespaceFollowedAst;
162
        switch (ast.getType()) {
163
            case TokenTypes.TYPECAST:
164
                whitespaceFollowedAst = ast.findFirstToken(TokenTypes.RPAREN);
165
                break;
166
            case TokenTypes.ARRAY_DECLARATOR:
167
                whitespaceFollowedAst = getArrayDeclaratorPreviousElement(ast);
168
                break;
169
            case TokenTypes.INDEX_OP:
170
                whitespaceFollowedAst = getIndexOpPreviousElement(ast);
171
                break;
172
            default:
173
                whitespaceFollowedAst = ast;
174
        }
175 1 1. getWhitespaceFollowedNode : mutated return of Object value for com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceAfterCheck::getWhitespaceFollowedNode to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return whitespaceFollowedAst;
176
    }
177
178
    /**
179
     * Gets position after token (place of possible redundant whitespace).
180
     * @param ast Node representing token.
181
     * @return position after token.
182
     */
183
    private static int getPositionAfter(DetailAST ast) {
184
        final int after;
185
        //If target of possible redundant whitespace is in method definition.
186 1 1. getPositionAfter : negated conditional → KILLED
        if (ast.getType() == TokenTypes.IDENT
187 1 1. getPositionAfter : negated conditional → KILLED
                && ast.getNextSibling() != null
188 1 1. getPositionAfter : negated conditional → KILLED
                && ast.getNextSibling().getType() == TokenTypes.LPAREN) {
189
            final DetailAST methodDef = ast.getParent();
190
            final DetailAST endOfParams = methodDef.findFirstToken(TokenTypes.RPAREN);
191 1 1. getPositionAfter : Replaced integer addition with subtraction → KILLED
            after = endOfParams.getColumnNo() + 1;
192
        }
193
        else {
194 1 1. getPositionAfter : Replaced integer addition with subtraction → KILLED
            after = ast.getColumnNo() + ast.getText().length();
195
        }
196 1 1. getPositionAfter : replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED
        return after;
197
    }
198
199
    /**
200
     * Checks if there is unwanted whitespace after the visited node.
201
     * @param ast
202
     *        , visited node.
203
     * @param whitespaceColumnNo
204
     *        , column number of a possible whitespace.
205
     * @param whitespaceLineNo
206
     *        , line number of a possible whitespace.
207
     * @return true if whitespace found.
208
     */
209
    private boolean hasTrailingWhitespace(DetailAST ast,
210
        int whitespaceColumnNo, int whitespaceLineNo) {
211
        final boolean result;
212
        final int astLineNo = ast.getLineNo();
213 1 1. hasTrailingWhitespace : Replaced integer subtraction with addition → KILLED
        final String line = getLine(astLineNo - 1);
214 3 1. hasTrailingWhitespace : changed conditional boundary → KILLED
2. hasTrailingWhitespace : negated conditional → KILLED
3. hasTrailingWhitespace : negated conditional → KILLED
        if (astLineNo == whitespaceLineNo && whitespaceColumnNo < line.length()) {
215
            result = Character.isWhitespace(line.charAt(whitespaceColumnNo));
216
        }
217
        else {
218 1 1. hasTrailingWhitespace : negated conditional → KILLED
            result = !allowLineBreaks;
219
        }
220 1 1. hasTrailingWhitespace : replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED
        return result;
221
    }
222
223
    /**
224
     * Returns proper argument for getPositionAfter method, it is a token after
225
     * {@link TokenTypes#ARRAY_DECLARATOR ARRAY_DECLARATOR}, in can be {@link TokenTypes#RBRACK
226
     * RBRACK}, {@link TokenTypes#IDENT IDENT} or an array type definition (literal).
227
     * @param ast
228
     *        , {@link TokenTypes#ARRAY_DECLARATOR ARRAY_DECLARATOR} node.
229
     * @return previous node by text order.
230
     */
231
    private static DetailAST getArrayDeclaratorPreviousElement(DetailAST ast) {
232
        final DetailAST previousElement;
233
        final DetailAST firstChild = ast.getFirstChild();
234 1 1. getArrayDeclaratorPreviousElement : negated conditional → KILLED
        if (firstChild.getType() == TokenTypes.ARRAY_DECLARATOR) {
235
            // second or higher array index
236
            previousElement = firstChild.findFirstToken(TokenTypes.RBRACK);
237
        }
238
        else {
239
            // first array index, is preceded with identifier or type
240
            final DetailAST parent = getFirstNonArrayDeclaratorParent(ast);
241
            switch (parent.getType()) {
242
                // generics
243
                case TokenTypes.TYPE_ARGUMENT:
244
                    final DetailAST wildcard = parent.findFirstToken(TokenTypes.WILDCARD_TYPE);
245 1 1. getArrayDeclaratorPreviousElement : negated conditional → KILLED
                    if (wildcard == null) {
246
                        // usual generic type argument like <char[]>
247
                        previousElement = getTypeLastNode(ast);
248
                    }
249
                    else {
250
                        // constructions with wildcard like <? extends String[]>
251
                        previousElement = getTypeLastNode(ast.getFirstChild());
252
                    }
253
                    break;
254
                // 'new' is a special case with its own subtree structure
255
                case TokenTypes.LITERAL_NEW:
256
                    previousElement = getTypeLastNode(parent);
257
                    break;
258
                // mundane array declaration, can be either java style or C style
259
                case TokenTypes.TYPE:
260
                    previousElement = getPreviousNodeWithParentOfTypeAst(ast, parent);
261
                    break;
262
                // i.e. boolean[].class
263
                case TokenTypes.DOT:
264
                    previousElement = getTypeLastNode(ast);
265
                    break;
266
                // java 8 method reference
267
                case TokenTypes.METHOD_REF:
268
                    final DetailAST ident = getIdentLastToken(ast);
269 1 1. getArrayDeclaratorPreviousElement : negated conditional → KILLED
                    if (ident == null) {
270
                        //i.e. int[]::new
271
                        previousElement = ast.getFirstChild();
272
                    }
273
                    else {
274
                        previousElement = ident;
275
                    }
276
                    break;
277
                default:
278
                    throw new IllegalStateException("unexpected ast syntax " + parent);
279
            }
280
        }
281 1 1. getArrayDeclaratorPreviousElement : mutated return of Object value for com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceAfterCheck::getArrayDeclaratorPreviousElement to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return previousElement;
282
    }
283
284
    /**
285
     * Gets previous node for {@link TokenTypes#INDEX_OP INDEX_OP} token
286
     * for usage in getPositionAfter method, it is a simplified copy of
287
     * getArrayDeclaratorPreviousElement method.
288
     * @param ast
289
     *        , {@link TokenTypes#INDEX_OP INDEX_OP} node.
290
     * @return previous node by text order.
291
     */
292
    private static DetailAST getIndexOpPreviousElement(DetailAST ast) {
293
        final DetailAST result;
294
        final DetailAST firstChild = ast.getFirstChild();
295 1 1. getIndexOpPreviousElement : negated conditional → KILLED
        if (firstChild.getType() == TokenTypes.INDEX_OP) {
296
            // second or higher array index
297
            result = firstChild.findFirstToken(TokenTypes.RBRACK);
298
        }
299
        else {
300
            final DetailAST ident = getIdentLastToken(ast);
301 1 1. getIndexOpPreviousElement : negated conditional → KILLED
            if (ident == null) {
302
                final DetailAST rparen = ast.findFirstToken(TokenTypes.RPAREN);
303
                // construction like new int[]{1}[0]
304 1 1. getIndexOpPreviousElement : negated conditional → KILLED
                if (rparen == null) {
305
                    final DetailAST lastChild = firstChild.getLastChild();
306
                    result = lastChild.findFirstToken(TokenTypes.RCURLY);
307
                }
308
                // construction like ((byte[]) pixels)[0]
309
                else {
310
                    result = rparen;
311
                }
312
            }
313
            else {
314
                result = ident;
315
            }
316
        }
317 1 1. getIndexOpPreviousElement : mutated return of Object value for com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceAfterCheck::getIndexOpPreviousElement to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return result;
318
    }
319
320
    /**
321
     * Get node that owns {@link TokenTypes#ARRAY_DECLARATOR ARRAY_DECLARATOR} sequence.
322
     * @param ast
323
     *        , {@link TokenTypes#ARRAY_DECLARATOR ARRAY_DECLARATOR} node.
324
     * @return owner node.
325
     */
326
    private static DetailAST getFirstNonArrayDeclaratorParent(DetailAST ast) {
327
        DetailAST parent = ast.getParent();
328 1 1. getFirstNonArrayDeclaratorParent : negated conditional → KILLED
        while (parent.getType() == TokenTypes.ARRAY_DECLARATOR) {
329
            parent = parent.getParent();
330
        }
331 1 1. getFirstNonArrayDeclaratorParent : mutated return of Object value for com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceAfterCheck::getFirstNonArrayDeclaratorParent to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return parent;
332
    }
333
334
    /**
335
     * Searches parameter node for a type node.
336
     * Returns it or its last node if it has an extended structure.
337
     * @param ast
338
     *        , subject node.
339
     * @return type node.
340
     */
341
    private static DetailAST getTypeLastNode(DetailAST ast) {
342
        DetailAST result = ast.findFirstToken(TokenTypes.TYPE_ARGUMENTS);
343 1 1. getTypeLastNode : negated conditional → KILLED
        if (result == null) {
344
            result = getIdentLastToken(ast);
345 1 1. getTypeLastNode : negated conditional → KILLED
            if (result == null) {
346
                //primitive literal expected
347
                result = ast.getFirstChild();
348
            }
349
        }
350
        else {
351
            result = result.findFirstToken(TokenTypes.GENERIC_END);
352
        }
353 1 1. getTypeLastNode : mutated return of Object value for com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceAfterCheck::getTypeLastNode to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return result;
354
    }
355
356
    /**
357
     * Finds previous node by text order for an array declarator,
358
     * which parent type is {@link TokenTypes#TYPE TYPE}.
359
     * @param ast
360
     *        , array declarator node.
361
     * @param parent
362
     *        , its parent node.
363
     * @return previous node by text order.
364
     */
365
    private static DetailAST getPreviousNodeWithParentOfTypeAst(DetailAST ast, DetailAST parent) {
366
        final DetailAST previousElement;
367
        final DetailAST ident = getIdentLastToken(parent.getParent());
368
        final DetailAST lastTypeNode = getTypeLastNode(ast);
369
        // sometimes there are ident-less sentences
370
        // i.e. "(Object[]) null", but in casual case should be
371
        // checked whether ident or lastTypeNode has preceding position
372
        // determining if it is java style or C style
373 3 1. getPreviousNodeWithParentOfTypeAst : changed conditional boundary → KILLED
2. getPreviousNodeWithParentOfTypeAst : negated conditional → KILLED
3. getPreviousNodeWithParentOfTypeAst : negated conditional → KILLED
        if (ident == null || ident.getLineNo() > ast.getLineNo()) {
374
            previousElement = lastTypeNode;
375
        }
376 2 1. getPreviousNodeWithParentOfTypeAst : changed conditional boundary → KILLED
2. getPreviousNodeWithParentOfTypeAst : negated conditional → KILLED
        else if (ident.getLineNo() < ast.getLineNo()) {
377
            previousElement = ident;
378
        }
379
        //ident and lastTypeNode lay on one line
380
        else {
381 2 1. getPreviousNodeWithParentOfTypeAst : changed conditional boundary → SURVIVED
2. getPreviousNodeWithParentOfTypeAst : negated conditional → KILLED
            if (ident.getColumnNo() > ast.getColumnNo()
382 2 1. getPreviousNodeWithParentOfTypeAst : changed conditional boundary → SURVIVED
2. getPreviousNodeWithParentOfTypeAst : negated conditional → KILLED
                || lastTypeNode.getColumnNo() > ident.getColumnNo()) {
383
                previousElement = lastTypeNode;
384
            }
385
            else {
386
                previousElement = ident;
387
            }
388
        }
389 1 1. getPreviousNodeWithParentOfTypeAst : mutated return of Object value for com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceAfterCheck::getPreviousNodeWithParentOfTypeAst to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return previousElement;
390
    }
391
392
    /**
393
     * Gets leftmost token of identifier.
394
     * @param ast
395
     *        , token possibly possessing an identifier.
396
     * @return leftmost token of identifier.
397
     */
398
    private static DetailAST getIdentLastToken(DetailAST ast) {
399
        // single identifier token as a name is the most common case
400
        DetailAST result = ast.findFirstToken(TokenTypes.IDENT);
401 1 1. getIdentLastToken : negated conditional → KILLED
        if (result == null) {
402
            final DetailAST dot = ast.findFirstToken(TokenTypes.DOT);
403
            // method call case
404 1 1. getIdentLastToken : negated conditional → KILLED
            if (dot == null) {
405
                final DetailAST methodCall = ast.findFirstToken(TokenTypes.METHOD_CALL);
406 1 1. getIdentLastToken : negated conditional → KILLED
                if (methodCall != null) {
407
                    result = methodCall.findFirstToken(TokenTypes.RPAREN);
408
                }
409
            }
410
            // qualified name case
411
            else {
412 1 1. getIdentLastToken : negated conditional → KILLED
                if (dot.findFirstToken(TokenTypes.DOT) == null) {
413
                    result = dot.getFirstChild().getNextSibling();
414
                }
415
                else {
416
                    result = dot.findFirstToken(TokenTypes.IDENT);
417
                }
418
            }
419
        }
420 1 1. getIdentLastToken : mutated return of Object value for com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceAfterCheck::getIdentLastToken to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return result;
421
    }
422
423
}

Mutations

90

1.1
Location : getDefaultTokens
Killed by : com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest.testMethodReference(com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest)
mutated return of Object value for com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceAfterCheck::getDefaultTokens to ( if (x != null) null else throw new RuntimeException ) → KILLED

106

1.1
Location : getAcceptableTokens
Killed by : com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest.testSynchronized(com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest)
mutated return of Object value for com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceAfterCheck::getAcceptableTokens to ( if (x != null) null else throw new RuntimeException ) → KILLED

125

1.1
Location : getRequiredTokens
Killed by : com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest.testMethodReference(com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest)
mutated return of Object value for com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceAfterCheck::getRequiredTokens to ( if (x != null) null else throw new RuntimeException ) → KILLED

141

1.1
Location : visitToken
Killed by : com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest.testArrayDeclarations3(com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest)
negated conditional → KILLED

142

1.1
Location : visitToken
Killed by : com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest.testMethodReference(com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest)
negated conditional → KILLED

146

1.1
Location : visitToken
Killed by : com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest.testMethodReference(com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest)
negated conditional → KILLED

147

1.1
Location : visitToken
Killed by : com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest.testMethodReference(com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest)
removed call to com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceAfterCheck::log → KILLED

175

1.1
Location : getWhitespaceFollowedNode
Killed by : com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest.testMethodReference(com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest)
mutated return of Object value for com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceAfterCheck::getWhitespaceFollowedNode to ( if (x != null) null else throw new RuntimeException ) → KILLED

186

1.1
Location : getPositionAfter
Killed by : com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest.testArrayDeclarations2(com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest)
negated conditional → KILLED

187

1.1
Location : getPositionAfter
Killed by : com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest.testArrayDeclarations2(com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest)
negated conditional → KILLED

188

1.1
Location : getPositionAfter
Killed by : com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest.testMethodReference(com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest)
negated conditional → KILLED

191

1.1
Location : getPositionAfter
Killed by : com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest.testArrayDeclarations2(com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest)
Replaced integer addition with subtraction → KILLED

194

1.1
Location : getPositionAfter
Killed by : com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest.testMethodReference(com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest)
Replaced integer addition with subtraction → KILLED

196

1.1
Location : getPositionAfter
Killed by : com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest.testMethodReference(com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest)
replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED

213

1.1
Location : hasTrailingWhitespace
Killed by : com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest.testMethodReference(com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest)
Replaced integer subtraction with addition → KILLED

214

1.1
Location : hasTrailingWhitespace
Killed by : com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest.testSynchronized(com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest)
changed conditional boundary → KILLED

2.2
Location : hasTrailingWhitespace
Killed by : com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest.testMethodReference(com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest)
negated conditional → KILLED

3.3
Location : hasTrailingWhitespace
Killed by : com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest.testMethodReference(com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest)
negated conditional → KILLED

218

1.1
Location : hasTrailingWhitespace
Killed by : com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest.testSynchronized(com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest)
negated conditional → KILLED

220

1.1
Location : hasTrailingWhitespace
Killed by : com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest.testMethodReference(com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest)
replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED

234

1.1
Location : getArrayDeclaratorPreviousElement
Killed by : com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest.testVisitTokenSwitchReflection(com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest)
negated conditional → KILLED

245

1.1
Location : getArrayDeclaratorPreviousElement
Killed by : com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest.testMethodReference(com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest)
negated conditional → KILLED

269

1.1
Location : getArrayDeclaratorPreviousElement
Killed by : com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest.testMethodReference(com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest)
negated conditional → KILLED

281

1.1
Location : getArrayDeclaratorPreviousElement
Killed by : com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest.testMethodReference(com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest)
mutated return of Object value for com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceAfterCheck::getArrayDeclaratorPreviousElement to ( if (x != null) null else throw new RuntimeException ) → KILLED

295

1.1
Location : getIndexOpPreviousElement
Killed by : com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest.testArrayDeclarations2(com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest)
negated conditional → KILLED

301

1.1
Location : getIndexOpPreviousElement
Killed by : com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest.testArrayDeclarations2(com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest)
negated conditional → KILLED

304

1.1
Location : getIndexOpPreviousElement
Killed by : com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest.testArrayDeclarations2(com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest)
negated conditional → KILLED

317

1.1
Location : getIndexOpPreviousElement
Killed by : com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest.testArrayDeclarations2(com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest)
mutated return of Object value for com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceAfterCheck::getIndexOpPreviousElement to ( if (x != null) null else throw new RuntimeException ) → KILLED

328

1.1
Location : getFirstNonArrayDeclaratorParent
Killed by : com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest.testVisitTokenSwitchReflection(com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest)
negated conditional → KILLED

331

1.1
Location : getFirstNonArrayDeclaratorParent
Killed by : com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest.testVisitTokenSwitchReflection(com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest)
mutated return of Object value for com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceAfterCheck::getFirstNonArrayDeclaratorParent to ( if (x != null) null else throw new RuntimeException ) → KILLED

343

1.1
Location : getTypeLastNode
Killed by : com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest.testMethodReference(com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest)
negated conditional → KILLED

345

1.1
Location : getTypeLastNode
Killed by : com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest.testMethodReference(com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest)
negated conditional → KILLED

353

1.1
Location : getTypeLastNode
Killed by : com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest.testMethodReference(com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest)
mutated return of Object value for com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceAfterCheck::getTypeLastNode to ( if (x != null) null else throw new RuntimeException ) → KILLED

373

1.1
Location : getPreviousNodeWithParentOfTypeAst
Killed by : com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest.testArrayDeclarations2(com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest)
changed conditional boundary → KILLED

2.2
Location : getPreviousNodeWithParentOfTypeAst
Killed by : com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest.testArrayDeclarations2(com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest)
negated conditional → KILLED

3.3
Location : getPreviousNodeWithParentOfTypeAst
Killed by : com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest.testArrayDeclarations2(com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest)
negated conditional → KILLED

376

1.1
Location : getPreviousNodeWithParentOfTypeAst
Killed by : com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest.testNpe(com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest)
changed conditional boundary → KILLED

2.2
Location : getPreviousNodeWithParentOfTypeAst
Killed by : com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest.testNpe(com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest)
negated conditional → KILLED

381

1.1
Location : getPreviousNodeWithParentOfTypeAst
Killed by : none
changed conditional boundary → SURVIVED

2.2
Location : getPreviousNodeWithParentOfTypeAst
Killed by : com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest.testNpe(com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest)
negated conditional → KILLED

382

1.1
Location : getPreviousNodeWithParentOfTypeAst
Killed by : none
changed conditional boundary → SURVIVED

2.2
Location : getPreviousNodeWithParentOfTypeAst
Killed by : com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest.testArrayDeclarations2(com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest)
negated conditional → KILLED

389

1.1
Location : getPreviousNodeWithParentOfTypeAst
Killed by : com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest.testArrayDeclarations3(com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest)
mutated return of Object value for com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceAfterCheck::getPreviousNodeWithParentOfTypeAst to ( if (x != null) null else throw new RuntimeException ) → KILLED

401

1.1
Location : getIdentLastToken
Killed by : com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest.testArrayDeclarations2(com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest)
negated conditional → KILLED

404

1.1
Location : getIdentLastToken
Killed by : com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest.testMethodReference(com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest)
negated conditional → KILLED

406

1.1
Location : getIdentLastToken
Killed by : com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest.testMethodReference(com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest)
negated conditional → KILLED

412

1.1
Location : getIdentLastToken
Killed by : com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest.testArrayDeclarations2(com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest)
negated conditional → KILLED

420

1.1
Location : getIdentLastToken
Killed by : com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest.testMethodReference(com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheckTest)
mutated return of Object value for com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceAfterCheck::getIdentLastToken to ( if (x != null) null else throw new RuntimeException ) → KILLED

Active mutators

Tests examined


Report generated by PIT 1.2.2