i2psnark: Sync field access (findbugs)

This commit is contained in:
zzz
2018-10-08 14:24:46 +00:00
parent 6fccfc990a
commit 184b6179e5

View File

@ -157,12 +157,15 @@ class BasicServlet extends HttpServlet
*/
public File getResource(String pathInContext)
{
if (_resourceBase==null)
return null;
File r = null;
if (!pathInContext.contains("..") &&
!pathInContext.endsWith("/")) {
File f = new File(_resourceBase, pathInContext);
File f;
synchronized (this) {
if (_resourceBase==null)
return null;
f = new File(_resourceBase, pathInContext);
}
if (f.exists())
r = f;
}
@ -178,8 +181,6 @@ class BasicServlet extends HttpServlet
*/
public HttpContent getContent(String pathInContext)
{
if (_resourceBase==null)
return null;
HttpContent r = null;
if (_warBase != null && pathInContext.startsWith(_warBase)) {
r = new JarContent(pathInContext);