@@ -218,11 +218,7 @@ private static Scanner createScanner(String lang) {
218218 * @return a list of Rules that apply
219219 */
220220 public static List <Rule > instance (NameType nameType , RuleType rt , Languages .LanguageSet langs ) {
221- if (langs .isSingleton ()) {
222- return instance (nameType , rt , langs .getAny ());
223- } else {
224- return instance (nameType , rt , Languages .ANY );
225- }
221+ return langs .isSingleton () ? instance (nameType , rt , langs .getAny ()) : instance (nameType , rt , Languages .ANY );
226222 }
227223
228224 /**
@@ -315,7 +311,7 @@ private static List<Rule> parseRules(final Scanner scanner, final String locatio
315311 if (line .length () == 0 ) {
316312 continue ; // empty lines can be safely skipped
317313 }
318-
314+
319315 if (line .startsWith (HASH_INCLUDE )) {
320316 // include statement
321317 String incl = line .substring (HASH_INCLUDE .length ()).trim ();
@@ -621,8 +617,9 @@ public boolean find() {
621617 }
622618
623619 private static boolean startsWith (CharSequence input , CharSequence prefix ) {
624- if (prefix .length () > input .length ())
620+ if (prefix .length () > input .length ()) {
625621 return false ;
622+ }
626623 for (int i = 0 ; i < prefix .length (); i ++) {
627624 if (input .charAt (i ) != prefix .charAt (i )) {
628625 return false ;
@@ -632,8 +629,9 @@ private static boolean startsWith(CharSequence input, CharSequence prefix) {
632629 }
633630
634631 private static boolean endsWith (CharSequence input , CharSequence suffix ) {
635- if (suffix .length () > input .length ())
632+ if (suffix .length () > input .length ()) {
636633 return false ;
634+ }
637635 for (int i = input .length () - 1 , j = suffix .length () - 1 ; j >= 0 ; i --, j --) {
638636 if (input .charAt (i ) != suffix .charAt (j )) {
639637 return false ;
@@ -652,6 +650,7 @@ private static boolean contains(CharSequence chars, char input) {
652650 }
653651
654652 private static class AppendableCharSeqeuence implements CharSequence {
653+
655654 private final CharSequence left ;
656655 private final CharSequence right ;
657656 private final int length ;
0 commit comments