code: public FieldDescriptor[] getLockingFields()
      {
          if (m_lockingFieldDescriptors == null)
          {
              // 1. collect all Primary Key fields from Field list
              Vector vec = new Vector();
              for (int i = 0; i < m_FieldDescriptions.length; i++)
              {
                  FieldDescriptor fd = m_FieldDescriptions[i];
                  if (fd.isLocking())
                  {
                      vec.add(fd);
                  }
              }
              // 2. Sort fields according to their getOrder() Property
              Collections.sort(vec, FieldDescriptor.getComparator());
              m_lockingFieldDescriptors =
                  (FieldDescriptor[]) vec.toArray(new FieldDescriptor[vec.size()]);
          }
          return m_lockingFieldDescriptors;
      }
docs: return an array of FieldDescription for optimistic locking sorted ascending
  according to the field-descriptions getOrder() property