Priority
Normal
Type
Bug 
State
Fixed 
Assignee
Maxim Mossienko 
Subsystem
Plugin Support. API 
Affected versions
Fixed in
Fixed in build
Next build 
Build
7549
Fixed in build
7601
Subsystems
0, 0
  • Submitted by   Sascha Weinreuter
    2 years ago (19 Nov 2007 22:07)
  • Updated by   root
    3 weeks ago (17 Jan 2010 19:55)
  • Jira: IDEA-42058
    (history, comments)

IDEA-42058

XML validation result displays incorrect line- and column numbers

0
Added by <no user>
15 Sep 2009
screenshot-2.jpg   (22 KB)
Added by <no user>
15 Sep 2009
screenshot-1.jpg   (27 KB)

See the screenshot. The numbers are off by one.

The problem is in com.intellij.ide.errorTreeView.ErrorViewStructure#addMessage (called from com.intellij.ide.errorTreeView.NewErrorTreeViewPanel#addMessage): The passed line- and column numbers are zero-based as the OpenFileDescriptor expects them, but at the same time they are included in the displayed message that's supposed to be "human readable". I guess createExportPrefix() and createRendererPrefix() should take care of that.

Issue was closed
Comments (11)
 
History (1)
 
Links
 
Maxim Mossienko
  Maxim Mossienko
19 Nov 2007 22:34
(2 years ago)
#permalink
Please, report the problem to Xerces developers. IDEA binds Xerces messages to correct place
Maxim Mossienko
  Maxim Mossienko
19 Nov 2007 22:39
(2 years ago)
#permalink
Btw, does RelaxNG external validator has the same problem?
Sascha Weinreuter
  Sascha Weinreuter
19 Nov 2007 22:41
(2 years ago)
#permalink
Geez, this is not a Xerces problem at all. IDEA does navigate to the correct place, it just displays the wrong numbes.
Sascha Weinreuter
  Sascha Weinreuter
19 Nov 2007 22:43
(2 years ago)
#permalink
bq. Btw, does RelaxNG external validator has the same problem?

I'm not running the validator but using the message view to display messages when converting schemas between RNG, XSD, etc. with Trang.
Maxim Mossienko
  Maxim Mossienko
19 Nov 2007 22:54
(2 years ago)
#permalink
My bad.
Exact message from Xerces validator is not used for Message View
Sascha Weinreuter
  Sascha Weinreuter
19 Nov 2007 23:09
(2 years ago)
#permalink
No problem, maybe my report was not specific enough - I thought the issue should be obvious when looking at the code.

If you're going to add 1 in in the create*Prefix methods, make sure you update their usages from com.intellij.openapi.vcs.impl.AbstractVcsHelperImpl as well ;)
Sascha Weinreuter
  Sascha Weinreuter
12 Dec 2007 19:49
(2 years ago)
#permalink
Just to make this sure: Only the displayed numbers are incorrect, not the location IDEA navigates to when double-clicking the message. Please don't make it navigate to the wrong location now ;)
Maxim Mossienko
  Maxim Mossienko
12 Dec 2007 20:05
(2 years ago)
#permalink
Surely, only render prefix was changed :)
Sascha Weinreuter
  Sascha Weinreuter
13 Dec 2007 12:10
(2 years ago)
#permalink
OK, I see. But now the file-icon changed from the XML filetype icon to a Java icon because now there's no VirtualFile to get the icon from.

Why didn't you fix it as suggested in com.intellij.ide.errorTreeView.ErrorViewStructure#addMessage? That code is in fact broken because it uses the same numbers for both display and navigation which will always cause a one-off error.

This would have solved the issue without accidentally changing the icon and would have also fixed any other uses of com.intellij.ide.errorTreeView.NewErrorTreeViewPanel#addMessage - including mine. :(
Maxim Mossienko
  Maxim Mossienko
13 Dec 2007 23:41
(2 years ago)
#permalink
Will be fine in next build :)
Sascha Weinreuter
  Sascha Weinreuter
14 Dec 2007 13:19
(2 years ago)
#permalink
Thanks a lot Maxim, works fine now. However the ValidateXml action still shows a Java icon in Selena. Diana seems to be OK though ;)

Isn't it amazing how much trouble a simple +/- 1 problem can cause? :)