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 234916 - removing dependencies from library node in project window
Summary: removing dependencies from library node in project window
Status: NEW
Alias: None
Product: platform
Classification: Unclassified
Component: Text (show other bugs)
Version: 7.4
Hardware: PC Linux
: P3 normal (vote)
Assignee: Miloslav Metelka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-24 04:28 UTC by williambacchi
Modified: 2013-08-28 13:04 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description williambacchi 2013-08-24 04:28:26 UTC
I was following TS 73 ApiSupportSanity with jdk 1.7.0_25 on 201308202300 ide build. If I remove a dependency from project.xml it is correctly removed from libraries node. If I add again the dependency in project.xml it is correctly added to libraries node. After this if I try to remove the dependency from libraries node I get an IllegalArgumentException: bad position.
Comment 1 Martin Kozeny 2013-08-28 12:05:21 UTC
You can only add dependency, then open project.xml and place caret and the last line. After that remove that dependency and you get also an IllegalArgumentException: bad position. Problem is with caret position, b/c project.xml file is modified (shortened) and after refresh it is not possible to place caret back to nonexistent position.
Comment 2 Martin Kozeny 2013-08-28 13:03:57 UTC
Problem is probably in openide.text DocumentOpenClose.DocumentLoad.run()->atomicLockedRun() in

for (int i = 0; i < reloadCaretOffsets.length; i++) {
   try {
      caretPositions[i] = loadDoc.createPosition(reloadCaretOffsets[i]);
   } catch (BadLocationException ex) {
      caretPositions[i] = loadDoc.getEndPosition();
   }
}

b/c loadDoc.createPosition(reloadCaretOffsets[i]) fails and returning an end position of caret comes from the old file. Returning loadDoc.getSartPosition() would help.
Comment 3 Martin Kozeny 2013-08-28 13:04:40 UTC
Reassigned to default owner.