- **status**: open --> open-fixed
- **assigned_to**: Bernd Sahre
- **Comment**:

It would be nice if the author of the patches would update the bug tracker and 
not someone else of the current staff.

 3cb588ed45f708163a6a9d853308c52616910776



---

** [bugs:#868] IntelliJ Modules are not shared correctly**

**Status:** open-fixed
**Group:** OTHER
**Labels:** Intellij 
**Created:** Mon Sep 05, 2016 02:02 PM UTC by Bernd Sahre
**Last Updated:** Mon Oct 17, 2016 05:18 PM UTC
**Owner:** Bernd Sahre


**Description**:
Host Alice has a Module which contains a test folder, sources folder, and a 
<modulename>.iml file. There are two classes in the src folder.
If the Host shares this Module in Intellij with Bob, Bob gets all the files 
(.java and .iml) but not the whole Module.
Problem 1: The folders containing the files are only shown as directories, 
independent of their host-side status (e.g. Module, src folder, test folder, 
etc.).  As a result, Bob cannot create classes (as it's only possible in Java 
Module src folders, not in plain directories). 
Problem 2: Empty folders are not transmitted.

**Problem-Analysis**:
Comparing the two projects of Alice and Bob, the result is following:

In the _.idea_ folder (which contains the project meta data), there are 
differences in

* _misc.xml_
* _workspace.xml_
* _modules.xml_

All other files are equivalent (except for own system configurations).

In the _modules.xml_ file all Modules of the project are listed, and the 
transmitted Modul does not appear there. After copying the _module.xml_ file 
from the Host to the client the corresponding module is shown correctly.

Another Problem (not solved with the Approach to Solution) is that nested 
Modules (Modules in Modules) are not transmitted correctly, because its hard to 
compute the path to the inner .iml file.

**Approach to solution**

Intellij provides a _ModuleManager_ through the OpenAPI, which has a method 
"loadModule" to load a Module from an .iml file and add it to the project. This 
solves the problem.
To call this method, it is recommend to register a new class in the 
SarosLifeCycleListener and the Picocontainer so the method is called every time 
when Ressources are shared.
It is also appropiate to embed this method with

~~~java
ApplicationManager.getApplication().invokeLater(new Runnable() {
    @Override
    public void run() {
        ApplicationManager.getApplication().runWriteAction(new Runnable() {
            loadModule(filepath);
            ....
~~~

to secure thread safety.


---

Sent from sourceforge.net because dpp-robot@lists.sourceforge.net is subscribed 
to https://sourceforge.net/p/dpp/bugs/

To unsubscribe from further messages, a project admin can change settings at 
https://sourceforge.net/p/dpp/admin/bugs/options.  Or, if this is a mailing 
list, you can unsubscribe from the mailing list.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
DPP-Robot mailing list
DPP-Robot@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dpp-robot

Reply via email to