[jbosstools-issues] [JBoss JIRA] (JBIDE-21791) Forge addon - Changing the current file may cause a "file has changed in file vs memory" issue in Eclipse

George Gastaldi (JIRA) issues at jboss.org
Tue Mar 1 11:08:00 EST 2016


    [ https://issues.jboss.org/browse/JBIDE-21791?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13170317#comment-13170317 ] 

George Gastaldi commented on JBIDE-21791:
-----------------------------------------

[~davsclaus],
Right now I believe the best solution is to save the open files before running a Forge command (as IDEA does right now). Mostly because commands may rely on changing other files (persistence.xml, web.xml, etc) and not having the latest version would not work. 

[~maxandersen] I agree that forcing to save the open files may not be ideal solution right now in a UX perspective.  
In a long term, as Forge works with the Resource API, the ideal choice would be to have a https://github.com/forge/core/blob/master/resources/api/src/main/java/org/jboss/forge/addon/resource/Resource.java implementation in Eclipse that delegates any call from Resource.getContents() to the editor contents (as setContents would set the Editor contents too), instead of fetching directly from the java.io.File. 

What do you guys think? Can we go with the "Save all" approach for now and have another JIRA as a future enhancement?  

> Forge addon - Changing the current file may cause a "file has changed in file vs memory" issue in Eclipse
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: JBIDE-21791
>                 URL: https://issues.jboss.org/browse/JBIDE-21791
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: forge
>    Affects Versions: 4.3.1.Beta2
>            Reporter: Claus Ibsen
>            Assignee: George Gastaldi
>             Fix For: 4.3.1.CR1
>
>         Attachments: eclipse-add.png
>
>
> Similar problem as FORGE-2605 but this time its in Eclipse.
> See the attached screenshot, where I have edited the file camel-context.xml, and then run my forge command, which would insert a Camel endpoint at the cursor position. But eclipse has detected a file conflict as in that dialog.
> I wonder if the fix should be like in IDEA to save the file before the command is run.



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the jbosstools-issues mailing list