frjaeger220 / google-guice

Automatically exported from code.google.com/p/google-guice
Apache License 2.0
0 stars 0 forks source link

ServletModule should have .equals() and .hashCode() implementations #228

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
When combining several features that provide guice modules that can only be
used with Guice's ServletModule, I find that I must explicitly include "new
ServletModule()" in the list of modules that go into my guice injector,
even if I don't intend to use request scope directly.

It would be nice if each of these features could just install() their
dependencies directly.  Unfortunately, as ServletModule has no equals() or
hashCode(), doing so would result in lots of multiple bindings errors.

Please add these, or something very similar, to ServletModule:

@Override
public boolean equals(Object other) {
  return other != null && other.getClass().equals(getClass());
}

@Override
public int hashCode() {
  return getClass().hashCode();
}

Original issue reported on code.google.com by d...@google.com on 5 Aug 2008 at 2:48

GoogleCodeExporter commented 9 years ago
ServletModule will no longer be used. The new solution will be sensitive to 
duplicate bindings and not fail when 
bound from multiple library modules. Marking as WontFix. (but it will be... =)

See issue #239

Original comment by dha...@gmail.com on 28 Nov 2008 at 8:39