Пример #1
0
 /** Add a field with the specified value. */
 @DSGenerator(
     tool_name = "Doppelganger",
     tool_version = "2.0",
     generated_on = "2013-12-30 13:02:32.316 -0500",
     hash_original_method = "438CB3F0D3B01507EC959AE5277C1434",
     hash_generated_method = "D618B8A0B8645A63526CEA5B342F57A5")
 public void add(String fieldName, String value) {
   if (fieldName == null) {
     throw new IllegalArgumentException("fieldName == null");
   }
   if (value == null) {
     /*
      * Given null values, the RI sends a malformed field line like
      * "Accept\r\n". For platform compatibility and HTTP compliance, we
      * print a warning and ignore null values.
      */
     System.logW("Ignoring HTTP header field '" + fieldName + "' because its value is null");
     return;
   }
   namesAndValues.add(fieldName);
   namesAndValues.add(value.trim());
 }