code: public static synchronized PortFile getPortFile(String filename) {
          if (allPortFiles == null) {
              allPortFiles = new HashMap<>();
          }
          PortFile pf = allPortFiles.get(filename);
  
          // Port file known. Does it still exist?
          if (pf != null) {
              try {
                  if (!pf.exists())
                      pf = null;
              } catch (IOException ioex) {
                  ioex.printStackTrace();
              }
          }
  
          if (pf == null) {
              pf = new PortFile(filename);
              allPortFiles.put(filename, pf);
          }
          return pf;
      }
docs: Acquire the port file. Synchronized since several threads inside an smart javac wrapper client acquires the same port file at the same time.