I have come across an example I don't understand..
So, here is the problematic part:
Consider the integrals:
$ I = \int_C \frac{e^{iz}}{z} dz $
$ J = \int_C \frac{e^{-iz}}{z} dz $
Where $C,C_-, C_+$ are contours given as so:

In the example..
$ I = \int_C \frac{e^{iz}}{z} dz = \oint_{C_+} \frac{e^{iz}}{z} dz = 0 $ (since no poles enclosed) $ J = \int_C \frac{e^{-iz}}{z} dz = \oint_{C_-} \frac{e^{-iz}}{z} dz = -2\pi i $ (since pole at z=0 in $C_-$)
But J could also have been evaluated over $C_+$ (in which case the value would turn out to be $0$). Why the different answers?
The key point in the evaluation of $I$ or $J$ over $C$ (which is nearly just the real axis from minus to plus infinity), is that you are ignoring the contribution of the "return path" $C_+^{\text{top}}$. Why is this justified?
Well (a bit non-rigorously) at the far left or right sides of the figure the integrand goes to zero because of the $\frac{1}{z}$ (the numerator $e^{iz}$) is bounded in absolute value by $1$ along the real axis). The part of the curve at the top of the diagram also goes to zero, since if $z=x+iy$, for large positive $y$, we have $e^{i(x+iy)} = e^{ix} e^{-y} $, and $|e^{ix}$ is bounded while $e^{-y} \to 0$. So in both realms of $C_+^{\text{top}}$ the contribution to the integral goes to zero as the radius of $C_+^{\text{top}}$ becomes large. (This can of course be made more rigorous.)
So with a pole of $0$ we have $$0=\oint_{C_+} \frac{e^{iz}}{z} dz = \int_C \frac{e^{iz}}{z} dz + \int_{C_+^{\text{top}}} \frac{e^{iz}}{z} dz=\int_C \frac{e^{iz}}{z} dz + 0 $$
Similarly, along the return path $C_-^{\text{bottom}}$ the integrad for $J$ which has $|e^{-ix}|$ bounded and e$-{iy} \to 0$ as $y$ becomes very negative, the contribution of $C_-^{\text{bottom}}$ to $J$ is zero.
since we have a pole of strength 1 inside the path $C_-$ the value of $J$ will be $-2\pi$.
Now your question: What happens if we use path $C_+$ to evaluate $J$. Well, along the upper part of path $C_+^{\text{top}}$ the integrad $\frac{e^{-i(x+iy)}}{x+iy}$ , whose behavior is dominated by the $e^{-i(x+iy)}$, will become an integral of an oscillating integrad of magnitude $e^{+y}$. There is no reason why this integral $K$ should be zero (and in fact, it is not). So from this contour, all you know is that $$J + K = 0$$ which tells you nothing about the value of $J$.