BUG: Java Compiler Does Not Report Case Labels Out of RangeLast reviewed: January 29, 1998Article ID: Q162108 |
The information in this article applies to:
SYMPTOMSWhen using an integral type for a switch statement, the Microsoft Java Compiler, Jvc.exe, does not report if a case label is out of range.
RESOLUTIONTo work around this problem, you need to manually check that all integral types are within range.
STATUSMicrosoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
MORE INFORMATION
Steps to Reproduce BehaviorThe following code reproduces this problem:
public class IntegralTest { public static void main(String args[]) { byte b = 127; //byte range from -128 to 127 switch(b) { case 256: //should be a compile-time error } } } REFERENCESFor the latest Knowledge Base articles and other support information on Visual J++ and the SDK for Java, see the following page on the Microsoft Technical Support site:
http://support.microsoft.com/support/visualj/ http://support.microsoft.com/support/java/ Keywords : kbtool CmdLnUtils VJGenIss Technology : kbInetDev Version : 1.0 1.1 Platform : WINDOWS Issue type : kbbug |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |