Archive for December 15th, 2006

Don’t $@!% with IDocument.DEFAULT_CONTENT_TYPE

Friday, December 15th, 2006

I’ve been doing some general bug fixing of the Specfile Editor today and noticed that we had some problems with partitioning the document. We had defined 4 types of partitions for spec files:

  • Files (for a single %files section)
  • Scriptlets (i.e. %post, %prep, etc.)
  • Changelog
  • Default (for everything that is not one of the above)

What I noticed is that the default partition never got used, instead the IDocument.DEFAULT_CONTENT_TYPE partition was used for this. After digging through the code for a while and “fixing” what seemed to be the places that caused this, I ended up completely foobaring the partitioner.

Turns out that the Eclipse Text framework doesn’t support having a different default partition, and will happily barf in your lap if you try to force it.

Morale of the story children: Don’t $@!% with IDocument.DEFAULT_CONTENT_TYPE.