gordonad / powermock

Automatically exported from code.google.com/p/powermock
0 stars 0 forks source link

findConstructorOrThrowException and findMethodOrThrowException have critical bugs #34

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
findConstructorOrThrowException in Whitebox have two critical bugs which
effects other parts of PowerMock (for example createPartialMock). 
1:
if (!paramTypes[i].equals(arguments[i].getClass())) {
    wrappedConstructorFound = false;
    break;
}
Solution: arguments[i].getClass() must be changed to
getUnmockedType(arguments[i].getClass())

2: 
The findPrimitiveMethodOrConstructor should be renamed to
hasWrapperArguments(return value must change from true to false)
If a primitive constructor is found parameter checking must take place!!!
This doesn't happen today!!

Original issue reported on code.google.com by johan.ha...@gmail.com on 24 Oct 2008 at 9:36

GoogleCodeExporter commented 9 years ago
createPartialMock now works as expected

Original comment by johan.ha...@gmail.com on 26 Oct 2008 at 7:59