/*
Copyright 2007-2009 Selenium committers

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
 */

package org.openqa.selenium.remote.server.handler;

import org.openqa.selenium.remote.server.Session;

public class ClearElement extends WebDriverHandler<Void> {

  private volatile String elementId;

  public ClearElement(Session session) {
    super(session);
  }

  public void setId(String elementId) {
    this.elementId = elementId;
  }

  @Override
  public Void call() throws Exception {
    getKnownElements().get(elementId).clear();
    return null;
  }

  @Override
  public String toString() {
    String element = "unknown element";
    try {
      element = String.valueOf(getKnownElements().get(elementId));
    } catch (RuntimeException e) {
      // Be paranoid!
    }
    return String.format("[clear: %s %s]", elementId, element);
  }
}

@@ -711,14 +711,15 @@
  Web
-Driver
+Element
 Hand
@@ -735,46 +735,8 @@
  %7B%0A%0A
-  private volatile String elementId;%0A%0A
   pu
@@ -801,85 +801,8 @@
  %7D%0A%0A
-  public void setId(String elementId) %7B%0A    this.elementId = elementId;%0A  %7D%0A%0A
   @O
@@ -860,37 +860,16 @@
  get
-Known
 Element
-s().get(elementId
+(
 ).cl
@@ -942,188 +942,8 @@
 ) %7B%0A
-    String element = %22unknown element%22;%0A    try %7B%0A      element = String.valueOf(getKnownElements().get(elementId));%0A    %7D catch (RuntimeException e) %7B%0A      // Be paranoid!%0A    %7D%0A
     
@@ -975,36 +975,35 @@
 ear:
- %25s
  %25s%5D%22, 
-e
+getE
 lement
-Id, element
+AsString()
 );%0A 

Change ClearElement to be a subclass of WebElementHandler instead of WebDriverHandler