Skip to content

Commit

Permalink
[FIXED JENKINS-33772] ID was not sufficiently unique for SezpozModule…
Browse files Browse the repository at this point in the history
…; use an ID based on the actual annotated element.
  • Loading branch information
jglick committed Mar 28, 2016
1 parent 6219c8f commit 1a28593
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions core/src/main/java/hudson/ExtensionFinder.java
Expand Up @@ -496,10 +496,7 @@ private void resolve(Class c) {
@SuppressWarnings({"unchecked", "ChainOfInstanceofChecks"})
@Override
protected void configure() {
int id=0;

for (final IndexItem<?,Object> item : index) {
id++;
boolean optional = isOptional(item.annotation());
try {
AnnotatedElement e = item.element();
Expand All @@ -524,8 +521,8 @@ protected void configure() {

resolve(extType);

// use arbitrary id to make unique key, because Guice wants that.
Key key = Key.get(extType, Names.named(String.valueOf(id)));
// make unique key, because Guice wants that.
Key key = Key.get(extType, Names.named(item.className() + "." + item.memberName()));
annotations.put(key,a);
bind(key).toProvider(new Provider() {
public Object get() {
Expand Down

0 comments on commit 1a28593

Please sign in to comment.