Bug 6203 - SEVERE: typing in java editor causes OutOfMemoryError in JDK 1.4
Summary: SEVERE: typing in java editor causes OutOfMemoryError in JDK 1.4
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P1 critical (vote)
Target Milestone: ---   Edit
Assignee: Kai-Uwe Maetzel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-11-21 17:38 EST by John Arthorne CLA
Modified: 2001-12-04 12:25 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Arthorne CLA 2001-11-21 17:38:21 EST
I am using build 20011120 with Sun JDK 1.4.0 Beta.

- Open a java file in a java editor
- somewhere inside a class, type a character
- OutOfMemoryError occurs.

Here is what happens:

WordRule.evaluate has a while loop that scans characters, and appends them to a 
buffer if they are a valid word part.  When the scanner reaches the end, it 
returns "-1".

The method that gets called is 
org.eclipse.jdt.internal.ui.text.JavaWordDetector, which calls 
Character.isJavaIdentifierPart.

On JDK 1.4.0, Character.isJavaIdentifierPart(-1) returns true!  This causes an 
infinite loop and eventual OutOfMemoryError.
Comment 1 Erich Gamma CLA 2001-12-04 05:40:52 EST
I could not reproduce the behaviour on JDK 1.4.

Kai pls investigate whether the analyisis from John is correct.
Comment 2 Kai-Uwe Maetzel CLA 2001-12-04 12:25:45 EST
Build >= 20011204.