Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #2183 from jglick/SezpozModule-unique-ID-JENKINS-3…
…3772

[JENKINS-33772] ID was not sufficiently unique for SezpozModule
  • Loading branch information
jglick committed Mar 29, 2016
2 parents 62d0e0c + 1a28593 commit 52bb332
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 52bb332

Please sign in to comment.