code: public void parseWeightAndOrientation(String arg1, String arg2) {
          if ((arg1 == null && arg2 == null)
                  || (isWeightString(arg1) && arg2 == null)
                  || (arg1 == null && isWeightString(arg2))) {
              // Disable default orientations (D and WD).
              throw new IllegalArgumentException("You must specify the orientation.");
          }
          if (isWeightString(arg1) && isWeightString(arg2)) {
              throw new IllegalArgumentException("Cannot specify the weight column twice.");
          }
          if (isOrientationString(arg1) && isOrientationString(arg2)) {
              throw new IllegalArgumentException("Cannot specify the orientation twice.");
          }
          if (isWeightString(arg1) || isOrientationString(arg2)) {
              setWeightAndOrientation(arg1, arg2);
          }
          if (isOrientationString(arg1) || isWeightString(arg2)) {
              setWeightAndOrientation(arg2, arg1);
          }
      }
docs: Parse the weight and orientation(s) from two strings, given in arbitrary
  order.
  
  @param arg1 Weight or orientation
  @param arg2 Weight or orientation