This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 99661

Summary: AIOOBE when creating empty java file
Product: java Reporter: Jiri Prox <jiriprox>
Component: SourceAssignee: Jan Lahoda <jlahoda>
Status: VERIFIED FIXED    
Severity: blocker CC: jskrivanek, msauer, ppis
Priority: P1 Keywords: T9Y
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 99509    
Attachments: full stacktrace

Description Jiri Prox 2007-04-02 10:54:15 UTC
NetBeans IDE Dev (Build 200704011800)
1.6.0; Java HotSpot(TM) Client VM 1.6.0-b105
Linux version 2.6.5-1.358 running on i386
en_US (nb); UTF-8

AIOOBE thrown when creating empty java file

Steps to reproduce:
1) New File
2) Java Classes -> Empty Java File
3) confirm dialog
->
java.lang.ArrayIndexOutOfBoundsException: 1
	at com.sun.tools.javac.util.Position$LineMapImpl.build(Position.java:149)
	at com.sun.tools.javac.util.Position.makeLineMap(Position.java:63)
	at com.sun.tools.javac.parser.Scanner.getLineMap(Scanner.java:1122)
Comment 1 Jiri Prox 2007-04-02 10:55:00 UTC
Created attachment 40249 [details]
full stacktrace
Comment 2 Max Sauer 2007-04-17 11:24:22 UTC
This also happens when updeating a versioned project and a new file is created
on local.

---
NetBeans IDE Dev (Build 200704161800)
1.6.0_01; Java HotSpot(TM) Client VM 1.6.0_01-b04
SunOS version 5.10 running on sparc
en (nb); ISO646-US
Comment 3 Jiri Skrivanek 2007-04-19 14:16:03 UTC
Increasing prority because it blocks UI automated tests.
Comment 4 Pavel Flaska 2007-04-19 15:34:45 UTC
Not reproducible on my machine.
Comment 5 Jiri Prox 2007-04-19 15:49:14 UTC
I can reproduce it in current continuous build

NetBeans IDE Dev (Build 20070419-1146)
1.6.0_02-ea; Java HotSpot(TM) Client VM 1.6.0_02-ea-b02
Linux version 2.6.5-1.358 running on i386
en_US (nb); UTF-8

NetBeans IDE Dev (Build 20070419-1330)
1.6.0; Java HotSpot(TM) Client VM 1.6.0_02-b105
Windows XP version 5.1 running on x86
cs_CZ (nb); Cp1250
Comment 6 Jan Lahoda 2007-04-20 08:43:47 UTC
*** Issue 100859 has been marked as a duplicate of this issue. ***
Comment 7 Peter Pis 2007-04-24 12:41:31 UTC
Increasing priority to P1. 

Happens while viewing diff in "Search History" for dead revisions of versioned
files.
Comment 8 Petr Hrebejk 2007-04-24 17:39:52 UTC
Seatch history works fine for me. If you are incresing priority please add steps
to reproduce. Creating empty java file works in current build as well. Clearly
not P1
Comment 9 Jan Lahoda 2007-04-24 18:04:16 UTC
Reproducible for me while creating a New "empty" Java file (it contains one
newline). Actually, the problem occurs for every Java file that is non-empty and
contains only '\n' (easily reproducible easily in unit tests). So, if Peter
considers this to be a showstopper, I do not have any objections -> P1.
Comment 10 Jan Lahoda 2007-04-24 18:09:39 UTC
Should be fixed now. Folks, please verify carefully. Thanks.
Checking in javac-impl.jar;
/cvs/java/external/javac-impl.jar,v  <--  javac-impl.jar
new revision: 1.46; previous revision: 1.45
done
Comment 11 Peter Pis 2007-04-25 12:11:38 UTC
Works fine for me now. Thanks for the fix.

NetBeans IDE Dev (Build 20070425-0528)
1.6.0-rc; Java HotSpot(TM) Client VM 1.6.0-rc-b101
Windows XP version 5.1 running on x86
en_GB (nb); Cp1252
Comment 12 Jan Lahoda 2007-05-03 04:43:14 UTC
*** Issue 102246 has been marked as a duplicate of this issue. ***
Comment 13 Jiri Prox 2007-06-04 13:18:16 UTC
v.