Changeset 184b617


Ignore:
Timestamp:
Oct 8, 2018 2:24:46 PM (20 months ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
bdd7c35a
Parents:
6fccfc9
Message:

i2psnark: Sync field access (findbugs)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/i2psnark/java/src/org/klomp/snark/web/BasicServlet.java

    r6fccfc9 r184b617  
    158158    public File getResource(String pathInContext)
    159159    {
    160         if (_resourceBase==null)
    161             return null;
    162160        File r = null;
    163161        if (!pathInContext.contains("..") &&
    164162                   !pathInContext.endsWith("/")) {
    165             File f = new File(_resourceBase, pathInContext);
     163            File f;
     164            synchronized (this) {
     165                if (_resourceBase==null)
     166                    return null;
     167                f = new File(_resourceBase, pathInContext);
     168            }
    166169            if (f.exists())
    167170                r = f;
     
    179182    public HttpContent getContent(String pathInContext)
    180183    {
    181         if (_resourceBase==null)
    182             return null;
    183184        HttpContent r = null;
    184185        if (_warBase != null && pathInContext.startsWith(_warBase)) {
Note: See TracChangeset for help on using the changeset viewer.