View Javadoc
1   /*
2   MatchXpath
3   query = //VARIABLE_DEF[./ASSIGN/EXPR/LITERAL_NEW and not(./TYPE/IDENT[@text='var'])]
4   
5   
6   */
7   
8   
9   package com.puppycrawl.tools.checkstyle.checks.coding.matchxpath;
10  
11  public class InputMatchXpathAvoidInstanceCreationWithoutVar {
12      public void test() {
13          SomeObject a = new SomeObject(); // violation
14          var b = new SomeObject();
15      }
16  
17      class SomeObject {}
18  }