/** Get the context-path for non-empty array of the contexts. */ static synchronized TokenContextPath get(TokenContext[] contexts) { if (contexts == null || contexts.length == 0) { throw new IllegalArgumentException("Contexts must be valid and non-empty."); // NOI18N } ArrayMatcher am = new ArrayMatcher(contexts); TokenContextPath path = (TokenContextPath)registry.get(am); if (path == null) { path = new TokenContextPath(contexts); registry.put(am, path); } return path; }
/** Get the context-path for non-empty array of the contexts. */ static synchronized TokenContextPath get(TokenContext[] contexts) { if (contexts == null || contexts.length == 0) { throw new IllegalArgumentException("Contexts must be valid and non-empty."); } ArrayMatcher am = new ArrayMatcher(contexts); TokenContextPath path = (TokenContextPath) registry.get(am); if (path == null) { path = new TokenContextPath(contexts); registry.put(am, path); } return path; }