code: @Override
      public DescriptorValue calculate(IAtomContainer mol) {
  
          if (checkRingSystem)
              Cycles.markRingAtomsAndBonds(mol);
  
          IAtomContainer aliphaticParts = mol.getBuilder().newAtomContainer();
          for (IAtom atom : mol.atoms()) {
              if (isAcyclicCarbon(atom))
                  aliphaticParts.addAtom(atom);
          }
          for (IBond bond : mol.bonds()) {
              if (isAcyclicCarbon(bond.getBegin()) &&
                  isAcyclicCarbon(bond.getEnd()))
                  aliphaticParts.addBond(bond);
          }
  
          int longest = 0;
          final int[][] adjlist = GraphUtil.toAdjList(aliphaticParts);
          for (int i = 0; i < adjlist.length; i++) {
              // atom deg > 1 can't find the longest chain
              if (adjlist[i].length != 1)
                  continue;
              int length = getMaxDepth(adjlist, i, -1);
              if (length > longest)
                  longest = length;
          }
  
          return new DescriptorValue(getSpecification(),
                                     getParameterNames(),
                                     getParameters(),
                                     new IntegerResult(longest),
                                     getDescriptorNames());
      }
docs: Calculate the count of atoms of the longest aliphatic chain in the supplied {@link IAtomContainer}.
  <p>
  The method require one parameter:
  if checkRingSyste is true the CDKConstant.ISINRING will be set
  
  @param mol The {@link IAtomContainer} for which this descriptor is to be calculated
  @return the number of atoms in the longest aliphatic chain of this AtomContainer
  @see #setParameters