Ambiguous Comparison Hint
- by Ondrej Brejla
Hi everybody! Today we would like to show you some new hint which will be available in NetBeans 7.3. It's called Ambiguous Comparison hint.
Its name seems to be quite fuzzy, but it describes exactly what the hint does. It tries to check all comparisons whether they are intended. Because sometimes you want to make a simple assignment, but you make a typo and comparison appears. It's really dangerous mistake because then your code doesn't work as expected. Your application can produce buggy results. So here is how it looks like:
But sometimes a comparison is really intended. E.g. in return statements when you want to return a boolean, so then the hint works as expected and no warning appears.
That's all for today and as usual, please test it and if you find something strange, don't hesitate to file a new issue (component php, subcomponent Editor). Thanks.