Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Oomph » Working set Location predicate on different platforms
Working set Location predicate on different platforms [message #1777364] Tue, 28 November 2017 21:00 Go to next message
Ernesto Posse is currently offline Ernesto PosseFriend
Messages: 387
Registered: March 2011
Senior Member
Is the location predicate sensitive to the path separator of different platforms?

In a setup model I have the following:

        name="${} - tooling">

... which works on macOS (and presumably on Linux, although I haven't tested it there), but it is ignored on Windows. Must I write the following (quite horrible) predicate?

        name="${} - tooling">

Not only that is quite unappealing and error prone, but some messages in the forum (cf suggest that using this with \\ doesn't work.

I've been looking for the implementation of the Working Sets task in Oomph's git repo at but I can't find where this is implemented. Where should I look?

By the way, is "Pattern" supposed to be a Java regex according to java.util.regex.Pattern, or some inhouse pattern?

[Updated on: Tue, 28 November 2017 21:01]

Report message to a moderator

Re: Working set Location predicate on different platforms [message #1777399 is a reply to message #1777364] Wed, 29 November 2017 08:12 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 31467
Registered: July 2009
Senior Member
It's implemented by org.eclipse.oomph.predicates.impl.LocationPredicateImpl.matches(IResource) like this:
  public boolean matches(IResource resource)
    if (resource != null)
      IPath location = resource.getLocation();
      if (location != null)
        return getCompiledPattern().matcher(location.toPortableString()).matches();

    return false;
That uses java.util.regex.Pattern and apparently toPortableString does use "/" as a separator. But it seems to me you have to be pretty careful with ${git.clone.posysml.location} because that might well look like it has patterns in it, and will definitely use a \ on Windows. It's better to use ${git.clone.posysml.location|path} to be sure that / is used and not \, also also likely safer to use \Q${git.clone.posysml.location|path}\E to ensure that it's used literally and not in any way as a pattern.

Ed Merks
Professional Support:
Previous Topic:User.setup preferences contains lots of REMOVE_PREFERENCES_MARKER
Next Topic:Preferences not updated on restart
Goto Forum:

Current Time: Sat Sep 19 19:03:24 GMT 2020

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

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

Back to the top