1 /* // violation 2 TrailingComment 3 format = NOT MATCH 4 legalComment = (default)(null) 5 6 7 */ 8 9 package com.puppycrawl.tools.checkstyle.checks.trailingcomment; 10 11 public class InputTrailingComment3 { 12 int i; // don't use trailing comments :) // violation 13 // it fine to have comment w/o any statement // violation 14 /* good c-style comment. */ // violation 15 int j; /* bad c-style comment. */ // violation 16 void method1() { /* some c-style multi-line // violation 17 comment*/ 18 Runnable r = (new Runnable() { 19 public void run() { 20 } 21 }); /* we should allow this */ // violation 22 } // we should allow this // violation 23 /* // violation 24 Let's check multi-line comments. 25 */ 26 /* c-style */ // cpp-style // violation 27 /* c-style 1 */ /*c-style 2 */ // violation 28 29 /* package */ void method2(long ms /* we should ignore this */) { 30 /* comment before text */int z; 31 /* int y */int y/**/; 32 } 33 34 /** // violation 35 * comment with trailing space. 36 */ 37 final static public String NAME="Some Name"; // NOI18N // violation 38 final static public String NAME2="Some Name"; /*NOI18N*/ // violation 39 String NAME3="Some Name"; /*NOI18N // violation 40 */ 41 /* package */ void method3() { 42 /* violation on this block */ // violation 43 // violation here for format NOT FOUND // violation 44 } 45 46 private static class TimerEntry { 47 /* ok */ final String operation = null; 48 /* ok */ final long start = 0L; 49 } 50 51 /** // violation 52 * violation above this line. 53 **/ 54 /* package */ void addError() { 55 } 56 }