code: public ResourceSnippet getSnippet(PageSource ps, int startPos, int endPos, String charset) {
  	String keySnp = calcKey(ps, startPos, endPos);
  	synchronized (sync) {
  	    ResourceSnippet snippet = snippets.get(keySnp);
  	    if (snippet == null) {
  		Resource res = ps.getResource();
  		String keyRes = calcKey(res);
  		String src = sources.get(keyRes);
  		if (src == null) {
  		    src = ResourceSnippet.getContents(res, charset);
  		    sources.put(keyRes, src);
  		}
  		snippet = ResourceSnippet.createResourceSnippet(src, startPos, endPos);
  		snippets.put(keySnp, snippet);
  	    }
  	    return snippet;
  	}
      }
docs: this method accesses the underlying Map(s) and is therefore synchronized
  
  @param ps
  @param startPos
  @param endPos
  @param charset
  @return