Friday, February 20, 2009

Negative search

Dimitrios Kolovos posted a while ago a plugin to allow negative searches within Eclipse (how to find a file that does not contain a given String). I didn't want to install yet another plugin in my Eclipse and thought that regexes should allow for this.

Well they do :) here's a regex that will match any file if it does not contain "Copyright" (can be quite useful, that :p).

(?s)\A((?!Copyright).)*\Z

Monday, February 9, 2009

no more unresolvable EMF Compare failures

Ever tried using EMF Compare to compare your models only to see it fail somehow? Metamodels often evolve, making the old models unusable. Sometimes the models themselves aren't valid and cannot be loaded through EMF. On such occasion, trying to compare the files through EMF Compare simply failed, opening a blank editor and logging an exception.

That left you with no way to compare your files, save for renaming them to another extension. Well fear no more! As of 0.9M3, EMF Compare now displays a pretty error message when something goes wrong while loading the models.
Apart from frustrating you with this all too often seen red icon, this dialog provides you with the option to compare the files as text. Oh goodie!
Well of course, xmi isn't really a human-friendly language ... but at least this is way better than nothing to spot that stupid typo and make the model useable again :).