Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 358446 - text range issues when saving from JPA Details view
Summary: text range issues when saving from JPA Details view
Status: RESOLVED FIXED
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: JPA (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2   Edit
Assignee: Brian Vosburgh CLA
QA Contact:
URL:
Whiteboard: wtp4x
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-21 11:29 EDT by Karen Butzke CLA
Modified: 2012-02-16 18:03 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Karen Butzke CLA 2011-09-21 11:29:33 EDT
Using Eclipse 4.2 platform, follow these steps:
1. Make sure the Project Explorer has the 'Link with Editor' button selected. This just makes it possible to use ctrl->s from the JPA Details view. Otherwise use ctrl->shift->s to save.
2. Edit a Java entity through the JPA Details view and add a named query setting only the name. Select the java editor and save. There should be a validation error with the text range on the query name.
3. Now return to the JPA Details view and edit the query name making it longer. Save using ctrl->s without returning to the java editor. Notice that the text range for the validation error is the length of the original query name instead of the new name.

This is a minor issue, but one that could become more problematic as we continue to change to caching textRanges instead of building them on demand during validation. This is related to the focus listener we setup in JptJpaUiPlugin where we stop listening to java events when the JPA details view has focus. Using Eclipse platform 3.x when you save using ctrl-s in the details view, the focus goes to the editor momentarily and then goes back to the jpa details view. This causes us to resync with the java model and rebuild that text range. This does not happen on Eclipse platform 4.x. I am not sure whether the 3.x platform functionality is a feature or a bug, they might not be doing this on purpose.
Comment 1 Brian Vosburgh CLA 2012-02-16 18:03:20 EST
Fixed alongside major changes to the JpaProjectManager and checked into HEAD.