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 215449 - IndexOutOfBoundsException in RepositoryTranslatorImpl.getFileNameById
Summary: IndexOutOfBoundsException in RepositoryTranslatorImpl.getFileNameById
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 7.3
Hardware: All All
: P2 normal (vote)
Assignee: Vladimir Kvashin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-12 10:00 UTC by Vladimir Kvashin
Modified: 2012-07-19 03:30 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
tack (5.21 KB, application/octet-stream)
2012-07-12 10:00 UTC, Vladimir Kvashin
Details
stack (5.21 KB, text/plain)
2012-07-12 10:42 UTC, Vladimir Kvashin
Details
Another stack (3.39 KB, text/plain)
2012-07-16 09:42 UTC, Vladimir Kvashin
Details
More stacks that are slightly different (11.96 KB, text/plain)
2012-07-18 04:11 UTC, Vladimir Kvashin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Kvashin 2012-07-12 10:00:08 UTC
Created attachment 121959 [details]
tack

Discovered in tests log, seems not to be quite stable.
Was most likely introduced by my recent changes.

java.lang.IndexOutOfBoundsException: Index: 9, Size: 0

java.util.ArrayList.RangeCheck(ArrayList.java:547)
java.util.ArrayList.get(ArrayList.java:322)
org.netbeans.modules.cnd.repository.util.IntToStringCache.getValueById(IntToStringCache.java:166)
org.netbeans.modules.cnd.repository.translator.RepositoryTranslatorImpl.getFileNameById(RepositoryTranslatorImpl.java:114)
org.netbeans.modules.cnd.apt.utils.APTSerializeUtils.getFileNameById(APTSerializeUtils.java:110)
org.netbeans.modules.cnd.apt.utils.APTSerializeUtils.readFileNameIndex(APTSerializeUtils.java:121)
org.netbeans.modules.cnd.apt.utils.APTSerializeUtils.readFileNameIndex(APTSerializeUtils.java:128)
org.netbeans.modules.cnd.apt.support.StartEntry.<init>(StartEntry.java:101)


See full stack in the attachment
Comment 1 Vladimir Kvashin 2012-07-12 10:42:28 UTC
Created attachment 121961 [details]
stack
Comment 2 Quality Engineering 2012-07-13 04:04:21 UTC
Integrated into 'main-golden', will be available in build *201207130002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/b27061779b72
User: Vladimir Kvashin <vkvashin@netbeans.org>
Log: better diagnostic for #215449 - IndexOutOfBoundsException in RepositoryTranslatorImpl.getFileNameById
Comment 3 Vladimir Kvashin 2012-07-16 09:42:17 UTC
Created attachment 122053 [details]
Another stack
Comment 4 Vladimir Kvashin 2012-07-18 04:11:33 UTC
Created attachment 122130 [details]
More stacks that are slightly different
Comment 5 Vladimir Kvashin 2012-07-18 07:06:30 UTC
fixed:
http://hg.netbeans.org/cnd-main/rev/098f6532e291
Comment 6 Vladimir Kvashin 2012-07-18 10:45:21 UTC
Although the cases that I knew are fixed, a new one appeared. A very similar stack appears when removing and recreating a project exactly in the same place.

Investigation shows that if a project has been removed (either from IDE or from command line between IDE sessions) and then recreated in the same place, then, when instantiating, code model tries to load the existing one from cache, which is obviously incorrect.

This should be the reason of new stacks (I wasn't able to 100%  reproduce situation, that's why I'm not 100% sure)
Comment 8 Quality Engineering 2012-07-19 03:30:18 UTC
Integrated into 'main-golden', will be available in build *201207190002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/098f6532e291
User: Vladimir Kvashin <vkvashin@netbeans.org>
Log: fixed #215449 - IndexOutOfBoundsException in RepositoryTranslatorImpl.getFileNameById