0

I am having an issue in Eclipse (with Dagger 1 still).

In dagger, for dependency injection (javax.inject), you create a Module class, with provides methods, like this:

@dagger.Module
class FooModule {
  @dagger.Provides
  Something provideSomething() {
    return new Something();
  }
}

And this will generate a class (using annotation processing) called FooModule$$ModuleAdapter$ProvideSomethingProvidesAdapter.

If I set a breakpoint in a provideSomething method in FooModule class (my code), Eclipse almost always actually stops on that same line number in the FooModule$$ModuleAdapter$ProvideSomethingProvidesAdapter class instead.

Does anyone know how to avoid this problem? I suspect this is likely an Eclipse issue where it is somehow is mapping the generated file to what it thinks is the "source" file, but that's of course not what I want.

Is there perhaps some setting in eclipse to avoid this problem?

Ben
  • 4,785
  • 3
  • 27
  • 39
  • Probably seeing some code involved would help give context. I, for one, have no idea what Dagger, ModulkeAdapter, provide*, etc. are – E-Riz Apr 15 '16 at 13:37
  • I added some sample code, but if you want to know more about dagger see http://square.github.io/dagger/ – Ben Apr 15 '16 at 13:48
  • The eclipse preference under Java | Compiler, "Add source file name to generated class file (used by the debugger)", was one thought - but that removes the association between all class files, which is definitely not what I want to do. – Ben Apr 15 '16 at 16:23

0 Answers0