Find all classes that are not @Autowired
<p>I have a big spring web application which uses annotations. However, there are some classes which are annotated with @component/service but are not autowired from where they are called. Instead, new operator is used. </p>

<p>I want to find out all such instances of user-defined classes where the new operator is used.</p>

<p>Basically, I created a new Http wrapper class (spring component) and I'm having it called from multiple places in the application. Some place it works because the auto wiring to it works because the containing class and the classes from the beginning of the chain are managed by spring. But some places it doesn't work because one of the classes in the calling chain was instantiated using new and is not spring managed. So I want to fix this and make such classes are also spring managed.</p>

<p>I'm talking about 100s of classes, so please suggest a tool or method that can be done in 3-4 hours and prevents human errors. I use eclipse.</p>

<p>Example:</p>

<pre><code>@Component
public class MyHttpClient {

    public int execute() {
        ...
    }
}

@Component
public class UtilC {

    @Autowired
    private MyHttpClient client;

    public int methodC() {
        // When methodC is called from A, it works
        // but when called from B, it gives NullPointerException
        client.execute();
    }
}

@Component
public class UtilB {

    private UtilC c = new UtilC();

    public int methodB() {
        c.methodC();
    }
}

@Component
public class UtilA {

    @Autowired
    private UtilC c;

    public int methodA() {
        c.methodC();
    }
}
</code></pre>

<p>Please do not suggest this:</p>

<pre><code> @Component
 public class UtilC {

     @Autowired
     private MyHttpClient client;

     public int methodC() {
         try {
             client.execute();
         } catch(NullPointerException npe) {
             new MyHttpClient.execute();
         }
     }
 }
</code></pre>

<p>How do I search for all the user defined classes which are instantiated like new UtilC</p>