Is it possible to extend a Java class with one having the same name
<p>I'm working with a ridiculously large codebase and need to move a file from one package to another. However, I do not have the whole codebase locally, so I am not sure if I have found and updated every reference to the original file. In order to ensure that I don't break anything, I would like to leave the original file, and simply have it extend the new file that I created. Ideally, they'd both have the exact same name. Overtime, I plan to deprecate and remove the old file, but for now this seems like the most robust solution. However, I cannot figure out how to get it to work in Java.</p>

<p>Here is the new class:</p>

<pre><code>package myproject.util.http;

import javax.servlet.http.HttpServlet;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public abstract class MyServlet extends HttpServlet
{

    public void service (HttpServletRequest  request,
                         HttpServletResponse response)
            throws ServletException, IOException
    {
        // implementation of service
    }

}
</code></pre>

<p>Here is the old class that extends the new:</p>

<pre><code>package myproject.util.net;

import myproject.util.http.MyServlet;

public abstract class MyServlet extends myproject.util.http.MyServlet
{
// this class was deprecated, use myproject.util.http.MyServlet instead
}
</code></pre>

<p>Unfortunately, I get the error:</p>

<pre><code>MyServlet is already defined in this compilation unit
</code></pre>

<p>Is this possible, or am I going to have to come up with a new name for the parent class.</p>
