Program: 60412
Project: 60412
Buggy source:
/** 
 * Although   {@code String[].class} isn't equal to {@code newGenericArrayTypeImpl(String.class)}, Guice should treat these two types interchangeably.
 */
public void testArrayTypeCanonicalization(){
  final String[] strings=new String[]{"String_Node_Str"};
  final Integer[] integers=new Integer[]{1};
  Injector injector=Guice.createInjector(new AbstractModule(){
    protected void configure(){
      bind(String[].class).toInstance(strings);
      bind(new TypeLiteral<Integer[]>(){
      }
).toInstance(integers);
    }
  }
);
  assertSame(integers,injector.getInstance(Key.get(new TypeLiteral<Integer[]>(){
  }
)));
  assertSame(integers,injector.getInstance(new Key<Integer[]>(){
  }
));
  assertSame(integers,injector.getInstance(Integer[].class));
  assertSame(strings,injector.getInstance(Key.get(new TypeLiteral<String[]>(){
  }
)));
  assertSame(strings,injector.getInstance(new Key<String[]>(){
  }
));
  assertSame(strings,injector.getInstance(String[].class));
  try {
    Guice.createInjector(new AbstractModule(){
      protected void configure(){
        bind(String[].class).toInstance(new String[]{"String_Node_Str"});
        bind(new TypeLiteral<String[]>(){
        }
).toInstance(new String[]{"String_Node_Str"});
      }
    }
);
    fail();
  }
 catch (  CreationException expected) {
    assertContains(expected.getMessage(),"String_Node_Str" + getClass().getName(),"String_Node_Str" + getClass().getName(),"String_Node_Str");
    assertContains(expected.getMessage(),"String_Node_Str");
  }
  injector=Guice.createInjector(new AbstractModule(){
    protected void configure(){
      bind(String[].class).toInstance(strings);
      bind(new TypeLiteral<String[]>(){
      }
).toInstance(strings);
    }
  }
);
  assertSame(strings,injector.getInstance(Key.get(new TypeLiteral<String[]>(){
  }
)));
  assertSame(strings,injector.getInstance(new Key<String[]>(){
  }
));
  assertSame(strings,injector.getInstance(String[].class));
}

Fixed version (ground truth):
/** 
 * Although   {@code String[].class} isn't equal to {@code newGenericArrayTypeImpl(String.class)}, Guice should treat these two types interchangeably.
 */
public void testArrayTypeCanonicalization(){
  final String[] strings=new String[]{"String_Node_Str"};
  final Integer[] integers=new Integer[]{1};
  Injector injector=Guice.createInjector(new AbstractModule(){
    @Override protected void configure(){
      bind(String[].class).toInstance(strings);
      bind(new TypeLiteral<Integer[]>(){
      }
).toInstance(integers);
    }
  }
);
  assertSame(integers,injector.getInstance(Key.get(new TypeLiteral<Integer[]>(){
  }
)));
  assertSame(integers,injector.getInstance(new Key<Integer[]>(){
  }
));
  assertSame(integers,injector.getInstance(Integer[].class));
  assertSame(strings,injector.getInstance(Key.get(new TypeLiteral<String[]>(){
  }
)));
  assertSame(strings,injector.getInstance(new Key<String[]>(){
  }
));
  assertSame(strings,injector.getInstance(String[].class));
  try {
    Guice.createInjector(new AbstractModule(){
      @Override protected void configure(){
        bind(String[].class).toInstance(new String[]{"String_Node_Str"});
        bind(new TypeLiteral<String[]>(){
        }
).toInstance(new String[]{"String_Node_Str"});
      }
    }
);
    fail();
  }
 catch (  CreationException expected) {
    assertContains(expected.getMessage(),"String_Node_Str" + getClass().getName(),"String_Node_Str" + getClass().getName(),"String_Node_Str");
    assertContains(expected.getMessage(),"String_Node_Str");
  }
  injector=Guice.createInjector(new AbstractModule(){
    @Override protected void configure(){
      bind(String[].class).toInstance(strings);
      bind(new TypeLiteral<String[]>(){
      }
).toInstance(strings);
    }
  }
);
  assertSame(strings,injector.getInstance(Key.get(new TypeLiteral<String[]>(){
  }
)));
  assertSame(strings,injector.getInstance(new Key<String[]>(){
  }
));
  assertSame(strings,injector.getInstance(String[].class));
}