Microsoft KB Archive/194901

= BUG: Visual J++ 6.0 May Crash When Opening a Large Java File =

Article ID: 194901

Article Last Modified on 8/25/2005

-

APPLIES TO


 * Microsoft Visual J++ 6.0 Standard Edition

-



This article was previously published under Q194901



SYMPTOMS
Visual Studio may crash while attempting to open a very large Java source file, or a project that contains a very large Java source file.



CAUSE
While processing the Java source code an internal stack overflow error may occur and cause Visual Studio to crash.



RESOLUTION
This can be avoided by breaking up any overly large Java class, method, or code block into smaller parts.



STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.



MORE INFORMATION
This problem happens when processing Java source code with many thousands of statements in a single block. Although programmers typically don't produce such large blocks of code, an automated process or program generator may produce code that the editor will fail to process.

Steps to Reproduce Behavior
The following program will generate a file called "BadFile.java" when run. Opening the generated file "BadFile.java" will result in a crash in Visual Studio. public class MakeBadFile { public static void main(String args[]) {       try {         java.io.FileOutputStream stream; stream=new java.io.FileOutputStream("BadFile.java"); java.io.PrintStream ps = new java.io.PrintStream(stream); ps.println("class BadFile {"); ps.println(" public static void main(String args[]) {"); for (int i=0;i<70000;i++) ps.println("   System.out.println("+i+");"); ps.println(" }"); ps.println("}"); stream.flush; stream.close; } catch (Exception ex) { ex.printStackTrace; }    }   }

