cornercorner
FeaturesPluginsDocs & SupportCommunityPartners

Bug 119456 - Show Annotations throws SIOOBE.
: Show Annotations throws SIOOBE.
Status: VERIFIED FIXED
: versioncontrol
Mercurial
: 6.1
: All All
: P3 (vote)
: 6.1
Assigned To:
:
:
:
:
:
:
  Show dependency treegraph
 
Reported: 2007-10-19 10:30 by
Modified: 2008-01-03 09:40 (History)
Issue Type: DEFECT
:


Attachments
messages.log (121.76 KB, text/plain)
2007-10-19 14:20, Peter Pis
Details
proposed patch (2.61 KB, patch)
2007-10-22 18:52, Padraig Obriain
Details | Diff
proposed patch (4.05 KB, patch)
2007-10-23 15:44, Padraig Obriain
Details | Diff


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2007-10-19 10:30:02
Product Version: NetBeans IDE 6.0 Beta 2 (Build 200710181000)
Java: 1.6.0_03; Java HotSpot(TM) Client VM 1.6.0_03-b05
System: Windows XP version 5.1 running on x86; Cp1252; en_GB (nb)
Userdir: D:\ide\60beta\user
Mercurial plugin        = 1.4.0.42.1

Steps:
1. Clone project and open it.
2. Add/Commit some files in to the original repository.
3. Select the cloned project and invoke "Mercurial | Pull from" action.
4. Confirm dialog. Files are added - (anyway they are locally modified - is it
ok)
5. Select such a file and invoke "Mercurial | Show Annotations" actions.

SOOBE is thrown.

SEVERE [org.openide.util.RequestProcessor]
java.lang.StringIndexOutOfBoundsException: String index out of range: -76
        at java.lang.String.substring(String.java:1938)
        at
org.netbeans.modules.mercurial.ui.annotate.AnnotateAction.toAnnotateLines(AnnotateAction.java:254)
        at
org.netbeans.modules.mercurial.ui.annotate.AnnotateAction.computeAnnotations(AnnotateAction.java:168)
        at
org.netbeans.modules.mercurial.ui.annotate.AnnotateAction.access$000(AnnotateAction.java:76)
        at
org.netbeans.modules.mercurial.ui.annotate.AnnotateAction$1.perform(AnnotateAction.java:144)
        at
org.netbeans.modules.mercurial.HgProgressSupport.performIntern(HgProgressSupport.java:96)
        at
org.netbeans.modules.mercurial.HgProgressSupport.run(HgProgressSupport.java:89)
        at
org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561)
[catch] at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986)
------- Comment #1 From 2007-10-19 11:41:03 -------
I am confused by Step 4 here.

What files are Locally Modified?

This sounds wrong.

Can you supply what is output in the Mercurial tab and the contents of the
messages.log file
with -J-Dorg.netbeans.modules.mercurial.level=100 added to
netbeans_default_options in etc/netbeans.conf
------- Comment #2 From 2007-10-19 12:10:45 -------
Step 4. - there was a dialog whether I'd want to update the sources. Currently
I am switched to "VSS" support (VCS
generics so mercurial plugin is disabled, unfortunately user dir has been
deleted) Later I will try to reproduce it and
attach all required information.
------- Comment #3 From 2007-10-19 14:20:47 -------
Created an attachment (id=51293) [details]
messages.log
------- Comment #4 From 2007-10-19 14:28:42 -------
Steps:
1. Create new project. (Project)
2. Select it and invoke "Versioning | Mercurial | Init" action on it.
3. Create a clone of it. (Project_clone)
4. (Project) - create new package and JFrame in it and commit changes.
5. (Project_clone) - select the project root and invoke "Pull from default"
action. Confirm "Merge after Pull" dialog -
"Yes".

"Project_clone" - shows also the new JFrame - it's locally modified. Invoking
"Mercurial | Show Annotations" action
leads to SIOOBE.
------- Comment #5 From 2007-10-22 18:52:26 -------
Created an attachment (id=51427) [details]
proposed patch
------- Comment #6 From 2007-10-22 18:53:22 -------
Tnis patch is for a different issue.
------- Comment #7 From 2007-10-23 10:53:24 -------
I have looked at the message log and I see you creating a new project. However,
before the project is created I see
evidence that the project is in the cache. is this possible? Did you previously
have a project of that name?

At what point did you invoke Status and on what project?
I see evidence that it was open when you created the project.

From the message log I see that you did a initial commit before doing the
clone.
I also see that the creation of the new package (a) and new file
(NewClass.java) happened in the cloned project.
I then see a push from the cloned project to the original project.
I then see another new package (b) and a new file NewInterface.java being added
to the cloned project.

Then a new package (c) and new files NewJPanel.java and NewJPanel.form are
added to the original project.
Then pull from original project.

We get two heads and the file in package c in cloned project is listed as
Locally Modified.
When I attempt to annotate it I get the SOOBE.
------- Comment #8 From 2007-10-23 11:57:44 -------
The problem is that the hg annotate call fails with "No such file" error
because the file being annotated is not in the
revision being used by default for hg annotate.

We do not catch the error which explains why we get the SIOOBE.

I think that the solution is to catch the error and in that case, find the
latest revision which contains the file and
annotate that.
------- Comment #9 From 2007-10-23 13:55:09 -------
> before the project is created I see evidence that the project is in the cache. is this possible?

yes, you are right.

> At what point did you invoke Status and on what project?

I've invoked it on project's root node. I could happen that it was invoked for
the closed project but then I've run
"Status" on the opened one when I wanted to see current status.
------- Comment #10 From 2007-10-23 15:44:50 -------
Created an attachment (id=51504) [details]
proposed patch
------- Comment #11 From 2007-10-23 15:50:50 -------
bash-3.00$ cat output 
IDE:-------------------------------------------------
IDE: [10/23/07 3:49 PM] Committing "HgCommand.java" started
Checking in HgCommand.java;
/shared/data/ccvs/repository/versioncontrol/mercurial/src/org/netbeans/modules/mercurial/util/HgCommand.java,v
 <-- 
HgCommand.java
new revision: 1.48; previous revision: 1.47
done
IDE: [10/23/07 3:49 PM] Committing "HgCommand.java" finished
------- Comment #12 From 2007-10-25 15:16:21 -------
Verified.