Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Today's Messages (on)  | Unanswered Messages (off)

Forum: Oomph
 Topic: Import project formatter profile
Re: Import project formatter profile [message #1522277 is a reply to message #1517496] Mon, 22 December 2014 07:57
Laurent Redor is currently offline Laurent RedorFriend
Messages: 50
Registered: July 2009
Member
Hi Eric,

Le 19/12/2014 15:42, Eric Rizzo a écrit :
> Christian,
> I was excited to see that those formatter settings are stored in the
> project, but it doesn't appear to work. I imported the
> org.eclipse.papyrus.infra.core plugin project into my workspace, noted
> that it refers to a formatter profile ("Papyrus") that doesn't exist in
> my workspace.

You can add a ResourceCreation task in Oomph to create the specific file
corresponding to the info needed by the workspace to "know" the profile.
For Sirius project, I added something like

Resource Creation:
* Target URL =
${workspace.location|uri}/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs
* Content =
cleanup_profile=_Sirius
org.eclipse.jdt.ui.cleanupprofiles=<?xml version\="1.0"... <-- Copy this
from an existig workspace
formatter_profile=_Sirius
org.eclipse.jdt.ui.formatterprofiles=<?xml version\="1.0"... <-- Copy
this from an existig workspace

The Oomph setup file for Sirius is not yet public because we are just
starting to try Oomph. But the formatter and cleanup work well.

So I edited one of the files, moved the opening curly
> brace to a new line which is against what the project settings show me
> (the project settings indicate that all opening braces are to be on the
> same line). But when I invoked Source > Format on my changed file, it
> did not apply the formatter rule to move the curly brace back. I think
> there are some bugs in Eclipse's handling of formatter settings when the
> specified profile doesn't exist. Try it on a clean workspace, without
> the Papyrus formatter profile, and see what you observe. Maybe I'm doing
> something wrong...although if so, there's some serious usability issues.
>
> Tying this back to Oomph, I don't know if or how it can correctly manage
> formatter settings if these are indeed bugs in the underlying JDT
> functionality.

Regards,

Laurent - Obeo
Re: Import project formatter profile [message #1522403 is a reply to message #1522277] Mon, 22 December 2014 09:39
Ed Merks is currently offline Ed MerksFriend
Messages: 26289
Registered: July 2009
Senior Member
Laurent,

That's a good idea. I hadn't yet investigated where these profiles are
saved...

On 22/12/2014 8:57 AM, Laurent Redor wrote:
> Hi Eric,
>
> Le 19/12/2014 15:42, Eric Rizzo a écrit :
>> Christian,
>> I was excited to see that those formatter settings are stored in the
>> project, but it doesn't appear to work. I imported the
>> org.eclipse.papyrus.infra.core plugin project into my workspace, noted
>> that it refers to a formatter profile ("Papyrus") that doesn't exist in
>> my workspace.
>
> You can add a ResourceCreation task in Oomph to create the specific
> file corresponding to the info needed by the workspace to "know" the
> profile. For Sirius project, I added something like
>
> Resource Creation:
> * Target URL =
> ${workspace.location|uri}/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs
>
> * Content =
> cleanup_profile=_Sirius
> org.eclipse.jdt.ui.cleanupprofiles=<?xml version\="1.0"... <-- Copy
> this from an existig workspace
> formatter_profile=_Sirius
> org.eclipse.jdt.ui.formatterprofiles=<?xml version\="1.0"... <-- Copy
> this from an existig workspace
>
> The Oomph setup file for Sirius is not yet public because we are just
> starting to try Oomph. But the formatter and cleanup work well.
>
> So I edited one of the files, moved the opening curly
>> brace to a new line which is against what the project settings show me
>> (the project settings indicate that all opening braces are to be on the
>> same line). But when I invoked Source > Format on my changed file, it
>> did not apply the formatter rule to move the curly brace back. I think
>> there are some bugs in Eclipse's handling of formatter settings when the
>> specified profile doesn't exist. Try it on a clean workspace, without
>> the Papyrus formatter profile, and see what you observe. Maybe I'm doing
>> something wrong...although if so, there's some serious usability issues.
>>
>> Tying this back to Oomph, I don't know if or how it can correctly manage
>> formatter settings if these are indeed bugs in the underlying JDT
>> functionality.
>
> Regards,
>
> Laurent - Obeo
Re: Import project formatter profile [message #1522476 is a reply to message #1522277] Mon, 22 December 2014 10:32
Laurent Redor is currently offline Laurent RedorFriend
Messages: 50
Registered: July 2009
Member
I forgot to mention that I also added this

> <item
value="${git.clone.sirius.location}/releng/org.eclipse.sirius.settings"
key="org.eclipse.jdt.ui.importorder.loadpath"/>
> <item
value="${git.clone.sirius.location}/releng/org.eclipse.sirius.settings"
key="org.eclipse.jdt.ui.cleanup.loadpath"/>
> <item
value="${git.clone.sirius.location}/releng/org.eclipse.sirius.settings"
key="org.eclipse.jdt.ui.codeformatter.loadpath"/>

in the existing resource creation task for
${workspace.location|uri}/.metadata/.plugins/org.eclipse.jdt.ui/dialog_settings.xml

Le 22/12/2014 08:57, Laurent Redor a écrit :
> Hi Eric,
>
> Le 19/12/2014 15:42, Eric Rizzo a écrit :
>> Christian,
>> I was excited to see that those formatter settings are stored in the
>> project, but it doesn't appear to work. I imported the
>> org.eclipse.papyrus.infra.core plugin project into my workspace, noted
>> that it refers to a formatter profile ("Papyrus") that doesn't exist in
>> my workspace.
>
> You can add a ResourceCreation task in Oomph to create the specific file
> corresponding to the info needed by the workspace to "know" the profile.
> For Sirius project, I added something like
>
> Resource Creation:
> * Target URL =
> ${workspace.location|uri}/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs
>
> * Content =
> cleanup_profile=_Sirius
> org.eclipse.jdt.ui.cleanupprofiles=<?xml version\="1.0"... <-- Copy this
> from an existig workspace
> formatter_profile=_Sirius
> org.eclipse.jdt.ui.formatterprofiles=<?xml version\="1.0"... <-- Copy
> this from an existig workspace
>
> The Oomph setup file for Sirius is not yet public because we are just
> starting to try Oomph. But the formatter and cleanup work well.
>
> So I edited one of the files, moved the opening curly
>> brace to a new line which is against what the project settings show me
>> (the project settings indicate that all opening braces are to be on the
>> same line). But when I invoked Source > Format on my changed file, it
>> did not apply the formatter rule to move the curly brace back. I think
>> there are some bugs in Eclipse's handling of formatter settings when the
>> specified profile doesn't exist. Try it on a clean workspace, without
>> the Papyrus formatter profile, and see what you observe. Maybe I'm doing
>> something wrong...although if so, there's some serious usability issues.
>>
>> Tying this back to Oomph, I don't know if or how it can correctly manage
>> formatter settings if these are indeed bugs in the underlying JDT
>> functionality.
>
> Regards,
>
> Laurent - Obeo
Re: Import project formatter profile [message #1522763 is a reply to message #1522476] Mon, 22 December 2014 14:17
Eric Rizzo is currently offline Eric RizzoFriend
Messages: 2414
Registered: July 2009
Senior Member
Laurent,
That's looks like a nice solution for Oomph.
I do think there is still a JDT bug in handling project-specific formatter settings when the profile doesn't exist in the workspace, so I'll probably produce a demo project and enter that against JDT separately.
Re: Import project formatter profile [message #1522909 is a reply to message #1522476] Mon, 22 December 2014 16:14
Christian W. Damus is currently offline Christian W. DamusFriend
Messages: 849
Registered: July 2009
Senior Member
Thanks, Laurent!

This works well for Papyrus. With your solution, I can create a vastly
different formatting profile and set it as my workspace default.
Papyrus projects are formatted using the Papyrus profile registered in
the JDT preferences, whereas other projects are obviously using my
workspace default.

The only concern that I have now, of course, is the problem of trying
to assemble a workspace that imports more than one project that all try
to create the same JDT preferences file. For example, if I import
Papyrus and, say, EMF, what kind of JDT dialog settings file will I end
up with? But I've started a new thread to discuss that question ...

Cheers,

Christian


On 2014-12-22 10:32:05 +0000, Laurent Redor said:

> I forgot to mention that I also added this
>
> > <item
> value="${git.clone.sirius.location}/releng/org.eclipse.sirius.settings"
> key="org.eclipse.jdt.ui.importorder.loadpath"/>
> > <item
> value="${git.clone.sirius.location}/releng/org.eclipse.sirius.settings"
> key="org.eclipse.jdt.ui.cleanup.loadpath"/>
> > <item
> value="${git.clone.sirius.location}/releng/org.eclipse.sirius.settings"
> key="org.eclipse.jdt.ui.codeformatter.loadpath"/>
>
> in the existing resource creation task for
> ${workspace.location|uri}/.metadata/.plugins/org.eclipse.jdt.ui/dialog_settings.xml
>
>
> Le 22/12/2014 08:57, Laurent Redor a écrit :
>> Hi Eric,
>>
>> Le 19/12/2014 15:42, Eric Rizzo a écrit :
>>> Christian,
>>> I was excited to see that those formatter settings are stored in the
>>> project, but it doesn't appear to work. I imported the
>>> org.eclipse.papyrus.infra.core plugin project into my workspace, noted
>>> that it refers to a formatter profile ("Papyrus") that doesn't exist in
>>> my workspace.
>>
>> You can add a ResourceCreation task in Oomph to create the specific file
>> corresponding to the info needed by the workspace to "know" the profile.
>> For Sirius project, I added something like
>>
>> Resource Creation:
>> * Target URL =
>> ${workspace.location|uri}/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs
>>
>>
>> * Content =
>> cleanup_profile=_Sirius
>> org.eclipse.jdt.ui.cleanupprofiles=<?xml version\="1.0"... <-- Copy this
>> from an existig workspace
>> formatter_profile=_Sirius
>> org.eclipse.jdt.ui.formatterprofiles=<?xml version\="1.0"... <-- Copy
>> this from an existig workspace
>>
>> The Oomph setup file for Sirius is not yet public because we are just
>> starting to try Oomph. But the formatter and cleanup work well.
>>
>> So I edited one of the files, moved the opening curly
>>> brace to a new line which is against what the project settings show me
>>> (the project settings indicate that all opening braces are to be on the
>>> same line). But when I invoked Source > Format on my changed file, it
>>> did not apply the formatter rule to move the curly brace back. I think
>>> there are some bugs in Eclipse's handling of formatter settings when the
>>> specified profile doesn't exist. Try it on a clean workspace, without
>>> the Papyrus formatter profile, and see what you observe. Maybe I'm doing
>>> something wrong...although if so, there's some serious usability issues.
>>>
>>> Tying this back to Oomph, I don't know if or how it can correctly manage
>>> formatter settings if these are indeed bugs in the underlying JDT
>>> functionality.
>>
>> Regards,
>>
>> Laurent - Obeo
Forum: OM2M
 Topic: Using CoAP based applications (Copper vs Erbium)
Re: Using CoAP based applications (Copper vs Erbium) [message #1522742 is a reply to message #1517683] Mon, 22 December 2014 14:04
Fesseha Tsegaye is currently offline Fesseha TsegayeFriend
Messages: 8
Registered: October 2014
Junior Member
No, the statusCode can not be both 2.01 and 5.03 at the same time. I used || because both situations had bigger payload in the response message.
Re: Using CoAP based applications (Copper vs Erbium) [message #1522930 is a reply to message #1522742] Mon, 22 December 2014 16:26
Mahdi Ben Alaya is currently offline Mahdi Ben AlayaFriend
Messages: 57
Registered: November 2013
Member
Trust me, this is not what my code did.
My code says: if the statusCode is different from 2.01 and is also different from 5.03 then set the payload to the response.
In other words the payload will not be set for 2.01 and even 5.03, and this is what you want.
I suggest you to reread carefully my code Wink



[Updated on: Mon, 22 December 2014 16:30]

Report message to a moderator

Forum: EMF
 Topic: One EClass for Two Ecore models
Re: One EClass for Two Ecore models [message #1522224 is a reply to message #1516221] Mon, 22 December 2014 07:17
Jan Reimann is currently offline Jan ReimannFriend
Messages: 128
Registered: July 2009
Senior Member
Hi,

Am 18.12.2014 um 19:50 schrieb Vinicius Pereira:
> For example, in a model I show how to map a formal element to an UML
> element using a mapping.
> In the other model, I show how to create the mapping that I use above.
>
> In my opinion, two models was better... So I just put everything in one
> model?
what you really want is one ecore model but several different kinds of
representation of this model. I assume you want to present different
views on the same model. You can definitely do that (e.g. with several
Ecore Diagrams) but the model is the only one, as Ed already said.

cheers,
Jan
 Topic: Is there a known vulnerability with concurrent calls to ResourceSetImpl.add(Resource)?
Re: Is there a known vulnerability with concurrent calls to ResourceSetImpl.add(Resource)? [message #1521754 is a reply to message #1520647] Mon, 22 December 2014 00:54
Nicolas Rouquette is currently offline Nicolas RouquetteFriend
Messages: 146
Registered: July 2009
Senior Member
Ed,

Quote:

> If it does, then why would adding synchronization using the resource
> set itself be a source of deadlock?
Because the method you added it to calls what else, which calls what
else, which does what other kinds of locking and synchronization?
Goodness only knows, but what you're proposing is like going to
ArrayList and modifying the add method to be synchronized; it's just not
the intent of the ArrayList implement to be thread safe in this way.
...
> Even though it may not be the best way to fix the problem, it's
> interesting that adding a synchronization on
> ResourceSetImpl.add(Resource) suffices to avoid this problem (it could
> cause others as Ed M pointed out).
Better to fix the problem specific to the use of the one resource set by
the dynamic package registry.


Does the fix below correspond to your suggestion to fix the specific problem in the dynamic package registry?

https://www.eclipse.org/forums/index.php?t=msg&th=899781&goto=1519861&#msg_1519861

- Nicolas.
Re: Is there a known vulnerability with concurrent calls to ResourceSetImpl.add(Resource)? [message #1522402 is a reply to message #1521754] Mon, 22 December 2014 09:36
Ed Merks is currently offline Ed MerksFriend
Messages: 26289
Registered: July 2009
Senior Member
Nicolas,

Comments below.

On 22/12/2014 1:54 AM, Nicolas Rouquette wrote:
> Ed,
>
> Quote:
>> > If it does, then why would adding synchronization using the
>> resource > set itself be a source of deadlock?
>> Because the method you added it to calls what else, which calls what
>> else, which does what other kinds of locking and synchronization?
>> Goodness only knows, but what you're proposing is like going to
>> ArrayList and modifying the add method to be synchronized; it's just
>> not the intent of the ArrayList implement to be thread safe in this way.
>> ...
>> > Even though it may not be the best way to fix the problem, it's >
>> interesting that adding a synchronization on >
>> ResourceSetImpl.add(Resource) suffices to avoid this problem (it
>> could > cause others as Ed M pointed out).
>> Better to fix the problem specific to the use of the one resource set
>> by the dynamic package registry.
>
>
> Does the fix below correspond to your suggestion to fix the specific
> problem in the dynamic package registry?
No, that logic focuses on guarding the creation of a new resource, but
one most also consider the logic that simply finds a resource already in
the resource set while a second thread is creating a resource. Perhaps
the second thread will need to grow the underlying list while the first
thread is iterating over it. All access, both read and write, needs
guarding. That could be done by synchronizing on the resource set
rather than adding synchronize to specialized methods of the resource set.

Also, I see no need to check that a resource factory actually returns a
resource given that the list of resources itself is guarded to prevent
null from being added.
>
> https://www.eclipse.org/forums/index.php?t=msg&th=899781&goto=1519861&#msg_1519861
>
>
> - Nicolas.
Re: Is there a known vulnerability with concurrent calls to ResourceSetImpl.add(Resource)? [message #1522949 is a reply to message #1522402] Mon, 22 December 2014 16:44
Nicolas Rouquette is currently online Nicolas RouquetteFriend
Messages: 1
Registered: December 2014
Junior Member
Ed,

Ed Merks wrote on Mon, 22 December 2014 09:36

> Does the fix below correspond to your suggestion to fix the specific
> problem in the dynamic package registry?
No, that logic focuses on guarding the creation of a new resource, but
one most also consider the logic that simply finds a resource already in
the resource set while a second thread is creating a resource. Perhaps
the second thread will need to grow the underlying list while the first
thread is iterating over it. All access, both read and write, needs
guarding. That could be done by synchronizing on the resource set
rather than adding synchronize to specialized methods of the resource set.


Is that enough?

Synchronizing access to the ResourceSet does not guarantee synchronized access to the list of Resources.

Consider a typical use of the API:

ResourceSet rs = ...;
rs.getResources().add(...);

Synchronizing access to rs will only serialize the calls to rs.getResources() but it won't guarantee serialization of the additions.

- Nicolas.

Forum: Proposals
 Topic: New Project Proposal: Titan
Re: New Project Proposal: Titan [message #1522968 is a reply to message #1455487] Mon, 22 December 2014 16:57
Benoit VIAUD is currently offline Benoit VIAUDFriend
Messages: 1
Registered: July 2014
Junior Member
Hi everybody,

The download section on the Titan project page is empty.
Do you have any idea when it shall be accessible?

Best regards
Forum: C / C++ IDE (CDT)
 Topic: No source available 0x... when trying to debug the Linux kernel
No source available 0x... when trying to debug the Linux kernel [message #1522416] Mon, 22 December 2014 09:45
Christian Pinedo is currently offline Christian PinedoFriend
Messages: 1
Registered: December 2014
Junior Member
Hello,

I'm trying to debug the linux kernel by following the instruction provideed in multiple websites. However, whenever I try to debug the compiled Linux kernel I always obtain a "No available source 0x.." and it is impossible to debug the code. (See the attachment)

1. I run a qemu image with the kernel a "qemu -s -S -kernel bzImage ...."

2. I launch the debug in Eclipse. I configured a "C/C++ Attach to Application" debug. The application is the vmlinux file and the remote connection is configured as gdbserver to localhost ip address and the TCP 1234.

On the other hand, I can debug the linux kernel using the gdb CLI:

# gdb vmlinux
> target remote localhost:1234
> cont

Could you give any advice to solve this? Thanks in advance,

Christian
 Topic: How to run automatically compiled .exe in external console (cmd.exe)
Re: How to run automatically compiled .exe in external console (cmd.exe) [message #1522564 is a reply to message #1521250] Mon, 22 December 2014 11:44
Al Go is currently offline Al GoFriend
Messages: 4
Registered: December 2014
Junior Member
Thanks a lot, that what I did want.
By the way, where can I find description of Arguments (/C, /K.. etc.)?
Re: How to run automatically compiled .exe in external console (cmd.exe) [message #1522579 is a reply to message #1522564] Mon, 22 December 2014 11:54
Joost Kraaijeveld is currently offline Joost KraaijeveldFriend
Messages: 192
Registered: July 2009
Senior Member
On 22-12-14 12:44, Al Go wrote:
> Thanks a lot, that what I did want.
> By the way, where can I find description of Arguments (/C, /K.. etc.)?

http://technet.microsoft.com/en-us/library/6ec588db-31a9-4a73-a970-65a2c6f4abbe
Re: How to run automatically compiled .exe in external console (cmd.exe) [message #1522611 is a reply to message #1522579] Mon, 22 December 2014 12:20
Al Go is currently offline Al GoFriend
Messages: 4
Registered: December 2014
Junior Member
>Joost Kraaijeveld, Klaus Mr

Thanks again, it is very useful.
But I have one minor issue with the described above method.
My program during execution should load external image file from the same catalog where .exe file is, let say "img.png".
When I run program manually, everything goes ok.
But when I run it with the described above method via "External Tool Configuration", the program is unable to load this file and I get error message:
"Failed to load image "img.png". Reason: Unable to open file"
I suppose this is due to run cmd.exe not from the catalog where .exe file is.
Is it possible to fix it somehow, to be possible to load the file when run the program from inside Eclipse?

 Topic: Temporary makexxxx-1.bat file not created by build process
Re: Temporary makexxxx-1.bat file not created by build process [message #1522993 is a reply to message #1521287] Mon, 22 December 2014 17:15
Klaus Mr is currently online Klaus MrFriend
Messages: 123
Registered: November 2011
Senior Member
Hello,

i would try the same in a workspace that does not use any space in folder names.

E.g. MinGW warns:
http://www.mingw.org/wiki/getting_started

Quote:
MinGW may have problems with paths containing spaces, and if not, usually other programs used with MinGW will experience problems with such paths. Thus, we strongly recommend that you do not install MinGW in any location with spaces in the path name reference.


regards,
Klaus



Pages (2): [ «    1  2]


Current Time: Mon Dec 22 17:18:40 GMT 2014

Powered by FUDForum. Page generated in 0.02471 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software