code: static public CommPortIdentifier getPortIdentifier(CommPort p) throws NoSuchPortException {
          LOGGER.fine("CommPortIdentifier:getPortIdentifier(CommPort)");
  
          CommPortIdentifier c;
          synchronized (Sync) {
              c = CommPortIndex;
              while (c != null && c.commPort != p) {
                  c = c.next;
              }
          }
          if (c != null) {
              return (c);
          }
  
          LOGGER.fine("not found!" + p.getName());
          throw new NoSuchPortException();
      }
docs: Gets communication port identifier
  
  @param p - port for which identifier object is returned
  @return - port identifier object
  @throws NoSuchPortException - in case the non existing serial port found