code: private static int[] makeFields(int[] fields, TupleTypeInfo<?> type) {
  		int inLength = type.getArity();
  		
  		// null parameter means all fields are considered
  		if (fields == null || fields.length == 0) {
  			fields = new int[inLength];
  			for (int i = 0; i < inLength; i++) {
  				fields[i] = i;
  			}
  			return fields;
  		} else {
  			return rangeCheckAndOrderFields(fields, inLength-1);
  		}
  	}
docs: --------------------------------------------------------------------------------------------