MCPcopy Index your code
hub / github.com/apache/tomcat / getTaglibXml

Method getTaglibXml

java/org/apache/jasper/compiler/TldCache.java:133–158  ·  view source on GitHub ↗

Returns the parsed tag library XML for the given resource path. @param tldResourcePath the TLD resource path @return the parsed tag library XML, or null if not found @throws JasperException if an error occurs during parsing

(TldResourcePath tldResourcePath)

Source from the content-addressed store, hash-verified

131 * @throws JasperException if an error occurs during parsing
132 */
133 public TaglibXml getTaglibXml(TldResourcePath tldResourcePath) throws JasperException {
134 TaglibXmlCacheEntry cacheEntry = tldResourcePathTaglibXmlMap.get(tldResourcePath);
135 if (cacheEntry == null) {
136 return null;
137 }
138 long[] lastModified = getLastModified(tldResourcePath);
139 if (lastModified[0] != cacheEntry.getWebAppPathLastModified() ||
140 lastModified[1] != cacheEntry.getEntryLastModified()) {
141 synchronized (cacheEntry) {
142 if (lastModified[0] != cacheEntry.getWebAppPathLastModified() ||
143 lastModified[1] != cacheEntry.getEntryLastModified()) {
144 // Re-parse TLD
145 TaglibXml updatedTaglibXml;
146 try {
147 updatedTaglibXml = tldParser.parse(tldResourcePath);
148 } catch (IOException | SAXException e) {
149 throw new JasperException(e);
150 }
151 cacheEntry.setTaglibXml(updatedTaglibXml);
152 cacheEntry.setWebAppPathLastModified(lastModified[0]);
153 cacheEntry.setEntryLastModified(lastModified[1]);
154 }
155 }
156 }
157 return cacheEntry.getTaglibXml();
158 }
159
160
161 private long[] getLastModified(TldResourcePath tldResourcePath) {

Callers 1

TagLibraryInfoImplMethod · 0.45

Calls 9

getLastModifiedMethod · 0.95
getEntryLastModifiedMethod · 0.95
setTaglibXmlMethod · 0.95
setEntryLastModifiedMethod · 0.95
getTaglibXmlMethod · 0.95
getMethod · 0.65
parseMethod · 0.45

Tested by

no test coverage detected