| Summary: | Misleading 'unused' variable indicated by the code | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Jonathan Camilleri <camilleri.jon> | ||||
| Component: | Text | Assignee: | JDT-Text-Inbox <jdt-text-inbox> | ||||
| Status: | RESOLVED INVALID | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | daniel_megert | ||||
| Version: | 3.7 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows XP | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Created attachment 199386 [details]
Source code
Your example is broken because if you add a @SuppressWarnings("unused") then no warning will be shown.
Having said that, in 3.7 the warning says that the *value* is not used.
(In reply to comment #2) > Your example is broken because if you add a @SuppressWarnings("unused") then no > warning will be shown. > > Having said that, in 3.7 the warning says that the *value* is not used. That's correct, I used @SuppessWarnings simply to avoid having the error being displayed temporarily. Having said that, I am not sure why my bug is invalid. (In reply to comment #3) > (In reply to comment #2) > > Your example is broken because if you add a @SuppressWarnings("unused") then no > > warning will be shown. > > > > Having said that, in 3.7 the warning says that the *value* is not used. > > That's correct, I used @SuppessWarnings simply to avoid having the error being > displayed temporarily. When attaching a test case it would be easier if the test case by itself would show the problem that you try to report. >Having said that, I am not sure why my bug is invalid. Because the message is correct in 3.7. (In reply to comment #4) > (In reply to comment #3) > > (In reply to comment #2) > > > Your example is broken because if you add a @SuppressWarnings("unused") then no > > > warning will be shown. > > > > > > Having said that, in 3.7 the warning says that the *value* is not used. > > > > That's correct, I used @SuppessWarnings simply to avoid having the error being > > displayed temporarily. > When attaching a test case it would be easier if the test case by itself would > show the problem that you try to report. > > >Having said that, I am not sure why my bug is invalid. > Because the message is correct in 3.7. I think you have not understood the issue from my point of view. |
Build Identifier: M20110210-1200 A warning is displayed regarding the nBytes declaration: The local variable nBytes is never read: ... @SuppressWarnings("unused") int nBytes = socket.read(buf); //here's nBytes... ... See (L129-L130 of attached file within NonBlockingServer.java. Reproducible: Always