Summary: | eclipse compiler fails with interesting code case | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | jon <whichever> |
Component: | Core | Assignee: | JDT-Core-Inbox <jdt-core-inbox> |
Status: | RESOLVED INVALID | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | ||
Version: | 3.2.2 | ||
Target Milestone: | 3.3 M6 | ||
Hardware: | Macintosh | ||
OS: | Mac OS X - Carbon (unsup.) | ||
Whiteboard: |
Description
jon
2007-03-06 18:54:08 EST
In this code: int len = 0; byte[] buf = new byte[BUFFER]; while ((len = is.read(buf, 0, BUFFER)) != -1) { } You actually don't read the variable len. So if you want to remove the warning, why don't you simply write: byte[] buf = new byte[BUFFER]; while (is.read(buf, 0, BUFFER) != -1) { } but I would say the right answer is probably to use the value of len in the while block. Otherwise you are simply reading from an input stream without ever doing anything with the data. Ok to close? Good point. closing! =) thanks for the quick response. |