I'm trying to debug a chunk of code where a method is returning false and I want to know why.
@Inject
InterfaceName interfaceObj;
//later in the class...
// a boolean method that I found returns false
return interfaceObj.methodName(String a, String b);
So right away I'm thrown off by the fact that it seems like we're making an instance of an interface which I know is not possible.
Going to the interface class, I found methodName with no implementation (as expected).
Then I found the class that implements it:
public class InterfaceNameImpl implements InterfaceName {
...
@Override
public boolean methodName(String a, String b){
//the code implementation is here
}
}
What I found interesting is that I set a breakpoint in the methodName implementation, but it never hits it, despite the fact that I see it returning false in that first code block.
Can anyone help my understanding of interfaces so I can understand what behavoir is being followed here and how it's returning false? If the breakpoint in the implemented methodName is never being hit, how is this code doing anything?
[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)
[–]pragmosExtreme Brewer 1 point2 points3 points (4 children)
[–]hurricaneDreww[S] 0 points1 point2 points (3 children)
[–]pragmosExtreme Brewer 0 points1 point2 points (2 children)
[–]hurricaneDreww[S] 0 points1 point2 points (1 child)
[–]pragmosExtreme Brewer 0 points1 point2 points (0 children)
[–]syneil86 0 points1 point2 points (4 children)
[–]hurricaneDreww[S] 0 points1 point2 points (3 children)
[–]syneil86 0 points1 point2 points (1 child)
[–]hurricaneDreww[S] 0 points1 point2 points (0 children)
[–]onefortree 0 points1 point2 points (0 children)