TodoScanningState (IndexPattern[] patterns) { Matcher[] matchers = new Matcher[patterns.length]; TodoScanningState todoScanningState = new TodoScanningState(patterns, matchers); for (int i = 0; i < patterns.length; ++i) { Pattern pattern = patterns[i].getOptimizedIndexingPattern(); if (pattern != null) { matchers[i] = pattern.matcher(""); } } return todoScanningState; }